pawartur / AliteDefi

EthAmsterdam 2022 Hackaton Project
1 stars 2 forks source link

Use coingecko API to fetch historical data for native chain tokens (eth, matic) #9

Closed pawartur closed 2 years ago

pawartur commented 2 years ago

The problem I'm trying to solve here is 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), I'm not able to fetch data for native chain tokens (eth, matic) and thus the calculation of profit/loss is wrong.

Use coingecko API's /coins/{id}/history endpoint to fetch historical price data for native tokens.