Skip to main content

IChainlinkOracle

Git Source

Inherits: AggregatorV2V3Interface

Title: IChainlinkOracle

Author: OlympusDAO

Interface for a Chainlink-compatible oracle

Functions

baseToken

The base token address

function baseToken() external view returns (address baseToken_);

Returns

NameTypeDescription
baseToken_addressThe base token address

quoteToken

The quote token address

function quoteToken() external view returns (address quoteToken_);

Returns

NameTypeDescription
quoteToken_addressThe quote token address

maxAge

The maximum allowed age for cached prices

function maxAge() external view returns (uint48 maxAge_);

Returns

NameTypeDescription
maxAge_uint48The configured maximum cache age in seconds

name

The name of the oracle

function name() external view returns (string memory name_);

Returns

NameTypeDescription
name_stringThe name

isStale

Returns whether the cached pair round should be considered stale.

function isStale() external view returns (bool isStale_);

Returns

NameTypeDescription
isStale_booltrue if the direct pair cache is unset or older than maxAge()

Errors

ChainlinkOracle_NotEnabled

Thrown when the oracle is not enabled

error ChainlinkOracle_NotEnabled();

ChainlinkOracle_NoDataPresent

Thrown when requested round data is not available

error ChainlinkOracle_NoDataPresent();

ChainlinkOracle_Stale

Thrown when the direct pair cache is older than maxAge

error ChainlinkOracle_Stale(uint256 cachedTimestamp, uint256 latestPermissibleTimestamp);

Parameters

NameTypeDescription
cachedTimestampuint256The cached timestamp used for the base/quote pair
latestPermissibleTimestampuint256The oldest permissible timestamp (block.timestamp - maxAge())