💡
How It Works
A high-level overview of how Morpho works.

What problem is Morpho solving?

On AAVE or Compound, you may have noticed a large spread between the interests paid by borrowers and those earned by suppliers.
Rate Spreads on compound.finance
This spread exists because current lending protocols are based on a liquidity pool. Many lenders supply liquidity to this pool, and very few borrowers are financing themselves with it.
In a liquidity pool, yields are socialized. It means that the numerous lenders will share the interests generated by the few borrowers. This mechanism induces the spread.
Using Morpho, rewards are not socialized anymore. Instead, the supplied liquidity is dynamically and seamlessly matched peer-to-peer with borrowers on a come-and-go-basis. Lenders' interests correspond to the interests paid by the borrower(s) they are paired with: matched lenders don't share interests.

How Morpho improves rates

Because lenders and borrowers are matched peer-to-peer, the protocol's lending and borrowing rates can be freely chosen by the protocol but need to stay within the spread of the underlying protocol's pool (betweenlendingAPY and borrowingAPY) to be profitable for both parties.
Let's take an illustrated example. Say Alice is the first lender to come to Morpho. As she is alone, she will not find a match, so Morpho will deposit her liquidity in the underlying pool.
Then, Bob, a borrower, comes in. Morpho will pull Alice out of the liquidity pool to match Bob. Both will experience the P2P APY, which is better for both parties.
When one of the two leaves, Morpho will have another fall back to the lending pool.
Animation of the P2P APY set in the middle of the spread (p2pIndexCursor = 0.5).
On this graph, one sees that Morpho enables improved rates for both parties while ensuring that a user can break the peer-to-peer match to fall back on the pool at any moment.
To ensure Morpho is an improvement for both suppliers and borrowers, the P2P APY is chosen by Morpho's DAO within the interval [lendingAPY; borrowingAPY]of the underlying protocol's pool. This is done through the p2pIndexCursor parameter set by governance, selected from within [0; 1], representing the position of the P2P APY within [lendingAPY; borrowingAPY].

How matching works

To match users, the Morpho protocol holds an on-chain priority queue, sorting users according to the amount they want to lend or borrow. When a new lender supplies liquidity to the protocol, their liquidity is matched with the largest borrower first. The second is down until the liquidity supplied is fully matched or there are no more borrowers to match.
Symmetrically, suppose a new borrower asks for liquidity to the protocol. In that case, their demand is matched with the most significant lender first, then the second, down until the borrowed liquidity is fully matched or there are no more lenders to match.
The data structure holding the priority queue on-chain is chosen based on research led by Morpho Labs on the most gas-efficient data structure for this task.
To be fully scalable, the Morpho DAO sets a maximum gas consumption for the matching process. This parameter is known as maxGasForMatching.
Advanced users can customize this parameter when supplying or borrowing liquidity. If the matching gas consumption exceeds maxGasForMatching, the remaining unmatched liquidity is deposited on the underlying protocol's pool.

How $COMP and $MORPHO rewards work

The Morpho protocol automatically accrues rewards distributed by the underlying protocol on behalf of its users. This means that all rewards from the underlying protocol accrued by a user of the Morpho protocol can be claimed just as if the user was using the underlying protocol directly.
The Morpho protocol also distributes its own $MORPHO rewards to its users. Learn more in the Ages & Epochs section.
Copy link
On this page
What problem is Morpho solving?
How Morpho improves rates
How matching works
How $COMP and $MORPHO rewards work