pawartur / AliteDefi

EthAmsterdam 2022 Hackaton Project
1 stars 2 forks source link

Investigate using Moralis to fetch token price data #7

Closed pawartur closed 2 years ago

pawartur commented 2 years ago

Moralis has the getTokenPrice api that returns prices of tokens denominated both in USD and tokens native to supported blockchains (and they support both Ethereum and Polygon as of now).

pawartur commented 2 years ago

The problem I was trying to solve here was that with the current solution for fetching historical token data at the time of writing this (the solution being fetching the data from Uniswap-v2 graph), we were not able to fetch data for native chain tokens (eth, matic) and thus the calculation of profit/loss was wrong.

As far as I can see at the time of writing this, Moralis API doesn't solve the problem, as it only seems to be able to fetch the same historic data from uniswap as I can get from graph.

Closing the issue.