From 76363a9b565f2b7e65ae004d9a5aa31c45fbd78c Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Wed, 9 Aug 2023 12:26:52 +0100 Subject: [PATCH] Add tripaths to routeProposer. --- src/routeProposal/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/routeProposal/index.ts b/src/routeProposal/index.ts index 54a1a7cc..3be52fe8 100644 --- a/src/routeProposal/index.ts +++ b/src/routeProposal/index.ts @@ -14,6 +14,7 @@ import { SorConfig, PoolDictionary, } from '../types'; +import { getTriPaths } from './triPaths'; export class RouteProposer { cache: Record = {}; @@ -79,9 +80,17 @@ export class RouteProposer { this.config ); + const triPaths = getTriPaths( + tokenIn, + tokenOut, + poolsAllDict, + this.config.triPathMidPoolIds ?? [] + ); + const combinedPathData = pathData .concat(...boostedPaths) - .concat(...pathsUsingStaBal); + .concat(...pathsUsingStaBal) + .concat(...triPaths); const [paths] = calculatePathLimits(combinedPathData, swapType); this.cache[`${tokenIn}${tokenOut}${swapType}${swapOptions.timestamp}`] =