diff --git a/modules/sor/sorV2/sorV2.service.ts b/modules/sor/sorV2/sorV2.service.ts index aed55dfd..279c6545 100644 --- a/modules/sor/sorV2/sorV2.service.ts +++ b/modules/sor/sorV2/sorV2.service.ts @@ -288,7 +288,6 @@ export class SorV2Service implements SwapService { { chain, tokenIn, tokenOut, swapType, swapAmount, graphTraversalConfig }: GetSwapsInput, maxNonBoostedPathDepth = 4, ): Promise { - const MAX_INCREASED_PATH_DEPTH = maxNonBoostedPathDepth + 1; try { const poolsFromDb = await this.getBasePools(chain); const tIn = await getToken(tokenIn as Address, chain); @@ -312,15 +311,12 @@ export class SorV2Service implements SwapService { maxNonBoostedPathDepth, ); const swap = await sorGetSwapsWithPools(tIn, tOut, swapKind, swapAmount, poolsFromDb, config); - if (!swap && maxNonBoostedPathDepth < MAX_INCREASED_PATH_DEPTH) { + if (!swap && maxNonBoostedPathDepth < 5) { return this.getSwapResult(arguments[0], maxNonBoostedPathDepth + 1); } return new SwapResultV2(swap, chain); } catch (err: any) { - if ( - err.message.includes('No potential swap paths provided') && - maxNonBoostedPathDepth < MAX_INCREASED_PATH_DEPTH - ) { + if (err.message.includes('No potential swap paths provided') && maxNonBoostedPathDepth < 5) { return this.getSwapResult(arguments[0], maxNonBoostedPathDepth + 1); } console.error(