cgPriceQuery is an abstraction layer for calling the CoinGecko Price Query API. Since the densest data from CoinGecko is typically returned hourly, this package interpolates prices to each block time.
queryPricesInDuration: Get price data at each block time from timet_0tot_1queryPriceAtTime: Get price data at timetqueryPriceCurrent: Get the current price
Supported networks are currently:
- ethereum
- polygon
- arbitrum
- fantom
Additional networks are pretty trivial to add as long as they have a subgraph for block times and CoinGecko price feeds.
For a sample, see samples/sample.py