pancakeswap / pancake-info-api

Serverless API implementation for PancakeSwap on-chain data query.
327 stars 271 forks source link

/api/v2/tokens/0x... does not consider the decimal places of some tokens (sometimes) #94

Open cristianlivella opened 2 years ago

cristianlivella commented 2 years ago

When making a request to /api/v2/tokens/0x... with unpopular tokens, sometimes the name and symbol returned are unknown, and in this case it would appear that the prices don't take into account the decimal places of the token, and therefore they need to be multiplied by 10^N, where N are the decimal places of the token, to get the correct prices.

Is it correct to assume that if the name and symbol are equal to unknown, the prices does not take into account the decimal places set in the contract, but if the name or symbol is different from unknown, it does?

I have not found this situation described in the documentation.