Oracle Registry
What is the Oracle Registry?
The Oracle Registry is a global contract that provides standardized price oracle access for Aera's ecosystem while being ERC7726 compliant for external consumers. It serves two primary functions:
DEX hook integration: Controls slippage in trades by providing onchain price quotes for asset pairs. This ensures trades initiated by guardians execute within acceptable price ranges, protecting users from adverse price movements. For example when swapping ETH to USDC on Uniswap, it's important for a vault to specify a reasonable minimum output amount of USDC and not rely on the guardian to provide a value. In this case the specific hook supporting Uniswap will refer to the oracle registry for the correct price.
Multi-depositor vault exchange rate calculations: Facilitates exchange rate calculations between different deposit/withdraw assets in multi-depositor vaults. This enables vaults to accurately value different assets and maintain proper accounting of user deposits and withdrawals.
Why it Matters
The oracle registry brings several key benefits to the Aera ecosystem:
Shared infrastructure: Multiple vaults can reuse the same oracle registry, eliminating the need for each vault to maintain its own oracle setup. This is an improvement over the setup in Aera V2 where each vault had its own asset registry.
Simplicity:
The oracle registry standardizes interfaces by being ERC7726 compliant, making integration simpler
Using a quote-based interface reduces the need to embed oracle related safeguards into other parts of the codebase. For example, Chainlink oracles have built-in heartbeats and sequencer liveness checks that can all be executed in the oracle registry
Since ERC7726 contracts can serve multiple quote pairs, oracle registry reduces duplication in code paths without increasing efficiency since oracle data can be cached in code paths.
How to Use the Oracle Registry
Using the oracle registry in Aera
The primary Oracle Registry is managed by the Aera team, ensuring high-quality oracle data and regular maintenance.
Teams are still free to deploy and maintain their own oracle registries if they want to make different price feed choices. Vault owners can deploy hooks that use the global oracle registry, use a different oracle registry or even use different oracles per hook (although we would advise against this).
Maintaining an oracle registry and adding new oracles
Two types of oracles can be added: Chainlink-compatible price feeds and other ERC7726 compliant oracles. Repositories for ERC7726 such as awesome-oracles can be a good source of oracles for maintainers.
Note that while new oracles can be added liberally, oracles that already exist could be used by vaults and therefore are subject to a 21 day update delay. Each vault can accept an oracle early, however, and accelerate the update process.
Maintainers have access to the following operations:
addOracle
sets an oracle for a given asset pairscheduleOracleUpdate
start an oracle update for a pair which already has an oracle (this minimizes disruption and risk for consumers)commitOracleUpdate
can be called by anyone to commit a scheduled oracle updatecancelScheduledOracleUpdate
cancel an active oracle updatedisableOracle
stop posting a price feed for a given base / quote pairacceptPendingOracle
vault owners can use this function to accept oracle updates early
Caching
To make the development of composite oracles more efficient, the oracle registry has a hinting system for oracle data. For example, to build a product oracle that computes the price of X/Y * Y/Z, you would first load the oracleData for X/Y and Y/Z feeds in the constructor and then use getQuoteUnsafe
by passing the relevant oracleData. In the event the underlying feeds are upgraded, a new product oracle for the composite feed would need to be deployed.
Caveats
Note that the oracle registry uses the ERC7726 standard in two ways:
The oracle registry itself is an ERC7726 compatible contract and can be used onchain by other consumers to price tokens
Other ERC7726 compatible tokens can be used by the oracle registry to define prices for common tokens.
Last updated