diff --git a/packages/asset-swapper/src/utils/market_operation_utils/path_optimizer.ts b/packages/asset-swapper/src/utils/market_operation_utils/path_optimizer.ts index e5a1fd9325..dd5627fa10 100644 --- a/packages/asset-swapper/src/utils/market_operation_utils/path_optimizer.ts +++ b/packages/asset-swapper/src/utils/market_operation_utils/path_optimizer.ts @@ -77,7 +77,7 @@ function mixPaths( nextAllFills.splice(i, 1); // Recurse. _walk( - [...path, fill], + nextPath, input.plus(BigNumber.min(remainingInput, fill.input)), output.plus( // Clip the output of the next fill to the remaining