# Interest rate impact in Morpho markets
In this note, I recall how the interest rate is set in Morpho markets and then use the formula to calculate interest rate impact of lending and borrowing. The impact is negligible when utilization rates are below 90\% but becomes significant above this threshold, even for small variations of available liquidity.
## How the interest rate is set
According to the documentation about the [interest rate model](https://docs.morpho.org/morpho/concepts/irm), for $0 \le \mathrm{UR} \le 0.9$, the borrow $\mathrm{APR}$ is:
$$
R(\mathrm{UR}) \, = \, \big( \frac{1}{4} + \frac{5}{6} \, \mathrm{UR} \big) \, r_{90\%}
$$
and for $0.9 < \mathrm{UR} \le 1$, it is:
$$
R(\mathrm{UR}) \,=\, \big( 1 + 30\, ( \mathrm{UR} - 0.9) \big) \, r_{90\%}.
$$
### Properties
The borrow $\mathrm{APR}$ is 1/4 the target interest rate at $\mathrm{UR} = 0$:
$$
R(0) \;=\; \frac{1}{4}\,r_{90\%}
$$
It is equal to its target if $\mathrm{UR} = 0.9$:
$$
R(0.9) \;=\; \big( \frac{1}{4} + \frac{5}{6} \frac{9}{10} \big) \, r_{90\%} = \frac{15 + 45}{60} \, r_{90\%} = \, r_{90\%}
$$
It is four times the target for $\mathrm{UR} = 1$:
$$
R(1) \;=\; \frac{ 10 + 30 \times 1}{10} \, r_{90\%} = 4 \; r_{90\%}
$$
### Conversion borrow APR $\rightarrow$ lending APY
The IRM sets the borrow $\mathrm{APR}$. We need to convert it into a continuously compounding borrow $\mathrm{APY}$:
$$
\mathrm{APY} = e^{R(\mathrm{UR})} - 1
$$
The lending $\mathrm{APY}^*$ is
$$
\mathrm{APY}^* = \mathrm{UR} \times \mathrm{APY}
$$
### Example
Suppose the target interest rate is 10\% and the $\mathrm{UR}$ is 95\%. The borrow $\mathrm{APR}$ is:
$$
R \;=\; 0.1 \;+\; 30 \times 0.1 \times 0.05 = 25\%
$$
The lending $\mathrm{APR}$ is:
$$
\mathrm{APY} = 0.95 \times 28.4\%
$$
The lending $\mathrm{APY}$ is:
$$
\mathrm{APY}^* = e^{0.25} - 1 = 28.4\% = 27\%
$$
## Interest rate impact
With $B$ the total borrow and $S$ the total supply in the market, $\mathrm{UR}$ is $B/S$. Given a target interest rate $r_{90\%}$, the lending $\mathrm{APY}$ is given by
$$
\mathrm{APY}^* = \text{exp} \Big( { \frac{B}{S} R \big( \frac{B}{S} \big)} \Big) - 1
$$
Depositing $l \geq 0$ additional liquidity into the market or removing $-S \leq l \leq 0$ liquidity results in a changing $\mathrm{APY}$:
$$
\mathrm{APY}^* = \text{exp} \Big( { \frac{B}{S+l} R \big( \frac{B}{S+l} \big)} \Big) - 1
$$
The interest rate is increasing when more liquidity is borrowed and decreasing when additional liquidity is supplied in the market.
The **interest rate impact** measures by how much the APY for borrowers or the APY* for lenders changes following a small additional borrowed or lent amount.
The interest rate impact is larger:
- the higher the target interest rate at 90\%,
- the utilization rate being higher than 90\%.
## Quantitative assessment
### Interest rate impact for borrowers
In the figure, for a target interest rate of 7\%, increasing liquidity borrowed from the market by 1\% of the total supply leads to a minimal increase in interest rate below utilization rates of 90\% but, due to the high slope of the pricing curve, a significant increase above 90\%.<center>

</center>
Borrowing 1\% of liquidity instantly increases the borrowing cost by 2 percentage points and more above 90\%.
The interest rate impact above 90\% is even larger for higher interest rate targets. For a target interest rate of 15\%, borrowing 1\% of the supply leads to an increase superior to 5\% and up to 8\%.<center>

</center>
### Interest rate impact for lenders
The interest rate impact for lenders is quantitatively similar to the one for borrowers. In the figure, for a target interest rate of 7\%, providing liquidity equal to 1\% of the supply leads to a minimal decrease in interest rate below utilization rates of 90\% but to an increase of 2 percentage points and more above 90\%.<center>

</center>
The interest rate impact above 90\% is also larger for higher interest rate targets. For a target interest rate of 15\%, increasing liquidity by 1\% leads to a decrease superior to 4\% of the APY, up to 8\%.<center>

</center>