Skip to content

Deploy an Oracle

This tutorial explains how to deploy and configure an oracle for a future market, for your vault. As a reminder, any oracle respecting the spec defined on the Morpho contract is usable. However deploying contracts is not an easy job. To faciliate oracle deployment a new standard for Morpho Markets has arised: the MorphoChainlinkOracleV2 contract. Created to faciliate the oracle deployment and configuration validation, this contracts comes with a factory.

Deploying an Oracle via Etherscan

Jump on the oracle factory contract

See the address section.

E.g: Ethereum mainnet address is 0x3A7bB36Ee3f3eE32A60e9f2b33c1e5f2E83ad766

Fill all attributes

On the createMorphoChainlinkOracleV2 function :

  • baseVault: The ERC4626 token vault for the base asset.

  • baseVaultConversionSample: A sample amount for converting base vault units.

  • baseFeed1, baseFeed2: Chainlink-interface-compliant data feeds for the base asset.

  • baseTokenDecimals: Decimal precision of the base asset. See the note below for more information.

  • quoteVault: The ERC4626 token vault for the quote asset.

  • quoteVaultConversionSample: A sample amount for converting quote vault units.

  • quoteFeed1, quoteFeed2: Chainlink-interface-compliant data feeds for the quote asset.

  • quoteTokenDecimals: Decimal precision of the quote asset. See the note below for more information.

  • salt: A unique identifier to create deterministic addresses for deployed oracles.


1. WETH/USDT oracle

- `baseVault`: "0x0000000000000000000000000000000000000000",
- `baseVaultConversionSample`: 1,
- `baseFeed1`: "0x0000000000000000000000000000000000000000",
- `baseFeed2`: "0x0000000000000000000000000000000000000000",
- `baseTokenDecimals`: 18,
- `quoteVault`:"0x0000000000000000000000000000000000000000",
- `quoteVaultConversionSample`: 1,
- `quoteFeed1`: "0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46",
- `quoteFeed2`: "0x0000000000000000000000000000000000000000",
- `quoteTokenDecimals`: 6,
- `salt`: "0x",

2. sDAI/USDC oracle

- `baseVault`: "0x83F20F44975D03b1b09e64809B757c47f942BEeA",
- `baseVaultConversionSample`: 1000000000000000000, // 1e18
- `baseFeed1`: "0xAed0c38402a5d19df6E4c03F4E2DceD6e29c1ee9",
- `baseFeed2`: "0x0000000000000000000000000000000000000000",
- `baseTokenDecimals`: 18,
- `quoteVault`: "0x0000000000000000000000000000000000000000",
- `quoteVaultConversionSample`: 1,
- `quoteFeed1`: "0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6",
- `quoteFeed2`: "0x0000000000000000000000000000000000000000",
- `quoteTokenDecimals`: 6,
- `salt`: "0x",

3. wstETH/ETH oracle

- `baseVault`: "0x0000000000000000000000000000000000000000",
- `baseVaultConversionSample`: 1,
- `baseFeed1`: "0x905b7dAbCD3Ce6B792D874e303D336424Cdb1421",
- `baseFeed2`: "0x86392dC19c0b719886221c78AB11eb8Cf5c52812",
- `baseTokenDecimals`: 18,
- `quoteVault`: "0x0000000000000000000000000000000000000000",
- `quoteVaultConversionSample`: 1,
- `quoteFeed1`: "0x0000000000000000000000000000000000000000",
- `quoteFeed2`: "0x0000000000000000000000000000000000000000",
- `quoteTokenDecimals`: 18,
- `salt`: "0x",

Sign the transaction

You are done.

Validating an Oracle configuration

The Oracle Decoder tool will run different checks to validate the config.

Jump on the following link

Assets Selection

Select the Collateral Asset and Loan Asset you intend to use this oracle with (and fill resp. price if the Morpho API or DeFiLlama doesn't price the asset yet)

Submit

Click on the Submit button