Contract Invocation – How to Find PancakeSwap Coin Pairs Smart Contracts Addresses

binancecontract-invocationpancakeswap

where can I find the smart contract address of all (or the major) coin pairs of the pancakeswap AMM. I can't find it anywhere and searching on google yields random articles.

Best Answer

The factory contract - PancakeFactory - is here:

https://bscscan.com/address/0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73

If you read the contract, you'll see that allPairsLength gives you 14,690 pairs. This refers to the number of PancakePair-type contracts.

The addresses can be found by reading the allPairs array in PancakeFactory by specifying the index you want. In the absence of anything clever, like Uniswap's Subgraph API (see "All Pairs In Uniswap") you'll probably just have to write a simple looping function to iterate through the array.

Edit:

Actually, this API will give you the top 1,000 pairs... (sorted by reserves)

https://api.pancakeswap.info/api/v2/pairs

Filter on pair_address.

Related Topic