morpho-org / morpho-blue-irm

Morpho Blue Interest Rate Models
https://morpho.org
MIT License
26 stars 17 forks source link

fix(min-rate): set minimum rate to 1 bps #64

Closed Rubilmax closed 11 months ago

Rubilmax commented 11 months ago

Let's suppose the worst case scenario of a market not utilized for so long that the rate reached MIN_RATE_AT_TARGET and suddenly it is utilized 100%

So err = 1 because utilization = 100%

And we can calculate that: $r{t+1} = c \times min{rate} \times e^{adjSpeed \times elapsed}$

Which leads $elapsed = ln(\frac{r{t+1}}{c \times min{rate}}) \times \frac{1}{adjSpeed}$

Let's now plot $elapsed$ (in days) based on different values of $r_{t+1}$ and $c$:

$r_{t+1}$ \ $c$ 1 1.5 2 4 5 6 8 10
0.01% 0 0 0 0 0 0 0 0
0.1% 16.8 13.9 11.8 6.7 5.1 3.7 1.6 0
1% 33.6 30.7 28.6 23.5 21.9 20.5 18.4 16.8
10% 50.4 47.5 45.4 40.3 38.7 37.3 35.2 33.6
Rubilmax commented 11 months ago

I'd like to note that I don't think we should think about absolute of rates, because I don't think we are able to tell how the market would react to a rate of 1 or 10bps, depending on assets & volume involved

So I think the most relevant thing is to think about order of magnitude changes in rates

It seems to me that under such extreme & illiquid market conditions, having to wait 10 days (with c = 1.5 or 2) before increasing the order of magnitude of the rate is a bit too much, so only taking this into account, I'd recommend c = 4 or even 6 (but it has other implications)

EDIT: oh! I just found out that 4 corresponds to the value used in tests!