Skip to main content

Implementation

Morpho Chainlink Oracle V2 Github repository

The contract implements the Oracle interface to fit Morpho Blue specifications.

Immutables

  • BASE_VAULT: baseVault. Pass address zero to omit this parameter.
  • BASE_VAULT_CONVERSION_SAMPLE: Base vault conversion sample.
  • BASE_FEED_1: First base feed. Pass address zero if the price = 1.
  • BASE_FEED_2: Second base feed. Pass address zero if the price = 1.
  • BASE_TOKEN_DECIMALS: Base token decimals.
  • QUOTE_VAULT: Quote vault. Pass address zero to omit this parameter.
  • QUOTE_VAULT_CONVERSION_SAMPLE: The sample amount of quote vault shares used to convert to underlying. Pass 1 if the quote asset is not a vault. Should be chosen such that converting quoteVaultConversionSample to assets has enough precision.
  • QUOTE_FEED_1: First quote feed. Pass address zero if the price = 1.
  • QUOTE_FEED_2: Second quote feed. Pass address zero if the price = 1.
  • QUOTE_TOKEN_DECIMALS: Quote token decimals.

Assumptions

Here is the list of assumptions that guarantees the oracle behaves as expected:

  • The vaults, if set, are ERC4626-compliant.
  • The feeds, if set, are Chainlink-interface-compliant.
  • Decimals passed as argument are correct.
  • The base vaults's sample shares quoted as assets and the base feed prices don't overflow when multiplied.
  • The quote vault's sample shares quoted as assets and the quote feed prices don't overflow when multiplied.