Price Feed API Reference
When you use price feed, retrieve the feeds through the AggregatorV3Interface
and the proxy address.
AggregatorV3Interface
Import this interface to your contract and use it to run functions in the proxy contract. Create the interface object by pointing to the proxy address. For example, on Bitlayer you could create the interface object in the constructor of your contract using the following example:
Functions in AggregatorV3Interface
decimals
Get the number of decimals present in the response value.
RETURN
: The number of decimals.
description
Get the description of the underlying aggregator that the proxy points to.
RETURN
: The description of the underlying aggregator.
getRoundData
Get data about a specific round, using the roundId
.
Parameters:
_roundId
: The round Id
Return values:
roundId
: The round Idanswer
: The answer for this roundstartedAt
: Timestamp of when the round startedupdatedAt
: Timestamp of when the round was updatedansweredInRound
: The round Id of the round in which the answer was computed
version
The version representing the type of aggregator the proxy points to.
RETURN
: The version number.