pancake-info-api icon indicating copy to clipboard operation
pancake-info-api copied to clipboard

Huge Price Differences Between Frontend & APIs

Open mrcolak opened this issue 3 years ago • 10 comments

Hello

Lately I noticed that the difference between frontend and APIs are getting bigger.

Pancakeswap V2 Frontend 0.0000000992146 image

https://api.pancakeswap.info/api/v2/tokens 0.0000000219983 image

https://api.pancakeswap.info/api/v2/tokens/0x4A824eE819955A7D769e03fe36f9E0C3Bd3Aa60b 0.0000000343884 image

This coin is just an example, lots of coins has this issue right now. Even though API says prices updates 5-10 minutes ago, its not even close to the actual price

mrcolak avatar May 12 '21 13:05 mrcolak

I'm just confirming this. I just checked half a dozen coins or so and they were all off significantly (~9%).

dhelland avatar May 13 '21 20:05 dhelland

It's seems are not real time:

Results are cached for 5 minutes (or 300 seconds).

omalave avatar May 14 '21 01:05 omalave

It's seems are not real time:

Results are cached for 5 minutes (or 300 seconds).

Yes, API already tells you the exact timestamp. Also sometimes results are cached for up to 30-45 minutes. But thats not the issue here.

The prices which API shows for some tokens were from days ago. For example, the price went up from ~1 to ~10 two days ago. But API still shows ~1.

However, the issue seems to be solved after this ticket. Maybe someone fixed the issue but forgot to reply.

mrcolak avatar May 14 '21 02:05 mrcolak

Please can someone fix the problems with the cache. The timestamps shows the prices are taking as long as an hour to update, and not every 5 minutes as described in the documentation. Thanks.

gogetta69 avatar May 14 '21 03:05 gogetta69

Same problem here, the prices are static between calls. I have checked pancakeswap for the same token and the whole site seems to be having problems. If you check a token the trades are from 14 hours ago.

andrewj267 avatar May 14 '21 12:05 andrewj267

Looks like the problem is being delt with -

https://github.com/pancakeswap/pancake-subgraph/issues/50

andrewj267 avatar May 17 '21 11:05 andrewj267

I came back to share an alternative to getting prices. Just swap the token.

https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=0xacFC95585D80Ab62f67A14C566C1b7a49Fe91167&sellAmount=1000000000000000000&excludedSources=BakerySwap,Belt,DODO,DODO_V2,Ellipsis,Mooniswap,MultiHop,Nerve,SushiSwap,Smoothy,ApeSwap,CafeSwap,CheeseSwap,JulSwap,LiquidityProvider&slippagePercentage=0&gasPrice=0

Docs: https://0x.org/docs/api

I hope it helps someone else.

gogetta69 avatar May 27 '21 14:05 gogetta69

I came back to share an alternative to getting prices. Just swap the token.

https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=0xacFC95585D80Ab62f67A14C566C1b7a49Fe91167&sellAmount=1000000000000000000&excludedSources=BakerySwap,Belt,DODO,DODO_V2,Ellipsis,Mooniswap,MultiHop,Nerve,SushiSwap,Smoothy,ApeSwap,CafeSwap,CheeseSwap,JulSwap,LiquidityProvider&slippagePercentage=0&gasPrice=0

Docs: https://0x.org/docs/api

I hope it helps someone else.

Brilliant, thank you.

andrewj267 avatar May 27 '21 15:05 andrewj267

I came back to share an alternative to getting prices. Just swap the token.

https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=0xacFC95585D80Ab62f67A14C566C1b7a49Fe91167&sellAmount=1000000000000000000&excludedSources=BakerySwap,Belt,DODO,DODO_V2,Ellipsis,Mooniswap,MultiHop,Nerve,SushiSwap,Smoothy,ApeSwap,CafeSwap,CheeseSwap,JulSwap,LiquidityProvider&slippagePercentage=0&gasPrice=0

Docs: https://0x.org/docs/api

I hope it helps someone else.

Awesome resource

GMaiolo avatar Jun 06 '21 20:06 GMaiolo

I came back to share an alternative to getting prices. Just swap the token.

https://bsc.api.0x.org/swap/v1/quote?buyToken=BUSD&sellToken=0xacFC95585D80Ab62f67A14C566C1b7a49Fe91167&sellAmount=1000000000000000000&excludedSources=BakerySwap,Belt,DODO,DODO_V2,Ellipsis,Mooniswap,MultiHop,Nerve,SushiSwap,Smoothy,ApeSwap,CafeSwap,CheeseSwap,JulSwap,LiquidityProvider&slippagePercentage=0&gasPrice=0

Docs: https://0x.org/docs/api

I hope it helps someone else.

Excellent alternative!

luiztools avatar Sep 26 '22 00:09 luiztools