Hi, hope you're well. It's quite hard to find relevant information when we are developing our own code so i try here hoping it may help other people.
I'm looking about getting the best price (meaning having the best 'path') before calling my swap function (ex swapExactTokensForXXX). So here the third parameter is the raw path provided but if you're using pancakeswap for ex, you'll see that before swapping it will be able to find for you the best route / path in order to provide you the best price. For ex instead of stupidly working with the pool token1/token2, it will propose a best price with the route token1/tokenX/token2, using different liquidity pools.
So my question is; do you have any clue about how to find the best route when dealing with these contracts ?
Thanks a lot,
Cheers.
[edit] Interesting links:
https://github.com/uniswap-integration/simple-uniswap-sdk#uniswap-pair-factory
Hi, hope you're well. It's quite hard to find relevant information when we are developing our own code so i try here hoping it may help other people.
I'm looking about getting the best price (meaning having the best 'path') before calling my swap function (ex swapExactTokensForXXX). So here the third parameter is the raw path provided but if you're using pancakeswap for ex, you'll see that before swapping it will be able to find for you the best route / path in order to provide you the best price. For ex instead of stupidly working with the pool token1/token2, it will propose a best price with the route token1/tokenX/token2, using different liquidity pools.
So my question is; do you have any clue about how to find the best route when dealing with these contracts ?
Thanks a lot,
Cheers.
[edit] Interesting links:
https://github.com/uniswap-integration/simple-uniswap-sdk#uniswap-pair-factory