Token Price Error | "No pools found with enough liquidity"

Greetings, Fellow Moralians!

It seems this issue occurred before:

What Happened:
However, apparently this issue has returned (I would imagine others may be experiencing this as well). Everything was working fine and then it suddenly stopped working. There were no code changes, updates, system changes, etc. on my part. I first noticed these errors about two or three days ago.

Perhaps this is due to the high BSC network load spikes we are occasionally experiencing?

Useful Technical Information:
My request looks like:
(Request Headers Excluded for API-Key Privacy)

Try these contracts if you are curious to GET THE ERROR, (as of now, they will return the error):

These contracts WILL NOT RETURN THE ERROR. The API works PROPERLY with these contracts:

Big thanks to the community for coming together and helping one another out. If there is anything whatsoever I could do, provide, give etc. to help you find a solution to this issue, please let me know! 

Thank you!
1 Like

I get the same error, it looks like your examples had relatively new liquidity pools, but they should work.
We’ll have to investigate, thanks for reporting.

1 Like

Any luck with this? Thank you

Thanks for chiming in! Well, yes. However, it involves a sub-optimal workaround. Use at your own risk.

Here is the alterative way of acquiring the price of a BSC token:

1.) Using the token’s pair address, acquire:

You’ll get a response that looks something like this (see below). In this case, we are trying to ultimately get the price of HWL token:

    "token_address": "0x549cc5df432cdbaebc8b9158a6bdfe1cbd0ba16d",
    "name": "HOWL",
    "symbol": "HWL",
    "logo": null,
    "thumbnail": null,
    "decimals": "18",
    "balance": "1727582155888001543598664"
    "token_address": "0xe9e7cea3dedca5984780bafc599bd69add087d56",
    "name": "BUSD Token",
    "symbol": "BUSD",
    "logo": null,
    "thumbnail": null,
    "decimals": "18",
    "balance": "364192882503381852662679"

2.) Divide the “balance” property of each token by 10 to the power of their decimal value. In this case, that comes out to:

“decimals”: 18
“balance”: 364192882503381852662679
364192882503381852662679 / 10^18 = 364,192
So, in other words, we have $364,192 in liquidity.
“decimals”: 18
“balance”: 1727582155888001543598664
1727582155888001543598664 / 10^18 = 1,727,582
This means we have 1,727,582 HWL tokens in liquidity.

3.) Final Steps:
We just have to divide the amount of liquidity by the number of HWL tokens, then we get the price!

364,192 / 1,727,582 = 0.21081025386928
The token price is $0.21081025386928

I hope this helps, and I hope you have an amazing weekend and wonderful holidays!

1 Like