https://polygonscan.com/tokens
So from the first two pages;
SAND, LEO, AMP, MKR, BAT, HOT, HT, COMP, BNT, GNO, eWTB, FET, OGN, POWR, ETH2xFLI, GTC, KNC, ATA, AIOZ, FOX, FORTH, and RARI all return usdPrice values that are off +/- 20%-1,000,000%
EDIT - tried using the nativePrice.value value, and those numbers are also way off on the same tokens.
Iām going to experiment with getting the MATIC price from the MATIC price feed contract (0xAB594600376Ec9fD91F8e885dADF0CE036862dE0), and then using that and the nativePrice.value value that the getTokenPrice method returns to determine prices, but something with getTokenPrice() and the usdPrice it returns, is way off, on a lot of coins on the Polygon network.
As an example, getTokenPrice() says RARI is $400,000+
The code for my bot can be found here
Right now itās just set up to track price changes, as I need to get accurate price info, also, this is my first JS project, so excuse and shit coding.