AggregatorV3Interface
Title: AggregatorV3Interface
Chainlink price feed interface.
Standard interface for Chainlink oracles. See https://docs.chain.link/data-feeds.
Functions
decimals
Returns the number of decimals in the price.
function decimals() external view returns (uint8);
description
Returns a human-readable description of the feed.
function description() external view returns (string memory);
version
Returns the feed version number.
function version() external view returns (uint256);
getRoundData
Returns historical round data.
function getRoundData(
uint80 _roundId
)
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
Parameters
| Name | Type | Description |
|---|---|---|
_roundId | uint80 | The round ID to query. |
Returns
| Name | Type | Description |
|---|---|---|
roundId | uint80 | The round ID. |
answer | int256 | The price answer. |
startedAt | uint256 | Timestamp when round started. |
updatedAt | uint256 | Timestamp of last update. |
answeredInRound | uint80 | The round in which answer was computed. |
latestRoundData
Returns the latest round data.
function latestRoundData()
external
view
returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound);
Returns
| Name | Type | Description |
|---|---|---|
roundId | uint80 | The current round ID. |
answer | int256 | The latest price. |
startedAt | uint256 | Timestamp when round started. |
updatedAt | uint256 | Timestamp of last update. |
answeredInRound | uint80 | The round in which answer was computed. |