IOracleRegistry

Inherits: IOracle

Interface for an Oracle Registry

Functions

addOracle

Adds an oracle for the provided base and quote assets

MUST REVERT if not called by the authorized address

MUST REVERT if the oracle is already set

function addOracle(address base, address quote, IOracle oracle) external;

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Oracle to add

scheduleOracleUpdate

Schedules an oracle update for the base/quote asset pair The update process is a two-step process: first, the new oracle data is set using this function; second, the update is committed using the commitOracleUpdate function

MUST REVERT if not called by the authorized address

MUST REVERT if the oracle data is already scheduled for an update

MUST REVERT if the oracle data is the same as the current oracle

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Oracle to schedule

commitOracleUpdate

Commits the oracle update for the base/quote asset pair Can be called by anyone after the update process is initiated using scheduleOracleUpdate and the update delay has passed

MUST REVERT if the update is not initiated

MUST REVERT if the update delay has not passed

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

cancelScheduledOracleUpdate

Cancels the scheduled update for the base/quote asset pair

MUST REVERT if not called by the authorized address

MUST REVERT if the update is not initiated

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

disableOracle

Disables the oracle for the base/quote asset pair

Performs a soft delete to forbid calling addOracle with the same base and quote assets and avoid front-running attack

MUST REVERT if not called by the authorized address

MUST REVERT if the oracle data is not set

MUST REVERT if the oracle data is already disabled

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Oracle that is to be disabled

acceptPendingOracle

Allows a user to accept the pending oracle for a given base/quote pair during the delay period Can be called by the user to use the new oracle early

MUST REVERT if the caller is not the user or its owner

MUST REVERT if the oracle is not set

MUST REVERT if current pending oracle doesn't match the oracle to be accepted

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

user

address

Vault that is accepting the pending oracle

oracle

IOracle

Oracle that is to be accepted

removeOracleOverride

Allows a user to remove the oracle override for a given base/quote pair

MUST REVERT if the caller is not the user or its owner

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

user

address

The vault address removing the override

getQuoteForUser

Returns the value of the base asset in terms of the quote asset with using the provided oracle data for the provided user (respects user-specific overrides)

Parameters

Name
Type
Description

baseAmount

uint256

Amount of base asset

base

address

Base asset address

quote

address

Quote asset address

user

address

Vault address

Returns

Name
Type
Description

<none>

uint256

value of the base asset in terms of the quote asset

getOracleData

Return oracle metadata for base/quote

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

Returns

Name
Type
Description

data

OracleData

Oracle data

Events

OracleSet

Emitted when an oracle is added

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Added oracle

OracleScheduled

Emitted when an oracle update is scheduled

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

pendingOracle

IOracle

Pending oracle

commitTimestamp

uint32

The timestamp when the oracle data can be commited

OracleUpdateCancelled

Emitted when an oracle update is cancelled

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

OracleDisabled

Emitted when an oracle is disabled

Parameters

Name
Type
Description

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Oracle that is disabled

PendingOracleAccepted

Emitted when a user accepts an oracle update early

Parameters

Name
Type
Description

user

address

Address of the user which accepted the oracle data

base

address

Base asset address

quote

address

Quote asset address

oracle

IOracle

Oracle which was accepted

OracleOverrideRemoved

Emitted when an oracle override is removed

Parameters

Name
Type
Description

user

address

Address of the user which removed the oracle override

base

address

Base asset address

quote

address

Quote asset address

Errors

AeraPeriphery__CallerIsNotAuthorized

AeraPeriphery__OracleMismatch

AeraPeriphery__CommitTimestampNotReached

AeraPeriphery__OracleUpdateDelayTooLong

AeraPeriphery__OracleConvertsOneBaseTokenToZeroQuoteTokens

AeraPeriphery__NoPendingOracleUpdate

AeraPeriphery__OracleIsDisabled

AeraPeriphery__CannotScheduleOracleUpdateForTheSameOracle

AeraPeriphery__OracleUpdateAlreadyScheduled

AeraPeriphery__ZeroAddressOracle

AeraPeriphery__OracleNotSet

AeraPeriphery__OracleAlreadySet

AeraPeriphery__OracleAlreadyDisabled

AeraPeriphery__ZeroAddressOwner

Last updated