My USD stablecoin contract needs to know the fed funds rate in order to determine what its interest rate should be. Is there an oracle data feed available for the fed funds rate anywhere?
2 Answers
Tellor can do it pretty quickly for you. Probably an easy manual one for them too since it updates so infrequently. Here's some instructions ona custom data query: https://tellor.io/blog/how-to-query-custom-data-with-tellor/.
You'll just need to provide them with a few sources (might not even be necessary in this case since its so readily available) and then know how often you'll need it / what chain.
To get funds rate, or any other type of off-chain data generally, you can use build & use Chainlink Any API request.
For example, we can pull the fed funds rate from https://fred.stlouisfed.org/docs/api/fred/ or https://fiscaldata.treasury.gov/api-documentation/, just to name a few.
Then you just need to create a simple consumer contract, as described at the Chainlink Official Documentation and adjust the API endpoint based on your preferences, and the oracle address and jobId depending on the chain and node you use (you can grab these from docs).
This would be an example of pulling from a single API, through a single node. To make this decentralized, you'd have to pull many APIs through different nodes. So the example above shows the building block of how to do it.