I want to query the transaction numbers of the liquidity pools of PancakeSwap and so that decide which 10000 of them are the most active ones (there are 1.2M). How can I do this using Ethers.js or anything else?
1 Answer
You can get the 1k pairs with this function:
const getAllPairs = async () => {
try {
let pairs = []
for(let i = 0; i < 10; i++){
const result = await factory.allPairs(i)
pairs.push(result)
}
console.log(pairs)
} catch (error) {
console.log(error)
}
}
And order by totalSupply()