Getting Reserve0 and Reserve1 Contract Address

Hi All,

Can anyone offer advice? Iโ€™m using the endpoint to get the liquidity pair information. The endpoint works as expected, except itโ€™s not always certain which token is reserve0 and which is reserve1. When I programmed my application, I assumed that reserve1 was always WBNB, but it turns out that the addresses for reserve0 and reserve1 are set in the LP contract.

How can I get that token info so that I can correctly calculate the amount of WBNB/USDC/USDT/BUSD in the LP?

It looks like when you use the endpoint for the pair address, you will get the right reserver0 and reserve1 token even if you use as parameters (addressA, addressB) or (addressB, addressA)

1 Like