Back to Blog

How Morpho Blue Works: A Step-by-Step Guide with Oracle-Agnostic Design & Risk Management

Morpho Blue reimagines decentralized lending by prioritizing flexibility, security, and user-driven risk management. Below, I break down its core innovations, including oracle-agnostic pricing, externalized risk layers, and security practices, with a code example for deploying a new lending pool.

Posted by

How Morpho Blue Works: A Step-by-Step Guide with Oracle-Agnostic Design & Risk Management - TokenGrower.com

Introducing Morpho Blue

Morpho Blue is a trustless, decentralized and efficient lending primitive that reimagines the DeFi landscape with a focus on flexibility, security, and user-driven risk management. By leveraging oracle-agnostic pricing, externalized risk layers, and robust security practices, Morpho Blue offers a new standard for decentralized and permissionless lending market creation.

In this guide, I'll break down the core innovations behind Morpho Blue and provide a step-by-step tutorial for deploying a new lending pool on the platform. Let's dive in!

Core Innovations

Morpho Blue introduces Oracle-Agnostic Pricing. This innovative approach allows lending pools curators to use any price oracle they prefer (e.g. Chainlink, Pyth, Uniswap, TWAP, etc).

Market creators choose oracles that align with their risk tolerance (e.g., low-latency oracles for volatile assets). It gives market decentralization and avoids reliance on a single oracle provider, that reduces the risk of oracle manipulation risk.

Externalized Risk Management

Regular lending protocols like AAVE or Compound approve assets based on their risk assessment. Usually protocol governanace decides which assets are safe to be white-listed on a platform. It is quite different with Morpho Blue. Morpho Blue introduces a new concept of externalized risk layers, that allows market creators to define their own risk assessment and risk management strategies.
Permissionless Risk Management
  • User Sovereignty: Anyone creates markets with custom parameters (collateral, oracles, LLTV).
  • No Governance Bottlenecks: Risk assessment shifts from protocol admins to users or third-party curators.

Morpho Vaults: Delegated Risk Management

Vaults aggregate risk management strategies and allow users to delegate their risk management to a third-party (vault curators). Vaults can be used to create new lending pools with custom risk management strategies.

Example: A WETH vault allocates funds to multiple Morpho markets (e.g., WETH/DAI, WETH/USDC) based on curator-defined criteria.

Workflow will look like this:
  • Curators: Selects markets with acceptable collateral, LLTV, and oracles.
  • Lenders: Deposit into vaults, trusting curators to optimize risk/reward.
  • Borrowers: Access liquidity from vault-backed markets.

Step-by-step Guide: Deploying a New Lending Pool

Deploy a Custom Market on Ethereum network

Ethereum mainnet address is 0xbbbbbbbbbb9cc5e90e3b3af64bdaf62c37eeffcb
To create a new market, you need to go to a contract on Etherscan (for Ethereum mainnet) and call the following function: createMarket.

Create a new market on Morpho Blue
You need to provide the following parameters to create a new market:
  • loanToken: The token that will be lent (e.g., USDC).
  • collateralToken: The token that will be used as collateral (e.g., WETH).
  • oracle: The oracle that will provide the price feed (e.g., Chainlink ETH/USD or Uniswap TWAP).
  • irm: The interest rate model.
  • lltv: The Liquidation Loan-To-Value (e.g., 86% = 0.86e18).
Learn more about creating a new market on Morpho Blue.
struct MarketParams {
    address loanToken;        // e.g., USDC
    address collateralToken;  // e.g., WETH
    address oracle;           // e.g., Chainlink ETH/USD or Uniswap TWAP
    address irm;              // Interest Rate Model
    uint256 lltv;             // Liquidation Loan-To-Value (86% = 0.86e18)
}

Fill out the required attributes and call the Write function to deploy a new market on Morpho. Keep in mind, to submit a transaction, you need to have enough Ether in your wallet to cover the gas fees.

Retrieve Market Id

After creating a new market, you can retrieve the market ID going to the contract Event Logs on Etherscan and looking for the CreateMarket event logs that contains transaction hash you just submitted.

CreateMarket event

You can retrieve the market parameters by calling the idToMarketParams . For instance id: 0xb323495f7e4148be5643a4ea4a8221eef163e4bccfdedc2a6f4696baacbc86cc

Morpho Incentive

MORPHO tokens are rewarded to active market participants (lenders/borrowers). Vault curators also earn fees for optimizing capital allocation.

Conclusion

Morpho Blue’s oracle-agnostic design, delegated risk management via vaults, and unmatched security make it a paradigm shift in decentralized finance. Developers can deploy tailored markets in minutes, while users retain full control over risk exposure.

Code Repository:

Morpho Blue - Github

Further Reading: