Easily get historical data from Chainlink feeds
DegenFetcher is a Solidity smart contract that serves as a bridge between conventional timestamps (e.g. "Aug 6, 2020, 12:00am") and Chainlink round IDs. While Chainlink doesn't natively support fetching historical data by timestamp, DegenFetcher bridges this gap. It uses a binary search algorithm to repeatedly fetching timestamps for various round IDs from a Chainlink aggregator. When it's identified the correct rounds of Chainlink data, it culls the data to the desired density; e.g. one price point every 30 minutes.
DegenFetcher accepts the following parameters:
- Starting timestamp
- Duration (e.g. 1 day)
- Density (e.g. 48 data points per day)
- Address of any Chainlink feed; e.g. ETH/USD, DOGE/USD, EUR/USD
DegenFetcher was created for use in Degen Blues, a dynamic music NFT project based on Ethereum price data.
The source code for DegenFetcher.sol has been deployed to:
- Ethereum Mainnet:
- Rinkeby:
For each of the deployed contracts above, you can click on the Read Contract tab to test out the functions.
Have questions? Need support or inspiration? Just want to share something cool you're working on? The best place to connect with other artists doing data driven work is the #workshop channel of the Degen Blues discord server