Skip to main content

IERC7726Oracle

Git Source

Inherits: IPriceOracle

Title: IERC7726Oracle

ERC7726 oracle interface extending Euler's common IPriceOracle.

Functions

maxAge

Get the maximum allowed age for cached prices.

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

Returns

NameTypeDescription
maxAge_uint48The configured maximum cache age in seconds.

isStale

Returns whether the direct pair cache is stale for a given pair.

function isStale(address base, address quote) external view returns (bool isStale_);

Parameters

NameTypeDescription
baseaddressThe address of the base token
quoteaddressThe address of the quote token

Returns

NameTypeDescription
isStale_boolReturns true if the pair cache is unset or older than maxAge.

timestamp

Returns the cached timestamp used for a given base/quote pair.

function timestamp(address base, address quote) external view returns (uint48 timestamp_);

Parameters

NameTypeDescription
baseaddressThe address of the base token
quoteaddressThe address of the quote token

Returns

NameTypeDescription
timestamp_uint48The cached UNIX timestamp (uint48) for this base/quote pair used to judge staleness.

Errors

ERC7726Oracle_NotEnabled

Thrown when the oracle is not enabled in the factory

error ERC7726Oracle_NotEnabled();

ERC7726Oracle_Stale

Thrown when the direct pair cache is unset or stale

error ERC7726Oracle_Stale(uint256 cachedTimestamp, uint256 latestPermissibleTimestamp);

Parameters

NameTypeDescription
cachedTimestampuint256The cached timestamp used for the requested base/quote pair
latestPermissibleTimestampuint256The oldest permissible timestamp (block.timestamp - maxAge()), floored to 0 when block.timestamp <= maxAge(). A zero value is valid and means there is no lower timestamp bound yet.