From 00f13c7e8c6658698c8ee71bb479dc60400ec705 Mon Sep 17 00:00:00 2001 From: 0xbigz <83473873+0xbigz@users.noreply.github.com> Date: Thu, 15 May 2025 15:52:03 -0400 Subject: [PATCH] docs: update-multi-kink-ir-curve-section --- pages/lend-borrow/borrow-interest-rate.mdx | 58 +++++++++++++++++++--- 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/pages/lend-borrow/borrow-interest-rate.mdx b/pages/lend-borrow/borrow-interest-rate.mdx index 5c984e7..c9499bd 100644 --- a/pages/lend-borrow/borrow-interest-rate.mdx +++ b/pages/lend-borrow/borrow-interest-rate.mdx @@ -2,21 +2,21 @@ Drift's lending pools work similarly to the lending pools of [Aave](https://app.aave.com/reserve-overview/?underlyingAsset=0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48&marketName=proto_mainnet). -Each market has an optimal borrow rate and max borrow rate and uses this piecewise function based on the Utilisation Rate (U).* +Each market has an optimal borrow rate and max borrow rate and uses this piecewise function based on the Utilisation Rate (U).\* -The Utilisation Rate represents the availability of capital within the system. +The Utilisation Rate represents the availability of capital within the system. -- If **_U_** is high -- there is abundant capital within the system and the protocol users are given incentives in the form of low-interest rates to encourage borrowing; +- If **_U_** is high -- there is abundant capital within the system and the protocol users are given incentives in the form of low-interest rates to encourage borrowing; -- If **_U_** is low -- capital within the system is scarce and the protocol will increase interest rates to incentivise more capital supply and repayment of debt. +- If **_U_** is low -- capital within the system is scarce and the protocol will increase interest rates to incentivise more capital supply and repayment of debt. # _Note: this model has been adapted from Aave's _[_interest rate model_](https://docs.aave.com/risk/liquidity-risk/borrow-interest-rate)_. The parameters and model will be iterated and improved as Drift's borrow lend engine grows. Last Updated: 21 October 2022_. -The interest rate is based on the [borrow utilisation](https://github.com/drift-labs/protocol-v2/blob/master/programs/drift/src/math/spot_balance.rs#L124). +The interest rate is based on the [borrow utilisation](https://github.com/drift-labs/protocol-v2/blob/master/programs/drift/src/math/spot_balance.rs#L124). -Liquidity risk materialises when utilisation is high and this becomes more problematic as **_U_** gets closer to 100%. +Liquidity risk materialises when utilisation is high and this becomes more problematic as **_U_** gets closer to 100%. To tailor the model to this constraint, the interest rate curve is split into two parts around an optimal utilisation rate **_Uo_**. Before **_Uo_** the slope is small, after it begins rising sharply. @@ -24,6 +24,48 @@ The interest rate (`InterestRate`) model: ![](public/assets/MSvRPknbmzxMycrtC1zch_image.png) -The resulting model produces the following graph: +The resulting model produces the following graph: -![](public/assets/2w-6cQt10OwriM7aGzbKN_drift-graph-utilisationrate-1.png) \ No newline at end of file +![](public/assets/2w-6cQt10OwriM7aGzbKN_drift-graph-utilisationrate-1.png) + +## Multi-kink Borrow Interest Rate Curve + +Same logic as abbove for low, predictable rates up to “optimal”. After optimal the penalty jumps at 85 % / 90 % / 95 % / 99 % / 99.5 % utilization. This design allows for more aggressive max utilization rates while not adding too much rate volatility near optimal rate. + +$$ +\begin{aligned} +&U^*=\frac{\mathrm{optimalUtilization}}{\mathrm{SPOT\_MARKET\_UTILIZATION\_PRECISION}},\quad +\Delta R = R_{\max} - R_{\rm opt},\\[0.5em] +&R(U)=\max\{R_{\min},\,R_{\rm raw}(U)\},\\[0.5em] +&R_{\rm raw}(U)= +\begin{cases} +\displaystyle +R_{\rm opt}\,\frac{U}{U^*}, +&U\le U^*,\\[1em] +\displaystyle +R_{\rm opt} ++\Delta R\,\frac{50}{1000}\,\frac{U - U^*}{0.85 - U^*}, +&U^*