Actually, my mistake, it doesn’t return the MATIC price, however, it also certainly doesn’t return the correct price either.
https://deep-index.moralis.io/api/v2/erc20/0x8d546026012bf75073d8a586f24a5d5ff75b9716/price?chain=polygon
returns:
{
"nativePrice": {
"value": "121249082223834",
"decimals": 18,
"name": "Matic Token",
"symbol": "MATIC"
},
"usdPrice": 0.4082439345458858,
"exchangeAddress": "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",
"exchangeName": "Quickswap"
}
The USD Price should be $0.0307318 (at the time the above call was made)
If you add in the block shortly after the token was created, the price is ok. For example:
https://deep-index.moralis.io/api/v2/erc20/0x8d546026012bf75073d8a586f24a5d5ff75b9716/price?chain=polygon&to_block=25984313
I’ve been trying to work out which block it stopped at and found out the following:
25995000 = 0.007
25990000 = 0.008
26100000 = 0.007
26125000 = 0.007
26130000 = 0.007
26131000 = 0.007
26131050 = 0.007
26131100 = 0.009
26131125 = 0.009
26131140 = 0.009
26131142 = 0.009
26131145 = 922063.4525896723
26131150 = 922063.4525896723
26131250 = 922054.2370732409
26131500 = 922395.9412695073
26131600 = 922663.6972570239
26131610 = 922663.6972570239
26131615 = 922663.6972570239
26131618 = 922663.6972570239
26131619 = 0.35
26131620 = 0.35
26131625 = 0.35
26131650 = 0.35
26131750 = 0.35
26132000 = 0.35
26132500 = 0.35
26135000 = 0.35
26150000 = 0.35
26200000 = 0.35
As you can see, everything is fine until block 26131145 when the price goes haywire. From that point on, it’s never correct ever again (0.35 isn’t the right price, Sphere doesn’t usually go above 0.03 atm)