pancakeswap / pancake-info-api

Serverless API implementation for PancakeSwap on-chain data query.
328 stars 273 forks source link

Huge Price Differences Between Frontend & APIs #53

Open mrcolak opened 3 years ago

mrcolak commented 3 years ago

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

dhelland commented 3 years ago

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

omalave commented 3 years ago

It's seems are not real time:

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

mrcolak commented 3 years ago

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.

gogetta69 commented 3 years ago

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.

andrewj267 commented 3 years ago

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 commented 3 years ago

Looks like the problem is being delt with -

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

gogetta69 commented 3 years ago

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.

andrewj267 commented 3 years ago

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.

GMaiolo commented 3 years ago

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

luiztools commented 1 year ago

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!