Can't get some LP token prices

Hi,

I can’t get the prices of some LP tokens listed on PancakeSwap v2.
I’m getting this error message: ‘No pools found with enough liquidity, to calculate the price’.

I use javascript code like this:

const lpTokens_usdPrice = (await axios.get(`https://deep-index.moralis.io/api/v2/erc20/${lpTokens_address}/price?chain=bsc&exchange=pancakeswap-v2`,{
                    headers: {
                        'x-api-key': process.env.MORALIS_API_KEY
                    }
                })).data.usdPrice;

I tried it on the “try it out” Moralis Web3 API page, and I got the same error.

Here an example of some specific lp token contract addresses used:
0x007EC643C7Cc33a70C083fC305c283dd009C8b94 (GMT-USDC farm)
0x28BDb16b623176426305a70D8B475bE73Aca71f3 (USDT-ACH farm)

Thanks in advance for any help!

It seems like the Moralis token price Web3 API can’t provide prices for newest added lp token farms in PancakeSwap.
For my case, can’t get the prices for lp token farms with IDs 509 “USDT-ACH”, 510 “BTT-BUSD”, 513 “ERA-WBNB”, 514 “GMT-USDC”, 515 “Cake-DUET”, and 516 “BSW-WBNB”.

do you also have examples that work?

Yes @cryptokid. Most of the lp token farms listed on PancakeSwap v2 works

can you give an example that works?

  • Cake-WBNB, fid=251, address=0x0eD7e52944161450477ee417DE9Cd3a859b14fD0
  • WBNB-BUSD, fid=252, address=0x58F876857a02D6762E0101bb5C46A8c1ED44Dc16
  • ADA-WBNB, fid=253, address=0x28415ff2C35b65B9E5c7de82126b4015ab9d031F
  • USDT-USDC, fid=423, address=0xEc6557348085Aa57C72514D67070dC863C0a5A8c
  • RACA-BUSD, fid=507, address=0x8e744Ec2795c8B836689d1b4EBE1489204357dAC

PancakeSwap Factory v2 address used: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73

  • ETH-BTCB, fid=408, address=0xf03b2C66722a903eA579575A5230Ee3A37E06082

Value returned:


USD price on PancakeSwap:
value2

you got that response with this request?

https://deep-index.moralis.io/api/v2/erc20/0xf03b2C66722a903eA579575A5230Ee3A37E06082/price?chain=bsc

asking because it seems that it doesn’t work for me

Sorry, I made a mistake, the ETH-BTCB lp token farm contract address is 0xD171B26E4484402de70e3Ea256bE5A2630d7e88D, not 0xf03b2C66722a903eA579575A5230Ee3A37E06082.

It works with this this node.js JS code:


The returned result:
node2