I publish tokenA

I add liquidity to tokenA/usdt

I then want to use my "cake" to get tokenA

Pancakeswap website discover there is no liquidity cake->tokenA, it then could very intelligently find the path cake->usdt->tokenA and report the suggested price.

What is the algorithm of pancakeswap website in finding multi hop path?

1 Answer 1


sorry for the late reply.

Pancakeswap achieves multihops with Uniswaps V3 router which acts as a wrapper to V2 Router. You can checkout the sources here:

https://github.com/Uniswap/v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol https://docs.uniswap.org/protocol/guides/swaps/multihop-swaps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.