/erc20/{address}/price BNB not correct

Hello request url:
https://deep-index.moralis.io/api/v2/erc20/0xB8c77482e45F1F44dE1745F52C74426C631bDD52/price?chain=eth

Response: 
{
  "nativePrice": {
    "value": "340222764559932100840721712881658375229228584688232758793",
    "decimals": 18,
    "name": "Ether",
    "symbol": "ETH"
  },
  "usdPrice": 1.0334386588427357e+42,
  "exchangeAddress": "0x1f98431c8ad98523631ae4a59f267346ea31f984",
  "exchangeName": "Uniswap v3"
}

But usd price BNB not 1.03$, in Etherscan price 420.74$ (https://etherscan.io/token/0xB8c77482e45F1F44dE1745F52C74426C631bDD52)

maybe that is the right price from that specific liquidity pool in case that it doesn’t have enough liquidity, it is not really $1.03, it is a huge price there because it has at the end e+42

1 Like

Sorry, I did not fully understand what I have to do to get the correct price in dollars? If I translate the exponent to 10 334 386 588 427 357… Anyway, it does not look like the desired ~420.74$.

you could get the price of BNB on bsc easily, the price that you get from a liquidity pool depends on how much liquidity has that pool, sometimes it can be a price that seems wrong, but that could be the price from that liquidity pool

this will get you the price that you want:

Moralis.Web3API.token.getTokenPrice({address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", chain: "bsc"})
2 Likes

OK, thank you! And what do you mean when you say “Liquidity Pool” What does this mean?

a liquidity pool is a pool with two tokens, and some users can add those tokens to liquidity to get a percentage from transactions, and other users can buy tokens from that liquidity pool paying with the other token

2 Likes

Just to add on, basically what he means is that if i am the only seller on uniswap, that is selling bnb, and I put my ask at 5000$ for a bnb. Then for that spefiec “exhcange” the price of the coin is 5000$. This is because there is only one seller that is me who will only sell there bnb for 5k, thus the price of bnb on this exchange is 5k. That’s why its smart to aviod small liquidty pools because sometimes there can be a big difference between display price and actual price.

1 Like

Hey @dean100143, the price fetched from Liquidity Pools such as Uniswap and CEX are different, you can watch here how does pricing in Uniswap works in our video https://youtu.be/bxV0OKPz-G4