Skip to content

Commit

Permalink
prefer direct swaps (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
ben2x4 authored Nov 28, 2022
1 parent 70f995f commit f7414cd
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -98,4 +98,12 @@ export function selectEligiblePoolsForTokenToTokenSwap({
passThroughPools: [],
} as MatchingPoolsForTokenToTokenSwap
)
if (
eligiblePools.poolForDirectTokenAToTokenBSwap ||
eligiblePools.poolForDirectTokenBToTokenASwap
) {
eligiblePools.passThroughPools = []
}
console.log(eligiblePools)
return eligiblePools
}

0 comments on commit f7414cd

Please sign in to comment.