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

AggregatorInterface v0.2.1 API Reference

AggregatorInterface

AggregatorInterface defines the standard interface for Chainlink Data Feed aggregators. This interface provides methods to access price feed data and timestamps, as well as historical values.

Events

AnswerUpdated

event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 updatedAt)

Emitted when a new answer is available for a price feed.

ParameterTypeDescription
currentint256The new price value (indexed)
roundIduint256The round ID for this update (indexed)
updatedAtuint256Timestamp when this answer was updated

NewRound

event NewRound(uint256 indexed roundId, address indexed startedBy, uint256 startedAt)

Emitted when a new round of price updates begins.

ParameterTypeDescription
roundIduint256The round ID that started (indexed)
startedByaddressAddress that initiated the round (indexed)
startedAtuint256Timestamp when the round started

Functions

getAnswer

function getAnswer(uint256 roundId) external view returns (int256)

Retrieves the answer for a specific round.

Parameters:

ParameterTypeDescription
roundIduint256The round ID to query

Returns:

TypeDescription
int256The price answer for the specified round

getTimestamp

function getTimestamp(uint256 roundId) external view returns (uint256)

Retrieves the timestamp for a specific round.

Parameters:

ParameterTypeDescription
roundIduint256The round ID to query

Returns:

TypeDescription
uint256The timestamp when the round was updated

latestAnswer

function latestAnswer() external view returns (int256)

Retrieves the most recent answer.

Returns:

TypeDescription
int256The latest price feed answer

latestRound

function latestRound() external view returns (uint256)

Retrieves the most recent round ID.

Returns:

TypeDescription
uint256The latest round ID

latestTimestamp

function latestTimestamp() external view returns (uint256)

Retrieves the timestamp of the latest answer.

Returns:

TypeDescription
uint256The timestamp when the latest answer was updated

Get the latest Chainlink content straight to your inbox.