Data Feed Consumer
Last updated
Last updated
This page guides you through an example of consuming a data feed from your consumer contract.
The example consumer contract is at .
As you can see in the consumer contract, we must create a variable to store the address of the data feed contract and use AggregatorV2V3Interface
to consume a token price.
If you want to get the answer of the latest round, you can use aggregator.latestRoundData()
.
Five values will be returned after your contract is allowed to consume the data feed. The price is the second value of the returned values. In this case, the answer is the price of BTC in USD.