Skip to main content

Oracles on Morpho

How it works, how to read it

Updated over a month ago

Oracles are smart contracts that provide external data, particularly price information, to blockchain applications.

Oracles on Morpho

In lending protocols like Morpho, oracles provide price data needed to determine what one token is worth relative to another. For example, the oracle of a cbBTC/USDC market is supposedly answering the question: "How many USDC is 1 cbBTC worth right now?”

On Morpho, markets are isolated and represent a pair of assets "collateral asset / loan asset". Borrowers deposit the collateral asset in order to borrow the loan asset.

The oracle price is used to calculate your position's current LTV (Loan-To-Value ratio). This is compared against the market's LLTV (Liquidation Loan-To-Value threshold) to determine if you can be liquidated.

Morpho is oracle agnostic, meaning at market creation, the creator can choose any address returning a price as oracle.

Why oracle choice matters for your position

  • Your liquidation risk depends entirely on the oracle's price (and interest accrual)

  • Oracle assumptions (like 1:1 pegs) create additional risks

  • Understanding your oracle = better understanding the risk

Oracles on the Morpho app

On the Morpho app, you can find basic informations around markets oracles in each market page.

Like with the cbBTC/USDC market on Base:

  • The main 'Overview' tab will show the oracle price info

  • The 'Advanced' tab provides more detailed oracle's attributes:

    • Oracle address -> redirecting you to the explorer oracle page

    • Oracle price -> price returned by the oracle

    • Reference price -> market price fetched from external sources (DefiLlama).

    • Value secured -> collateral and liquidity secured by the oracle

    • Trusted by-> curators listing a market using te oracle

For more detailed info about the oracle, you will need to look at contract level. The next section will provide a short explainer on how to explore oracles data.

How to identify oracle nature (advanced)

An oracle can be composed of one or several price feeds combined to provide a resulting price.

To understand "where the price comes from?", one needs to identify which feeds the oracle uses.

To do so, one has to check the oracle contract on the chain explorer. You can reach it via the redirection available in the market's 'Advanced' page.

e.g. with the cbBTC/USDC market on Base.


​1. Get to the oracle contract on the explorer

https://basescan.org/address/0x663BECd10daE6C4A3Dcd89F1d76c1174199639B9

Access the Contract tab and the Read Contract (or Read as Proxy) sub-tab. There, click on Expand all.

2. Check the price

At the bottom of this page, you can see the price reported by the oracle.

Note on Reading Prices on Explorers

When you check the oracle's price() function, you'll see very large numbers that may look wrong. This is normal blockchain precision.

The exact number of decimals depends on your token pair:

Precision = 36 + (loan token decimals) - (collateral token decimals)

Examples:

- BTC (8 decimals) / USDC (6 decimals) = 34 decimals of precision

- ETH (18 decimals) / USDC (6 decimals) = 24 decimals of precision

- USDC (6 decimals) / USDC (6 decimals) = 36 decimals of precision

In our cbBTC/USDC example:
Precision = 36 + 6 (USDC decimals) - 8 (cbBTC decimals) = 34

Applied to the price retrieved at a point in time:
price: 839677126298000000000000000000000000000
price with precision: 83967.7126298000000000000000000000000000
1 cbBTC = 83967.7126298 USDC


​​3. Identify the feeds

Goal is to identify the feed used in this oracle. A feed is any non 0 address in the feeds fields BASE_FEED_1, BASE_FEED_2, BASE_VAULT, QUOTE_FEED_1, QUOTE_FEED_2 and QUOTE_VAULT.
More advanced info on this oracle parameters in the documentation here.

Understanding Feed Fields

BASE = In general, it is linked to your collateral asset (e.g., cbBTC)

QUOTE = In general, it is linked to the loan asset (e.g., USDC)

• The oracle calculates: Collateral Price / Loan Asset Price

In this example, there is only one feed visible in the BASE_FEED_1: 0x64c911996D3c6aC71f9b455B1E8E7266BcbD848F

This means that this oracle uses only one feed as source to price the market.


​4. Identify the feed nature

Now that the feed or feeds are identify with there address, one will have to check each feed address to understand its nature and source.

Click on the feed to get to the address: https://basescan.org/address/0x64c911996D3c6aC71f9b455B1E8E7266BcbD848F

Then you'll have to identify which type of feed it is.

Feed providers:

Chainlink feeds description often refers to the assets priced:

Other feeds providers can be Chronicles, Pyth, Api3, etc.

Once you've identified the feed provider and the asset(s) priced, you can get to its interface and look out for the feed dedicated page.

For the cbBTC/USDC market on Base, you can find the related feed on the Chainlink app here: https://data.chain.link/feeds/base/base/btc-usd
And compare that the contract address matches the feed one:

Congratulations! You just identified that the cbBTC/USDC market solely uses a BTC/USD Chainlink feed.

CRITICAL ASSUMPTIONS IN THIS ORACLE

This oracle makes two 1:1 assumptions:

• cbBTC = BTC (uses BTC/USD feed for cbBTC)

• USDC = USD (no USDC feed = hardcoded to $1)

Always check what 1:1 assumptions your market's oracle makes.

Understanding Price Path - cbBTC/USDC example

Here are a few additional insights when looking at other Morpho markets' oracles:

  • You'll see oracles named MorphoChainlinkOracleV2, it does not mean they have been deployed by Morpho. It means the oracle has been deployed using the MorphoChainlinkOracleV2Factory, a tool/framework allowing anyone to easily deploy custom oracles.
    More on this framework and how to deploy oracles here.

  • Hardcoded pricesIn MorphoChainlinkOracleV2 oracles, when you see 0x0000...0000 in a feed field:

    • That conversion step is SKIPPED in the price calculation.

    • The price for that step is HARDCODED to 1:1

    • cbBTC/USDC example: No QUOTE_FEED_1 means "USDC = USD" at exactly 1:1

    • ⚠️ Risk: If the real market price moves away from 1:1, the oracle won’t notice because it assumes the peg is perfect.

  • Despite currently being the majority of Morpho markets' oracles, the oracle used in Morpho Markets V1 are not necessarily using the MorphoChainlinkOracleV2 framework. Any address returning a price can be used as oracle.

Understand the different types of feeds

Besides feed providers, there can be other types of feeds. Here is a non-exhaustive list of price feed types.

Feed providers

NAV (Net Asset Value)

The NAV represents intrinsic worth based on underlying holdings, not market trades. The NAV reflects the claimable value per unit of the underlying collateral and is derived from onchain accounting (ERC4626 convertToAssets value), or third-party reports.

e.g. ERC4626 are used in BASE_VAULT and QUOTE_VAULT fields.

DEX pools

A feed can point to a DEX pool (Uniswap, Aerodrome, Curve, etc.) taking into account this pools' market price.

Customs feeds

The MorphoChainlinkOracleV2 framework can use any feed returning a price, not only the ones mentioned above.


​Additional resources

You can read the more about oracles in the related documentation section here.

Did this answer your question?