Using python 3.10, web3 v5.31.1
Given only the contract address for a single token (tokenA), is there a method from PancakeSwap to return liquidity pool (LP) details?
Mainly given only the address of tokenA, how can I find out what LP is set up for tokenA?
Furthermore, assuming I want to buy tokenA with BNB, but tokenA has a LP with some other token, tokenB, but tokenB has an LP with BNB, I can swap via BNB -> tokenB -> tokenA.
How do dApps such as https://poocoin.app find these routes to trade. The image below shows that the dApp found a valid route BNB -> BUSD -> USDT -> token. How is this accomplished?
I am new to coding web3 so example code would be greatly appreciated; thank you for help!