You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When user specify assetIn and assetOut on trade page
And best route is found by SDK
We should check on runtime, if route for specified pair is also existing on on chain router.
If route is not existing, check should be done if this is best route also for assetIn value 1% of liquidity for specified asset.
Add to on chain router route, which is best one for 1% of liquidity.
Check if route for specified pair is on runtime router:
router.routes(10,0)=>route was not found
Check if route is best also for 1% of liquidity (check SDK for same asset combination, but assetIn will be amount of 1% of liquidity of specific asset)
How to find out how much liquidity is for specified asset?
Find in which pool assetIn is- either omnipool,stablepool or xyk
Get token balance tokens.accounts(accountId,assetid)
for omnipool accountId is 7L53bUTBbfuj14UpdCNPwmgzzHSsrsTWBHX5pys32mVWM3C1
for stablepool&xyk its address of the pool (mind decimal points of asset when checking how much of token is in the pool)
When user specify assetIn and assetOut on trade page
And best route is found by SDK
We should check on runtime, if route for specified pair is also existing on on chain router.
If route is not existing, check should be done if this is best route also for assetIn value 1% of liquidity for specified asset.
Add to on chain router route, which is best one for 1% of liquidity.
Example:
assetIn (10)
assetOut (0)
route found by SDK:
Check if route for specified pair is on runtime router:
router.routes(10,0)=>route was not found
Check if route is best also for 1% of liquidity (check SDK for same asset combination, but assetIn will be amount of 1% of liquidity of specific asset)
How to find out how much liquidity is for specified asset?
Find in which pool assetIn is- either omnipool,stablepool or xyk
Get token balance tokens.accounts(accountId,assetid)
Add best route returned by SDK (for 1% of liquidity) to on chain router
The text was updated successfully, but these errors were encountered: