diff --git a/queries/useQueryMatchingPoolForSwap/util/selectEligiblePoolsForTokenToTokenSwap.ts b/queries/useQueryMatchingPoolForSwap/util/selectEligiblePoolsForTokenToTokenSwap.ts index 0e8c567..c369643 100644 --- a/queries/useQueryMatchingPoolForSwap/util/selectEligiblePoolsForTokenToTokenSwap.ts +++ b/queries/useQueryMatchingPoolForSwap/util/selectEligiblePoolsForTokenToTokenSwap.ts @@ -14,7 +14,7 @@ export function selectEligiblePoolsForTokenToTokenSwap({ tokenB, poolsList, }: SelectEligiblePoolsForTokenToTokenSwapArgs) { - return poolsList.reduce( + let eligiblePools = poolsList.reduce( (result, pool) => { const [poolAssetA, poolAssetB] = pool.pool_assets @@ -98,4 +98,12 @@ export function selectEligiblePoolsForTokenToTokenSwap({ passThroughPools: [], } as MatchingPoolsForTokenToTokenSwap ) + if ( + eligiblePools.poolForDirectTokenAToTokenBSwap || + eligiblePools.poolForDirectTokenBToTokenASwap + ) { + eligiblePools.passThroughPools = [] + } + console.log(eligiblePools) + return eligiblePools }