API Version: v0.2.1 Not using latest version (v0.2.3)

AggregatorV3Interface v0.2.1 API Reference

AggregatorV3Interface

AggregatorV3Interface defines the extended interface for Chainlink Data Feed aggregators, providing comprehensive round data and metadata about the feed.

Functions

decimals

function decimals() external view returns (uint8)

Retrieves the number of decimals used to format the answer.

Returns:

TypeDescription
uint8The number of decimals in the response

description

function description() external view returns (string memory)

Retrieves the description of the price feed.

Returns:

TypeDescription
stringThe description of the price feed

getRoundData

function getRoundData(uint80 _roundId) external view returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
)

Retrieves the complete round data for a specific round ID.

Parameters:

ParameterTypeDescription
_roundIduint80The round ID to query

Returns:

ParameterTypeDescription
roundIduint80The round ID from the aggregator for this round
answerint256The price answer for this round
startedAtuint256Timestamp when the round started
updatedAtuint256Timestamp when the round was updated
answeredInRounduint80The round ID in which the answer was computed

latestRoundData

function latestRoundData() external view returns (
    uint80 roundId,
    int256 answer,
    uint256 startedAt,
    uint256 updatedAt,
    uint80 answeredInRound
)

Retrieves the latest round data from the aggregator.

Returns:

ParameterTypeDescription
roundIduint80The round ID from the aggregator for this round
answerint256The latest price answer
startedAtuint256Timestamp when the round started
updatedAtuint256Timestamp when the round was updated
answeredInRounduint80The round ID in which the answer was computed

version

function version() external view returns (uint256)

Retrieves the version number of the aggregator implementation.

Returns:

TypeDescription
uint256The version number of the aggregator

Get the latest Chainlink content straight to your inbox.