Deploying an oracle

In order to deploy an oracle first select the chain and the correct option in the main menu as well as the market you want to create the oracle for:

initial chain and market choice for oracle deployment

Chainlink price feeds addresses can be found here.

To deploy a chainlink adapter, choose chainlink v2, in our example we will be deploying an oracle for WETH/USDC using 1 base feed (ETH/USD) and 1 quote feed (USDC/USD). Note that custom ERC4626 vaults can be added on both end.

confirm deployment of the oracle

Note here that decimals are set by default thanks to market informations. Make sure to double check the proposed decimals and report any error.

The oracle wil check for any existing deployment with these parameters and will return the oracle address (deploys it if needed)

oracle deployment result

Dia Adapter

The oracle address and key must point to a DiaOracleInstance

To deploy a Dia instance, find the oracle and keys needed. Keys are limited in size for efficiency. If more storage is needed, please reach out. Select Dia, the pool and keys. ERC4626 vaults can also be added on both ends.

Before selecting a key at the contract level, I'd recommend testing the key first to check its correctness. you will then have to infer the number of decimals used for pricing. Here the price was 1951 USD os we can assume 8 decimals for pricing.

checking key correctness for dia
deploying a dia oracle adapter

Combine oracles

Now let's say we need to combine different oracles together. It is possible as well. Above we deployed an oracle for WETH/USDC, and another one for superOETHb/WETH. We can combine them in order to create a single oracle:

combining oracles

Last updated