Context
I'm trying to build a program that trades on Osmosis. I want to use dynamic routes, meaning don't want to use hard coded routes for my trades.
Problem/Question
I haven't been able to find a method that calculate these routes for me yet. I'm aware of getRoutesForTrade which needs an array called pairs. Here's where the problem(or at least I think) arises because the array pairs is calculated from the pools using the makePoolPairs method. As you can see here the method makePoolPairs filters the pools into gamm pools only.
return pools
.filter(
(pool) =>
pool.poolAssets.length === 2 &&
pool.poolAssets.every(({ token }) => !token.denom.startsWith("gamm")) && // No concentrated liquidity pool allowed
new BigNumber(calcPoolLiquidity(assets, pool, prices)).gte(liquidityLimit)
)
I'm also aware that we can fetch the gamm equivalents of these concentratedPools. As application devs;
- Are we expected to query all
gamm pools, calculate routes using those and convert results to concentrated equivalent, if linked?
Context
I'm trying to build a program that trades on Osmosis. I want to use dynamic routes, meaning don't want to use hard coded routes for my trades.
Problem/Question
I haven't been able to find a method that calculate these routes for me yet. I'm aware of getRoutesForTrade which needs an array called
pairs. Here's where the problem(or at least I think) arises because the arraypairsis calculated from thepoolsusing the makePoolPairs method. As you can see here the methodmakePoolPairsfilters the pools intogammpools only.I'm also aware that we can fetch the
gammequivalents of theseconcentratedPools. As application devs;gammpools, calculate routes using those and convert results toconcentratedequivalent, if linked?