AdaptiveCurveIRM
Here is a video that shows how the Adaptive Curve IRM works:
Overview
In Morpho, the interest borrowers pay is defined by an external interest rate model (IRM) that can be chosen at market creation among a governance-defined collection.
The AdaptiveCurveIRM is the first IRM that will be available for Morpho markets. It fundamentally differs from the ones used in traditional lending pools for two main reasons:
- Unlike current lending pools’ IRMs which can be updated, the AdaptiveCurveIRM is immutable. It must therefore adapt autonomously to market conditions, such as changes in interest rates on other venues.
- In Morpho, the supply is not used as collateral. There is no need to keep markets very liquid to allow liquidations at any time. Removing this systemic risk enables more aggressive target utilization of the capital and lower penalties for illiquidity, enabling more efficient markets.
The AdaptiveCurveIRM is designed to adjust utilization to the target utilization, which is set at 90%. There are two time horizons at play: In the short term, we don't want utilization to get too low, or too high and cause liquidity problems. In the medium and long term, we want the rate level to adapt to changing market dynamics.
To achieve this, the AdaptiveCurveIRM adjusts user incentives through the action of two different mechanisms:
- The Curve Mechanism
- The Adaptive Mechanism
The Curve Mechanism
This mechanism is similar to the interest rate curve used in traditional lending pools.
The curve is characterized by two parameters:
- , which is the target rate at utilization target .
- , a fixed parameter that determines the steepness of the curve above and below the utilization target.
At each interaction, utilization will change, resulting in a discontinuous change in the rate determined by the curve.
For example:
- if utilization is 90%, the rate is
- if utilization is 100%, the rate is 4* (APR)
The aim of the Curve Mechanism is to manage short-term utilization changes.
The Adaptive Mechanism
This mechanism continuously shifts the curve to adjust to market conditions over time.
Note that the rate follows the shift of the curve. This means that the rate is continuously evolving over time, even when there is no interaction.
The shifting of the curve is done by continuously changing the value of over time:
- When the utilization is above the target utilization, continuously shifts upwards.
- When the utilization is below the target utilization, continuously shifts downwards.
The speed at which moves is updated at each interaction: the farther we are from the target, the faster , hence the curve, shifts.
For example, if the utilization remains at 100% for 5 days, will progressively double. This is the maximum speed at which can move.
The values of some
constants are
hardcoded into the code deployed on Ethereum, such as TARGET_UTILIZATION
,
INITIAL_RATE_AT_TARGET
, etc.
Formal description
We define:
- Utilzation ()
is the ratio of total borrow over total supply at time .
The utilization target is constant:
- Error ():
It can be seen as the difference between the utilization and the target, divided by a normalization factor. The normalization is here to make the distance between and equals to the distance between and .
- Curve:
with
- History of interactions (:
Noting the time at which the interaction occurred,
- Last interaction ():
- Speed factor (:
- Rate at target (
is set to an arbitrary value
Then,
At any time , the borrow rate is given by the formula:
Implementation
The contract implements the Interest Rate Model interface to fit Morpho's specifications.
Moreover, the implementation stores configuration variables and a market parameter updated at each borrowRate
call for this market.
Variables
Constants
The values of the following constants are hardcoded into the code deployed on Ethereum
CURVE_STEEPNESS
: Curve steepness (scaled by WAD), value =4
.ADJUSTMENT_SPEED
: Adjustment speed per second (scaled by WAD), value =50/nb of seconds per year
.TARGET_UTILIZATION
: Target utilization (scaled by WAD), value =90%
.INITIAL_RATE_AT_TARGET
: Initial rate at target per second (scaled by WAD), value =4%/nb of seconds per year
.MIN_RATE_AT_TARGET
: Minimum rate at target per second (scaled by WAD), value =0.1%/nb of seconds per year
.MAX_RATE_AT_TARGET
: Maximum rate at target per second (scaled by WAD), value =200%/nb of seconds per year
.
Immutables
MORPHO
: Address of Morpho.
Mappings
Rate at target
mapping(Id => uint256) public rateAtTarget;
Rate at target utilization for each market. Tells the height of the curve.
Events
BorrowRateUpdate
event BorrowRateUpdate(Id indexed id, uint256 avgBorrowRate, uint256 rateAtTarget);
Emitted when the borrow rate is updated (called by Morpho).
Parameters:
Name | Type | Description |
---|---|---|
id | Id | The id of the market. |
avgBorrowRate | uint256 | The average borrow rate of the market. |
rateAtTarget | uint256 | The stored rate at target of the market. |