Morpho Optimizer: Optimizing Decentralized Liquidity Protocols Paul Frambot Mathis Gontier Delaunay
Morpho Optimizer: Optimizing Decentralized Liquidity Protocols Paul Frambot Mathis Gontier Delaunay
Morpho Optimizer: Optimizing Decentralized Liquidity Protocols Paul Frambot Mathis Gontier Delaunay
April 2022
Abstract
Morpho enhances current DeFi liquidity protocols. The aim is to offer a suite
of products to make supplying and borrowing operations in DeFi more efficient
and seamless. The first building block proposed is a novel, Pareto-improving,
interest rate mechanism built on top of existing protocols. The Morpho Protocol
allows for better rates on both sides of the market whilst preserving the same
liquidity and liquidation guarantees for everyone.
Contents
1 Motivation 2
1
3 Product Position: a liquidity protocol optimizer 13
3.1 Use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.1 Strategists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.2 Aggregators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.3 Stablecoins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.1.4 Individuals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 An additional layer of smart contracts . . . . . . . . . . . . . . . . . . 15
4 Conclusions 15
5 Acknowledgement 15
6 Legal disclaimer 15
6.1 Information purposes only . . . . . . . . . . . . . . . . . . . . . . . . . 15
6.2 No contractual relationship . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.3 Third-party information . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.4 No offer of securities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6.5 Risk associated with the purchase of Morpho Tokens . . . . . . . . . . 17
1 Motivation
Over the past ten years, blockchain technologies have not only enabled innovation in
the space of money transfers but have, most importantly, provided the means to re-
imagine the entire financial ecosystem. Today, blockchains like Ethereum, the largest
DeFi platform, enable developers from anywhere in the world to create open services
that previously were the exclusive playground of financial intermediaries such as banks,
exchanges, insurances, asset managers, hedge funds, etc. Decentralized Finance or
DeFi, encompasses an ensemble of independent, open, transparent, and composable
technological bricks as pieces of self-executable code, providing open access to a new
set of financial primitives available to all. Removing intermediaries not only reduces
bias but also lowers the cost of the global financial infrastructure, eventually decreasing
the overall costs to end-users. Morpho’s mission is the democratization of interest rate
services, ensuring access to profitable, convenient, and secure supplying and borrowing
for all.
Since the “DeFi Summer” in 2020, novel protocols have emerged enabling users to
execute financial operations in a decentralized fashion such as the secured supplying
and borrowing of crypto-assets with Compound [LH19] or Aave [Tea20]. The growth in
the market size of these protocols has been astonishing and has far exceeded the tens of
billions1 . However, looking at the historical data of supply versus borrow rates of the
main DeFi protocols, there is a pain point for both sides of the market: borrow rates
are high compared to very low supply rates.
2
Figure 1: APY spread in app.compound.finance
For Ether, an average supply APY (βs ) of 0.1% and an average borrow APY (βb )
of 2.7% are observed2 .
Example 1.1 Assume that Alice supplies 1000 DAI and Bob borrows 1000 DAI on
Compound. After a year, Alice only earned 1 DAI while Bob paid 27 DAI. Both parties
may also get some COMP rewards tokens, but we will omit these for now.
This example is quite counter-intuitive at first as one can expect DeFi to remove the
middle man and to create Peer-to-Peer (P2P) positions where Alice earns exactly what
2
This is an average over 500k Ethereum blocks, which represents approximately 90 days
3
Bob is paying. So why are these APYs not unique and set at a mid-rate of 1.4%, which
would be advantageous to both parties?
Example 1.2 In such a scenario where Alice would supply 1000 DAI and Bob would
borrow 1000 DAI on Compound. After a year, Alice would have earned 14 DAI while
Bob would have paid 14 DAI.
βb − βs = (A ∗ U + B) ∗ (1 − U ∗ (1 − R))
The slope and intercept of these curves are often adjusted by Compound’s gover-
nance. Once these parameters have been established, the spread is fully determined by
the above equation.
• The utilization rate U of the pool is the percentage of the liquidity that is bor-
rowed. All suppliers provide liquidity to a pool for a few borrowers. The interests
paid by a borrow are evenly shared amongst all suppliers as they do not compete
in the Compound pool.
4
The spread between APYs is intentional, as keeping utilization rates below 100%
enables users to both withdraw current funds or borrow new funds at any time. This
interesting property is sometimes referred to as the “liquidity” of the money market.
The design choice of this “pool model” keeps suppliers and borrowers motivated whilst
preserving the liquidity of positions.
However, this model has proven very inefficient as suppliers are not competing with
each other. Moreover, one may also remark that rates are not decided by the offer and
demand of the market but are biased by A and B parameters, chosen by the platform.
A natural idea would be to build some sort of order book to register every position in
a P2P fashion.
This very concept was tackled at first by some other protocols like ETHLend [Tea18].
There was effectively no spread between Suppliers and Borrowers under that protocol,
who were directly matched in a P2P fashion. However, the protocol was much less
flexible and fungible than a pool. According to Aave, ETHLend was indeed more
efficient in terms of rates but the lack of liquidity of those P2P term loans was greatly
limiting their use. Today, a DeFi user would rather generate a permanent yield in a pool,
with minimal supervision needed, than seek an improved yield which can be unreliable
due to high gas costs paid for every transaction. The lack of liquidity in P2P protocols
like ETHLend could be due to the low level of adoption of DeFi protocols at the time.
Or more importantly, the absence of professional market-makers able to manage P2P
positions under the heavy constraints and costs of the Ethereum blockchain itself.
The Morpho Protocol leverages the composability and liquidity of the existing PLFs
(Protocol for Loanable Funds [GWPK20, PWXL20]), such as Compound and Aave,
and to create an efficient - yet liquid - P2P market of supply and borrow positions
with near zero spread. In the previous ETH example, both sides of the market could
use an APY within the spread, for example near 1.4%. Both sides win without taking
riskier positions. In that regard, Morpho is a Pareto-improvement of current liquidity
protocols.
Users eventually get permanent positions with self-adjusting rates, being, at best,
the exact rate that the matched borrower is paying, and at worst, the rate of the
PLF that Morpho falls back on. Morpho can therefore be described as a liquidity
pool optimizer, where both borrowers and suppliers benefit from improved rates while
preserving the same guarantees and the same liquidity.
The technical limitations of blockchain technology and the low adoption of DeFi in
the early days have constrained many applications to employ sub-optimal models like
the use of pools. Morpho’s proximal goal is to address this inefficiency, hence empow-
ering the end-user with the full potential of DeFi. Many DeFi projects are starting
to address the problem of uncollateralized positions and/or the ability to provide real-
world collateral. Morpho’s longer-term goal is to build an efficient component that will
rationalize the DeFi rates market and eventually be an integral part of the solution.
The paper is divided as follows. Section 2 of this paper introduces the Morpho
Protocol, the mechanisms it leverages, and how it improves supply and borrowing
rates with no loss of liquidity and no additional liquidation risks. Section 3 focuses
on how Morpho matches suppliers with borrowers and introduces the Morpho token.
Section 4 explains how this novel approach not only optimizes current protocols but
5
Figure 3: Compound rates compared to the Morpho P2P APY on ETH over 500k
Ethereum blocks.
also builds the foundations to evolve alongside technical improvements of the underlying
blockchain itself. Morpho is a first self-contained step to a new economic space for DeFi:
competitive liquidity markets. Section 5 will finally discuss the position of Morpho in
the DeFi space and its use cases.
6
take a brief look at how the assets flow in this setting.
• Supply tokens: the user just supplies tokens to Morpho (Step 1 in the picture).
In the background, the protocol will deposit them on Compound (Step 2) and
mint cTokens (Step 3). Morpho will hold on to the cTokens and use them later
to move the positions out of the Compound pool (Steps 4 to 7).
• Borrow tokens: the user first provides some collateral, say BAT tokens, with the
same collateral factors as in Compound and triggers the borrow function (Step
4). In the background, the protocol first triggers the matching engine, linking
one or many suppliers in the Morpho Protocol to the borrowing required. Next,
Morpho uses the cTokens of the matched suppliers to move their liquidity out of
Compound’s Pool (Steps 5 and 6) and give it to the borrower (Step 7). At this
point, the position has moved from Pool-To-Peer to Peer-To-Peer and both the
borrower and the suppliers involved are getting better rates. Note that the debt
can be matched with only a part of a supplier deposit if it is small, or with the
deposits of multiple suppliers in the other case.
Notice that during the P2P position, users are out of the pool and thus seamlessly
have a P2P position with a utilization rate of 100%. Since Morpho moves the positions
out of Compound when the borrower requires a match, the matched supplier does not
need to share the rewards with the rest of the pool. Thus, coming back to the example
for rates on ETH, there is a win-win with near 1.4% for both the supply and borrow
APY, instead of an underlying 0.1% for the supplier and 2.7% for the borrower on
Compound.
Example 2.1 Assume that Alice is the first Morpho user and she decides to supply
1 ETH to the protocol and that 1 ETH = 200 cETH at this moment. If no one else
uses Morpho, after one year, Alice has earned 0.001 ETH as if she were directly in
7
Compound. Now, let’s consider that Bob borrows 1 ETH through Morpho after providing
BAT as collateral. The two users will be matched P2P and during a year, Alice would
earn close to 0.014 ETH instead of 0.001, and Bob would only pay close to 0.014 ETH
instead of 0.027. Note in this whole process, Bob and Alice do not need to execute
additional transactions compared to Compound, the matching is done automatically by
Morpho.
2.2.1 Liquidity
One may ask how Morpho ensures the full liquidity of the market in very specific
scenarios like a supplier that wants to exit a P2P position where its capital is fully
borrowed. The main idea is that in every scenario where the Morpho user would not
be able to leave, there is a fallback to Compound.
Example 2.2 Assume that Alice and Bob are the only users of Morpho. Alice sup-
plied 1 ETH while Bob borrowed it with some DAI as collateral. After a year, they
paid/earned nearly 0.014 but Bob has not repaid the position yet. However, Alice wants
her money back and triggers the withdrawal function. In this scenario, Morpho is going
to borrow on Compound using Bob’s DAI as collateral and give the borrowed ETH to
Alice. Note that from this point onward, Bob’s APY will be reset to Compound’s rate:
2.7% but if Alice comes back, they would reconnect at near 1.4%.
Remark that even in this scenario, the collateral of the borrowers can be matched
P2P as well, whether its debt is matched P2P or on the pool. This is not intuitive at
first, and quite a complex thing to understand and this is out of the scope of the White
Paper and will be elaborated on in the Yellow Paper.
2.2.2 Liquidations
Morpho has its own liquidation mechanisms, but copies directly onchain the same pa-
rameters as the underlying pool it relies on. The protocol mechanically has the same
collateral factor, liquidation conditions, and price oracles that it fetches on-chain. In
this way, the liquidation guarantees for users are the same as on the underlying PLF.
One may remark that Morpho’s contract itself sometimes has a borrow position on
the underlying pool, but Morpho can only be liquidated if its position, which is an
aggregate of all of Morpho’s users positions, is eligible for liquidation. To prevent this
Morpho’s users will be liquidated when possible, ensuring the safety of the position of
Morpho itself on the pool.
8
2.2.3 Improved rates
To recap, a supplier will have at least the net APY of Compound (supply APY +
COMP rewards). However, if the protocol finds a private match with a borrower, the
user will upgrade to what we call the “P2P APY”. The P2P APY is a win-win APY
for both suppliers and borrowers, it could be the average of supply and borrow net
APY. Note that during strong incentivization programs, PLFs can use liquidity mining
to reduce this spread or even invert it. This scenario is tackled in 2.5.
Let’s illustrate one scenario for the supplier and for the borrower.
9
Figure 7: APY of a borrower using Morpho
As can be seen, when a P2P match is created or ended, the user jumps from ex-
periencing a Compound rate to the optimized P2P APY offered by Morpho. Many
questions arise. How do we track the P2P APY, and how is it chosen? There is often
an imbalance between the number of suppliers and borrowers, how to select who will
be matched? Is the matching engine fully scalable?
The variable p2pIndex is updated according to the mid-rate yield per block via an
internal function, which is called each time a user calls a function that needs to do the
conversion to this unit. Note that the complexity is constant.
10
Example 2.3 Assume 1 ETH = 200 cETH. Alice comes first and supplies 1 ETH to
Morpho, her supply balance becomes:
onP ool : 200 cET H
inP 2P : 0 p2pET H
Now Bob borrows 1 ETH. Assume that, at this moment, 1 ETH = 100 p2pETH. Alice’s
supply balance becomes:
onP ool : 0 cET H
inP 2P : 100 p2pET H
Note that Bob shares the same numbers for his borrowing balance. A year later, if the
mid-rate remains 1.4%, the price of p2pETH should be approximately 1 ETH = 98.6
p2pETH.
Note that in current PLFs there is a great imbalance between the volume of loanable
funds compared to the volume of demand. This is done on purpose as liquidity pools
need more suppliers than borrowers to work. This is not the case with Morpho which
could have much more borrowers than suppliers and still be fully liquid and working.
Moreover, in Morpho, this imbalance is not necessarily in favor of suppliers since rates
are very different.
Indeed, the imbalance is highly dependent on market conditions and thus on the
P2P APY itself. One may remark that the P2P APY positioned in the middle in the
examples is an arbitrary choice and should be flexible to reflect supply and demand
eg. taking a rate closer to the supply APY of the PLF instead of the actual middle to
attract more borrowers. Without having to build a complete competitive interest rates
market, as in 4., some flexibility can be easily introduced to the P2P APY by updating
it according to market conditions.
11
• Simplicity: A passive user or contract should be able to benefit from Morpho
simply supplying/borrowing.
• Fairness: The use of Morpho should benefit as many users as possible.
One might think that efficiency is gained to the advantage of a small club of suppliers
that are matched. This is not quite the case. The contention here is that the way
the interest rate market is run at the moment in DeFi disincentivizes the demand for
liquidity on the borrowing side. With Morpho in place, more borrowers show up and
the entire cash-flow market grows. Moreover, as described in 2.3, the P2P APY will
self-adjust according to offer and demand and thus attract even more users!
One could also imagine that this matching engine requires to loop over the number
of users and thus can’t be scalable with the constraints of the blockchain. The Morpho
algorithm does use a loop to iterate through users. The idea is that Morpho’s gas cost
is chosen by the DAO, which sets how many matches are done for each user. When
there is no gas for matching left, the algorithm falls back to the pool for the remaining
amount. This ensures the full scalability of Morpho
Finally, remark that Morpho is fully onchain. The Yellow Paper shall provide the
full description of this algorithm.
Figure 8: Net borrow APY (orange) and net supply APY (blue) for DAI over 150k
Ethereum blocks
In this scenario, Morpho guarantees at least the liquidity mining inflated APY, but
it will be less likely to have a strictly better APY. Moreover, one may remark that a
12
user could have to deal with three different kinds of tokens in the same platform: the
underlying token, the pool token, and the Morpho Token.
To solve those problems, Morpho could let the user trade their accumulated COMP
or AAVE to Morpho Tokens with the Morpho DAO when they claim their rewards. By
doing so, the user gets a bonus of Morpho Tokens, which is given out from Morpho’s
own incentive program. Remark that Morpho thus accumulates AAVE and COMP,
which makes sense as it may want to have a say in the governance of the pool it relies
on.
To summarize, two regimes can be distinguished for Morpho:
• The spread of the PLF is not inverted: Morpho moves supply and borrowing
positions in and out of the PLF to get improved APYs as described in 2.1 In the
long term, this scenario will be the most likely.
• The spread of the PLF is inverted: Morpho and the user can trade claimed re-
wards from COMP/Aave to Morpho Tokens, incentivizing users by providing a
bonus.
13
is not a primitive itself, it is a primitive optimizer, an intermediate layer between
primitives and end-user endpoints: Protocols (or individuals) using Aave should use
the Morpho contract that connects to Aave to have better yields for their users without
taking additional market risks!
Since 80% of Compound/Aave users are protocols, we can expect the same propor-
tion for Morpho-Aave. Morpho is thus positioned at the bottom of DeFi’s stack, right
on top of the primitive.
3.1.1 Strategists
Many protocols like Yearn [Tea21] or StakeDAO [BJ21] build strategies to maximize the
earnings or minimize the users’ costs. Such protocols use Compound or Aave and thus
can use Morpho-Aave or Morpho-Compound to generate even better returns without
taking additional market risks.
3.1.2 Aggregators
Aggregators constantly try to find the best rates between different supply or borrow
markets. Remark that if Morpho-Compound is aggregated with Compound, an aggre-
gator will never switch back to Compound. Moreover, Morpho’s interfaces are the same
for Morpho-Compound, Morpho-Aave, and others. An integrator will be much more
friendly with a single interface rather than many. This way, one integrator can consider
only having the Morpho optimizers aggregated.
3.1.3 Stablecoins
Decentralized stable coin protocols build strategies for their collateral to work. However,
those strategies must be fully liquid so that the protocol can redeem the tokens and
ensure the peg of the assets. That is why many of those build strategies on Aave
are famous for being very liquid. With Morpho-Aave, protocols keep the same liquidity
and improve their rates! Most stablecoin protocols provide substantial leverage for users
supplying collateral in strategies. With Morpho in place as a strategy for a stablecoin,
the yield optimization could be multiplied for the stablecoin protocol.
3.1.4 Individuals
Individuals can of course interact with Morpho on a front-end like compound.morpho.xyz.
The ADMO, the association for the development of the Morpho DAO is also working
to develop the use of Morpho Protocol and favor integration with end-user wallets.
One could simply supply assets to Morpho and start earning interests. A slightly
more complex approach would be to borrow stable coins against other assets as collateral
to put the borrowed tokens to work in yield farming protocols.
14
Sophisticated users also borrow to implement more complex strategies, like shorts
or to build leveraged positions. Both of these kinds of users are likely to be interested
in enjoying optimized rates for their trading strategies.
4 Conclusions
The Morpho Protocol takes on the challenge of improving the way current dominant
DeFi liquidity protocols assign rates for suppliers and borrowers. Morpho does so by
exploring DeFi’s composability nature and combining cleverly the efficiency of earlier
Peer-to-Peer protocols with the liquidity offered by Pool-to-Peer protocols. The result-
ing construct pleasantly optimizes rates while giving away none of the benefits enjoyed
by the Pool-to-Peer protocols.
The current landscape for money markets in DeFi is noncompetitive for suppli-
ers. By enhancing rates, Morpho advocates stronger adoption of the protocol by the
borrowing side, overall increasing the trading activity of the market.
But, more efficient, fairer, and deeper interest rate markets are just the first step.
With increased adoption of the protocol, Morpho serves as a stepping stone towards
building competition in the DeFi rates market.
5 Acknowledgement
Morpho aims to become a decentralized common good. This White Paper itself is the
product of intense collaboration across different Universities and companies worldwide.
In particular, the authors would like to express their gratitude to Merlin Egalite, Hamza
El Khalloufi, Jean Krivine, and Morpho’s community for their invaluable contributions.
6 Legal disclaimer
6.1 Information purposes only
This White Paper is for general information purposes only and may be subject to
change without prior notice. Morpho Labs and any current or future affiliated entities,
their managers, directors, officers, employees, advisors, consultants, agents, or any other
person (the “Morpho Team”) do not make or purport to make, and hereby disclaim,
15
any representation, undertaking or warranty in any form whatsoever to any person or
entity, including any representation, undertaking or warranty concerning the accuracy
and completeness of any of the information set out in this White Paper. Nothing
contained in this White Paper is or may be relied upon as a promise, representation, or
undertaking as to the future performance of the Morpho Token. Further, circumstances
may change, and this White Paper may become outdated. The Morpho Team is under
no obligation to update or correct this White Paper in connection therewith. This
White Paper may be translated into a language other than English for information
purposes only. In such case, the English language version shall always prevail over the
translated versions of this White Paper.
16
6.5 Risk associated with the purchase of Morpho Tokens
Prospective purchasers of Morpho Tokens should evaluate all risks and uncertainties
associated with the purchase of Morpho Tokens. This White Paper does not constitute
advice nor a recommendation by the Morpho Team on the merits of purchasing or
holding Morpho Tokens or any other token or cryptocurrency. Such purchase and
holding carry substantial risks that could lead to a loss of part, or all, of the funds
invested. As of the date hereof, the Morpho Token has no known potential uses outside
of the Morpho Protocol. No promises of future performance, value, or utility are or will
be made concerning the Morpho Token, including no promise that the Morpho Protocol
will be launched and no guarantee that the Morpho Tokens will have any intrinsic value.
Morpho Tokens are designed and intended for future use on public Morpho Protocol,
for trading and governance transactions, or for the operation of nodes. The Morpho
Team may decide to amend the intended functionality of Morpho Tokens for any reason,
including to ensure compliance with any legal or regulatory requirements to which it is
subject, which may affect the utility or any other properties of the Morpho Tokens. Any
Morpho Token could be impacted by regulatory action, including potential restrictions
on the ownership, use, or possession of such tokens. Regulators or other competent
authorities may demand that the mechanics of the Morpho Tokens be altered, entirely
or in part.
References
[BJ21] Julien Bouteloup and Leopold Joy. Stake dao. https://github.com/stake-
capital/research/blob/master/Stake Capital DAO Light Paper.pdf, 2021.
[GWPK20] Lewis Gudgeon, Sam Werner, Daniel Perez, and William J Knottenbelt.
Defi protocols for loanable funds: Interest rates, liquidity and market effi-
ciency. In Proceedings of the 2nd ACM Conference on Advances in Finan-
cial Technologies, pages 92–112, 2020.
[LH19] Robert Leshner and Geoffrey Hayes. Compound: The money market pro-
tocol. compound.finance, February 2019.
[PWXL20] Daniel Perez, Sam M Werner, Jiahua Xu, and Benjamin Livshits. Liquida-
tions: Defi on a knife-edge. arXiv preprint arXiv:2009.13235, 2020.
17