Avalanche And Polygan native Prices

Hi.
I have a page where I call the native price of different tokens for BSC, and that is working great. But in the same page I also want to show the price of AVAX and MATIC, but with no success. Iā€™ll Appreciate any help I can get :slight_smile:


The code Iā€™m using for Polygon is:
const optionsMATIC = {
address: ā€œ0x0000000000000000000000000000000000001010ā€,
chain: ā€œmaticā€
};
var priceMATIC = await Moralis.Web3API.token.getTokenPrice(optionsMATIC);
console.log(priceMATIC);

And for this the result is:

  1. exchangeAddress: ā€œ0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32ā€

  2. exchangeName: ā€œQuickswapā€

  3. nativePrice:

  4. decimals: 18

  5. name: ā€œMatic Tokenā€

  6. symbol: ā€œMATICā€

  7. value: ā€œ0ā€


And for Avalanche I have this code:
const optionsAVAX = {
address: ā€œFvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Zā€,
chain: ā€œavalancheā€
};
var priceAVAX = await Moralis.Web3API.token.getTokenPrice(optionsAVAX);
console.log(priceAVAX);

where the result is:
Uncaught (in promise) {code: 141, error: ā€˜Invalid hex numberā€™}

What kind of address is this?

Is the address I get from coin market cap and also from coingecko

Captura de ecraĢƒ 2021-12-15, aĢ€s 15.07.17|675x241

We may not support that type of address

So what about Matic on Polyganā€¦ why usd price is zero?

And in avalanche without that type of address how to fetch usd price of AVAX?

you want the price of AVAX, or Matic? and not necessarily to get the price from those networks? In that case maybe you can query that price on ETH or BSC network for AVAX and Matic

I need both. Ok, thatā€™s a solution. But Iā€™m not sure that AVAX exists in BSC or ETHā€¦