Morpho Deep Dive

Vesper Finance
Vesper Finance
Published in
5 min readSep 7, 2023

Morpho provides an optimized experience, built on top of lending pools to offer better rates

Overview

What is Morpho?

Before we get into what Morpho is, let’s quickly talk about the problem they are trying to solve. In lending markets such as Aave and Compound, there is very often a large spread between the interests paid by borrowers and how much suppliers earn. This happens because there are typically more people willing to lend than borrow, leading to poor capital efficiency. In these traditional pools, everyone shares the interest, diluting individual gains. Morpho changes the game by pairing lenders directly with borrowers, where liquidity is automatically matched peer-to-peer as users come and go from a market. As a result, capital utilization is increased for both lenders and borrowers leading to higher yields and lower borrowing costs, making your investment work harder for you.

Rate Spreads taken from Compound — Source: Morpho Docs

Now, let’s talk about what Morpho actually is. Essentially, Morpho acts as a lending pool optimizer, working on top of established lending protocols like Aave and Compound. It enhances rates for both lenders and borrowers while simultaneously maintaining the same levels of liquidity and risk parameters as the underlying protocol.

Using Morpho-Aave (or Morpho-Compound), you can tap into the same pool of funds while enjoying optimized returns. Known as P2P APY, this feature is an improved rate that sits in between the Supply APY and Borrow APY seen on the underlying pool. Even in the worst case, you receive the same underlying APY from the lending pool. You can think of Morpho as an upgrade to existing Aave and Compound pools, improving their performance and capital efficiency.

Example showing how capital efficient Morpho is — Source: Morpho Docs

How does it work?

As mentioned before, Morpho takes a peer-to-peer approach, which in turn enables both lenders and borrowers to profit (within the rate limits of the underlying pool). Let’s break down the process:

If you’re the first to lend in Morpho with no borrower match, you’ll earn the pool rate, just like you would in the underlying pool — no loss there. But the magic happens when a borrower gets matched with you. Morpho will take your liquidity from the underlying pool, matching you with a borrower, where you both experience the P2P rate. If either party leaves, the lender/borrower still on Morpho is reconnected with the lending pool.

The matching process works similarly to an on-chain order book. Users are added to a queue as they lend or borrow on Morpho. When they are next in line, and new liquidity enters the market, they are matched.

Matching Engine Process — Source: Morpho Docs

If you’re wondering about rewards like $COMP from the underlying protocols, no worries — Morpho has got that covered. They automatically accumulate these rewards for you, so if you want to claim your share, the process is the same as it would be in the underlying protocol. Simple as that.

Core Concepts

Proxy Scheme

Morpho serves as an intermediary between you and the main lending pool. It takes care of depositing your assets into the lending pool and holds the resulting interest-bearing token (ibToken) for you. This token represents your share in the pool as well as any rewards you’ve earned. Let’s use an example to better explain this scenario:

  1. User A (borrower) comes to Morpho
  2. Next, the stacked ibToken of the supplier (user B) will be used to pull liquidity out of the pool and transfer it to the borrower
  3. Users are then matched peer-to-peer
  4. Both supplier and borrower benefit from higher APYs
Supplier process — Source: Morpho Medium
Borrower Process — Source: Morpho Medium

Ensuring Liquidity

To ensure user funds are always liquid, meaning you can enter and exit a position at any time, Morpho utilizes a fallback mechanism. It enables Morpho to use liquidity from underlying pools whenever a user cannot be matched peer-to-peer. Let us look at a couple of scenarios to explain how it works:

Scenario 1: You supply $1000 USDC, paired with users borrowing USDC. There is no need to fall back on the underlying pool; you both enjoy an improved rate.

Scenario 2: You supply $1000 USDC, but there is no borrower. Morpho cannot match you peer-to-peer, so it connects you with the underlying pool. You earn the Supply APY from the underlying pool.

Scenario 3: You supply $1000 USDC, but there is only $500 USDC of borrow demand. Morpho matches half of your supply P2P while the rest of the supply falls back on the underlying pool. You earn a blend of the Pool APY and P2P APY.

Scenario 4: You supplied $1000 USDC and were matched peer-to-peer, but the borrower decided to leave Morpho. The mechanism allows the borrower to freely exit the market while your supply position is moved back onto the pool, and you stop earning the P2P APY and start earning the Pool APY.

Advanced Concepts

Delta Mechanism

Morpho utilizes the Delta Mechanism to maintain the efficiency and integrity of its peer-to-peer matching. In some scenarios, like major withdrawals, Morpho could hit its maxGasForMatching parameter limit, where borrowers might appear as matched even if they’re not (due to the matching engine not being able to finish updating). The Delta Mechanism steps in to correct this, ensuring that everything aligns accurately with the actual state of funds to maintain the platform’s solvency. Simply put, it’s Morpho’s safeguard against discrepancies caused by gas limits.

Want to learn more about how it all works? Take a look at their documentation for a more in-depth overview.

Summary

Morpho serves as an optimization layer on top of existing lending protocols like Aave and Compound which provide a better way to supply and borrow. By using a peer-to-peer approach to dynamically match lenders and borrowers, Morpho is able to provide better rates while maintaining the same liquidity and risk parameters.

--

--