Introduction
Lending markets in DeFi Decentralized Finance (DeFi) has transformed lending by eliminating centralized intermediaries such as banks, replacing them with transparent, algorithm-driven liquidity pools. Platforms such as Aave [4 ] and Compound [19 ] enable lenders to provide the capital that borrowers can access by pledging collateral. A key goal of these protocols is to maintain stable utilization rates, adjusting interest rates to balance supply and demand [27 ] . Low utilization results in lower interest rates to encourage borrowing, while increased utilization drives up rates to manage liquidity. Another critical parameter is the collateral factor, which ensures that the risk of borrowing is minimized while the markets remain attractive. Setting appropriate collateral levels requires evaluating recent price behavior of the collateral asset and the lender’s risk tolerance [37 ] .
Current approaches Current DeFi platforms determine interest rates based on a static function of utilization [3 , 18 ] . This approach uses utilization to represent supply/demand dynamics, market risk, and attractiveness, relying on a manually set, arbitrary interest rate curve. Additionally, collateral factors in these markets are established through a thorough process involving community proposals and reviews [2 , 17 ] , which are voted on every few months or so.
Challenges in adapting to market conditions Current DeFi systems are slow to adapt to rapid market changes, leading to potential losses and increased risks due to delayed parameter adjustments, particularly during major price fluctuations. For instance, between August 1 and August 6, 2024, Aave ETH V3 experienced over $116M in liquidations due to a significant price drop in ETH. Among the affected users, only 45% ($53M) actively increased their collateral just before being liquidated. It turns out that a 15% increase in the over-collateralization ratio could have nearly halved the number of liquidations for these users (see Figure 1b). However, Aave’s slow response in adjusting collateral ratios and liquidation thresholds failed to avert these outcomes. Additionally, Aave has faced challenges in maintaining optimal utilization levels during rapid, unforeseen market changes, particularly when demand spikes due to new yield farming opportunities or similar events. For example, Figure 1a illustrates the utilization of the Aave LUSD-ETH pool during a period of significant volatility in LUSD demand, driven by unstable yield farming opportunities. Although the protocol aims to maintain a target utilization of 0.8, it frequently fails to achieve this target, with deviations persisting for extended periods.
Figure 1a. Lending platforms fail to adapt to market demand and supply changes
Figure 1b. A slight increase in the collateral ratio could have reduced liquidations
Modeling markets and adaptive lending pools The first challenge in designing a better lending protocols is to model the existing population of DeFi lenders and borrowers. We start this work by proposing a model based on changing demand and supply curves with noise (§ 2 ). We define an optimal interest rate controller to be the one that sets the rate exactly equal to the equilibrium rate that realizes the desired utilization given the current market conditions. Our goal is to design an optimally adaptive lending protocol for this model, and to quantify the agility with which the protocol can change based on external market conditions.
Adaptivity versus robustness Introducing adaptivity into a protocol can increase its vulnerability to manipulation [32 ] , as an adaptive protocol adjusts based on recent market activities, learning from the trades made by borrowers and lenders. However, an adversary can exploit this by distorting the historical trade data, making the protocol respond to false shifts in demand or supply. Therefore, it is crucial to quantify the tradeoff between adaptivity and adversarial robustness before deploying any new lending protocol. Specifically, we assess how much the interest rate can be manipulated when an adversary controls a portion of the total demand and supply. We suggest two solutions each operating in a different scale, to mitigate the adversarial manipulations.
The following section summarizes our results. We set the broader research context in which we make these contributions in Appendix [§ 10 .§ 1 ].
Our Contributions
Dynamic model and evaluation metrics: (§ 2 ) We propose a dynamic model of the lending market via evolving demand and supply curves for the lent asset. We introduce three core metrics to evaluate DeFi lending platforms, focusing on targeting a specific utilization, liquidation/default risk, and the robustness of the protocol to adversarial manipulations.
Agile interest rate controller: (§ 3.1 ) We propose an adaptive interest rate controller that adjusts dynamically based on real-time market conditions, ensuring a desired stable utilization in presence of changing environments. The market conditions are estimated in an online manner, using a variant of the Recursive Least Squares algorithm. We provide theoretical guarantees on the controller’s convergence speed to the target interest rate. Additionally, we outline how the algorithm can be augmented with a risk minimization controller, which keeps defaults and liquidations below a desired threshold. Bounds on adversarial robustness: (§ 4 ) We establish theoretical bounds on the manipulability of the interest rate as set by our adaptive protocol and compare it with a bound for a static curve. We show that adaptive protocols can be manipulated arbitrarily in presence of inelastic demand/supply of loans, while the same remains bounded for static protocols.
Enhancing the adversarial robustness: (§ 4.3 ) We propose two complementary methods to mitigate adversarial manipulation, each addressing the issue from a different perspective. The first is an algorithmic approach based on robust recursive least squares, designed to detect and filter out improbable demand and supply patterns. The second focuses on structural market adjustments that encourage greater user elasticity, strengthening the lending pool’s resilience against adversarial manipulation.
Evaluation: (§ 5 ) We justify our dynamic demand/supply curve model by fitting it on data from lending pools on Aave, obtaining a 5% best-fit error. We complement the theoretical guarantees of previous sections with empirical tests of the convergence and robustness of our algorithm.
Problem formulation
Market participants and pool mechanics
DeFi lending platforms consist of three main participants: borrowers, lenders, and liquidators, who interact via a smart contract, denoted as P \mathcal{P} P . These interactions occur in discrete time slots, each corresponding to a block.
Borrowers Borrowers secure loans by providing collateral in asset A c \mathcal{A}_{c} A c to borrow asset A l \mathcal{A}_{l} A l from a pooled system. The loan amount for borrower i i i at time t t t is B t ( i ) B_{t}(i) B t ( i ) , with total borrowings B t B_{t} B t , and their collateral is C t ( i ) C_{t}(i) C t ( i ) , with total collateral C t C_{t} C t . To open a borrowing position, borrowers must satisfy B t ( i ) C t ( i ) p t < c t < 1 \frac{B_{t}(i)}{C_{t}(i)p_{t}} < c_{t} < 1 C t ( i ) p t B t ( i ) < c t < 1 , where p t p_{t} p t is the price of A c \mathcal{A}_{c} A c relative to A l \mathcal{A}_{l} A l , and c t c_{t} c t is the protocol-defined collateral factor. The protocol applies a global interest rate r t r_{t} r t to all borrowings, increasing B t B_{t} B t over time.
Lenders Lenders deposit A l \mathcal{A}_{l} A l to earn interest from borrowers. Unlike many platforms that reserve interest for risk funds and token rewards [4 , 19 ] , this protocol distributes all accrued interest to lenders, making them directly bear default risks. Let L t ( i ) L_{t}(i) L t ( i ) be lender i i i ’s deposit and L t L_{t} L t be the total deposits, with utilization rate U t = B t L t U_{t} = \frac{B_{t}}{L_{t}} U t = L t B t . Lenders earn interest at r t r_{t} r t on borrowed funds, and in case of default, losses are proportional to their deposits.
Liquidators To prevent risks from falling collateral prices, a liquidation mechanism allows third-party liquidators to intervene when a borrower’s loan-to-value (LTV) ratio exceeds the liquidation threshold L T t < 1 LT_{t} < 1 L T t < 1 . A liquidator repays part of the borrower’s debt in A l \mathcal{A}_{l} A l , claims a corresponding amount of A c \mathcal{A}_{c} A c , and earns an incentive fee L I t LI_{t} L I t . Liquidations continue until the LTV ratio falls below the liquidation threshold L T t LT_{t} L T t .
Protocol (P \mathcal{P} P ) The protocol is encoded in the smart contract and dictates the pool parameters { r t , c t , L T t , L I t } \{r_{t}, c_{t}, LT_{t}, LI_{t}\} { r t , c t , L T t , L I t } for each timeslot, following predetermined rules. The smart contract also provides an interface for users to interact with the pool under these conditions.
Asset price model
We model the system in discrete time intervals, normalized to the block time. The price of the collateral asset p t p_{t} p t is tracked from block to block, while the lent asset, A l \mathcal{A}_{l} A l , is assumed to be a stablecoin with minimal price fluctuation. The collateral asset price p t p_{t} p t follows an exogenous geometric Brownian motion with stochastic volatility σ t \sigma_{t} σ t , based on the Heston model [26 ] .
σ t 2 = σ t − 1 2 + κ ( θ − σ t − 1 2 ) + ξ σ t − 1 η t , η t ∼ N ( 0 , 1 ) (1) \sigma_t^2 = \sigma_{t-1}^2 + \kappa(\theta- \sigma_{t-1}^2) + \xi\sigma_{t-1}\eta_t,\qquad\eta_t \sim\mathcal{N}(0,1) \tag*{(1)} σ t 2 = σ t − 1 2 + κ ( θ − σ t − 1 2 ) + ξ σ t − 1 η t , η t ∼ N ( 0 , 1 ) (1)
p t = p t − 1 exp ( ( μ − σ t 2 2 ) + σ t ε t ) , ε t ∼ N ( 0 , 1 ) (2) p_t = p_{t-1}\exp\left(\left(\mu- \frac{\sigma_t^2}{2}\right) + \sigma_t\varepsilon_t\right),\qquad\varepsilon_t \sim\mathcal{N}(0,1) \tag*{(2)} p t = p t − 1 exp ( ( μ − 2 σ t 2 ) + σ t ε t ) , ε t ∼ N ( 0 , 1 ) (2)
Here, μ \mu μ is the drift, σ t \sigma_t σ t is the stochastic volatility, κ \kappa κ is the mean-reversion rate, θ \theta θ is the long-term volatility mean, ξ \xi ξ represents the volatility of volatility, η t \eta_t η t is a normal random variable for the volatility process, and ε t \varepsilon_t ε t is a normal random variable for the asset price.
Users' incentives
Each borrower (lender) i i i is specified with their time varying demand (supply) capacity denoted by B t ( i ) B_t(i) B t ( i ) (L t ( i ) L_t(i) L t ( i ) ) and their private value r t b ( i ) r_t^b(i) r t b ( i ) (r t l ( i ) r_t^l(i) r t l ( i ) ), representing the maximum (minimum) interest rate they are willing to pay (receive from) P \mathcal{P} P to remain engaged without seeking alternative markets. The rates r t b ( i ) r_t^b(i) r t b ( i ) and r t l ( i ) r_t^l(i) r t l ( i ) , referred to as external interest rates in this paper, represent the rates that alternative markets with comparable risk to P \mathcal{P} P would offer to borrower (or lender) i i i . We represent the vector consisting of all borrowers (lenders) external rate by r ^ t b \hat{\mathbf{r}}_t^b r ^ t b (r ^ t l \hat{\mathbf{r}}_t^l r ^ t l ) and their capacity vector respectively by B ^ t \hat{\mathbf{B}}_t B ^ t (L ^ t \hat{\mathbf{L}}_t L ^ t ).
Truthful vs strategic Borrower (Lender) i i i is considered truthful if, at any given time t t t and given the interest rate r t r_t r t set by P \mathcal{P} P , they borrow (lend) to their maximum capacity i.e., B t ( i ) B_t(i) B t ( i ) (L t ( i ) L_t(i) L t ( i ) ) if and only if r t ≤ r t b ( i ) r_t \leq r_t^b(i) r t ≤ r t b ( i ) (r t U t ≥ r t l ( i ) r_t U_t \geq r_t^l(i) r t U t ≥ r t l ( i ) ). Any borrower/lender who deviates from this strategy is considered strategic .
True demand/supply curve The true demand curve is the total demand at interest rate r r r when all the borrowers are truthful, this function is parameterized by the external interest rate and capacity of the borrowers collectively denoted by B t : = { B ^ t , r ^ t b } \mathcal{B}_t := \{\hat{\mathbf{B}}_t,\hat{\mathbf{r}}_t^b\} B t := { B ^ t , r ^ t b } :
f ( r ; B t ) : = ∑ i B t ( i ) 1 ( r t b ( i ) ≥ r ) (3) f(r;\mathcal{B}_t) := \sum_i B_t(i)\mathbf{1}_{(r_t^b(i)\geq r)} \tag*{(3)} f ( r ; B t ) := i ∑ B t ( i ) 1 ( r t b ( i ) ≥ r ) (3)
Similarly, the true supply curve represents the total supply at an effective interest rate when all the lenders are truthful; suppliers’ effective rate is the interest rate they receive on the utilized part of the pool i.e., r e f f : = r ⋅ U r_{\mathrm{eff}} := r \cdot U r eff := r ⋅ U . The supply function is parameterized by the external interest rate and capacity of the lenders collectively denoted by L : = { L ^ t , r ^ t l } \mathcal{L} := \{\hat{\mathbf{L}}_t,\hat{\mathbf{r}}_t^l\} L := { L ^ t , r ^ t l } :
g ( r e f f ; L t ) : = ∑ i L t ( i ) 1 ( r t l ( i ) ≤ r e f f ) (4) g(r_{\mathrm{eff}};\mathcal{L}_t) := \sum_i L_t(i)\mathbf{1}_{(r_t^l(i)\leq r_{\mathrm{eff}})} \tag*{(4)} g ( r eff ; L t ) := i ∑ L t ( i ) 1 ( r t l ( i ) ≤ r eff ) (4)
Utility function Strategic lenders and borrowers decide how much to allocate to the protocol versus external markets based on their expected returns. A strategic lender i i i will allocate some portion of their supply, L ^ t ( i ) \hat{L}_t(i) L ^ t ( i ) , to the protocol while placing the rest in an external market offering a rate r t l ( i ) r_t^l(i) r t l ( i ) . The lender’s goal is to maximize their overall returns from both sources over time. Similarly, a strategic borrower i i i selects how much to borrow, B ^ t ( i ) \hat{B}_t(i) B ^ t ( i ) , to minimize their overall borrowing costs. Calculating these optimal decisions can be quite complex, so we simplify the utility functions in certain cases to better analyze user behavior within the protocol.
At any time t t t , a strategic lender i i i allocates a portion (or potentially all) of their supply L ^ t ( i ) ≤ L t ( i ) \hat{L}_t(i) \leq L_t(i) L ^ t ( i ) ≤ L t ( i ) to P \mathcal{P} P and allocate the remaining supply, L t ( i ) − L ^ t ( i ) L_t(i) - \hat{L}_t(i) L t ( i ) − L ^ t ( i ) , to an alternative external market that offers a rate r t l ( i ) r_t^l(i) r t l ( i ) . The lender’s objective is to maximize cumulative utility over time, derived from expected interest rates from both P \mathcal{P} P and the alternative market. Formally, the cumulative utility over time for the lender is expressed as:
E [ ∑ t = 0 ∞ ( L ^ t ( i ) r t U t + ( L t ( i ) − L ^ t ( i ) ) r t l ( i ) ) ] (5) \mathbb{E}\left[\sum_{t=0}^{\infty}\left(\hat{L}_{t}(i)r_{t}U_{t}+\left(L_{t}(i)-\hat{L}_{t}(i)\right)r_{t}^{l}(i)\right)\right] \tag*{(5)} E [ t = 0 ∑ ∞ ( L ^ t ( i ) r t U t + ( L t ( i ) − L ^ t ( i ) ) r t l ( i ) ) ] (5)
Here, the expectation is taken over the randomness of protocol and the stochastic nature of the users’ behaviour which in turn impact the pool’s state and P \mathcal{P} P ’s decisions. Similarly, a borrower i i i aims to choose their demand value B ^ t ( i ) ≤ B t ( i ) \hat{B}_{t}(i)\leq B_{t}(i) B ^ t ( i ) ≤ B t ( i ) to minimize the sum of the expected interest rate paid over time, which can be formalized as:
E [ ∑ t = 0 ∞ ( B ^ t ( i ) r t + ( B t ( i ) − B ^ t ( i ) ) r t b ( i ) ) ] (6) \mathbb{E}\left[\sum_{t=0}^{\infty}\left(\hat{B}_{t}(i)r_{t}+\left(B_{t}(i)-\hat{B}_{t}(i)\right)r_{t}^{b}(i)\right)\right] \tag*{(6)} E [ t = 0 ∑ ∞ ( B ^ t ( i ) r t + ( B t ( i ) − B ^ t ( i ) ) r t b ( i ) ) ] (6)
However, calculating these utility functions and determining the sequences { L ^ t ( i ) } t \{\hat{L}_{t}(i)\}_{t} { L ^ t ( i ) } t and { B ^ t ( i ) } t \{\hat{B}_{t}(i)\}_{t} { B ^ t ( i ) } t that optimize them can be highly complex and may not lead to truthful strategies. In this paper, whenever needed, we simplify these utility functions for specific protocols and user behavior scenarios.
Protocol objectives
We define the protocol objectives in a three-fold manner. The explicit mathematical definitions we use for these objectives are given in Appendix [§ 10 .§ 2 ].
2.4.1 Demand-supply balancing. In decentralized finance (DeFi) platforms, maintaining an optimal balance between supply and demand is crucial, with the key metric being proximity to the target utilization rate, U ∗ U^{*} U ∗ [23 , 24 ] . Low utilization implies inefficient use of deposits, while high utilization restricts withdrawals. To evaluate a protocol P \mathcal{P} P ’s ability to maintain U ∗ U^{*} U ∗ , we define the optimal interest rate r u t l ∗ r_{\mathrm{utl}}^{*} r utl ∗ as the rate minimizing deviation from U ∗ U^{*} U ∗ , given the utilization function U = f ( r ; B 0 ) / g ( r e f f ; L 0 ) U=f(r;B_{0})/g(r_{\mathrm{eff}};L_{0}) U = f ( r ; B 0 ) / g ( r eff ; L 0 ) where r e f f = U ⋅ r r_{\mathrm{eff}}=U\cdot r r eff = U ⋅ r . We introduce Rate Deviation , denoted by R P v ( U ∗ ) R_{\mathcal{P}}^{\mathrm{v}}(U^{*}) R P v ( U ∗ ) , as the expected deviation of the protocol’s interest rate from r u t l ∗ r_{\mathrm{utl}}^{*} r utl ∗ , considering randomness in protocol execution and noise in user demand and supply. A more revenue-centric version of this balancing mechanism is defined in Appendix [§ 10 .§ 3 ] and Appendix [§ 10 .§ 4 ].
2.4.2 Adversarial robustness. Strategic borrowers and lenders can manipulate a protocol’s interest rate by simulating demand and supply responses to maximize personal utility. We analyze the extent of such manipulation by considering a protocol P \mathcal{P} P with truthful users following demand and supply curves f ( r ; B t ) f(r;B_{t}) f ( r ; B t ) and g ( r e f f ; L t ) g(r_{\mathrm{eff}};L_{t}) g ( r eff ; L t ) , alongside a strategic lender A l \mathcal{A}^{l} A l and a strategic borrower A b \mathcal{A}^{b} A b , who control a fraction δ l \delta_{l} δ l and δ b \delta_{b} δ b of maximum supply and demand, respectively, and have external rates r l r^{l} r l and r b r^{b} r b . Defining r t r u t h f u l r_{\mathrm{truthful}} r truthful and r s t r a t e g i c r_{\mathrm{strategic}} r strategic as the steady-state interest rates with and without strategic behavior, we introduce Adversarial Impact Deviation , denoted by A I P ( δ b , δ l ) AI^{\mathcal{P}}(\delta_{b},\delta_{l}) A I P ( δ b , δ l ) , as the supremum of the expected deviation between these rates over all external rate choices of strategic users.
2.4.3 Liquidation and default risk control. In peer-to-pool-to-peer lending, the primary risks are borrower defaults and liquidations, requiring dynamic adjustments of parameters such as the collateral factor c t c_{t} c t , liquidation threshold L T t LT_{t} L T t , and liquidation incentive L I t LI_{t} L I t based on price volatility. Defaults occur when a borrower’s debt exceeds collateral value due to price drops, while liquidations happen when a price decline forces the protocol to sell collateral to restore safe loan-to-value ratios. These risks are formally defined in Appendix [§ 10 .§ 7 ]. The protocol’s ability to manage these risks can be quantified using metrics such as the expected value or 95th percentile of pool defaults and liquidations, computed with respect to the price distribution.
Baseline
For the baseline, we consider protocols akin to Compound, which utilize a piecewise linear interest rate curve to ensure stability. These protocols dynamically adjust interest rates at each block according to the model:
r t = { R s l o p e 1 U t U ∗ , if U t ≤ U ∗ R s l o p e 1 + R s l o p e 2 ( U t − U ∗ 1 − U ∗ ) , if U t > U ∗ (7) r_t =
\begin{cases}
R_{\mathrm{slope1}}\dfrac{U_t}{U^*}, & \text{if } U_t \le U^* \\
R_{\mathrm{slope1}} + R_{\mathrm{slope2}}\left(\dfrac{U_t-U^*}{1-U^*}\right), & \text{if } U_t > U^*
\end{cases} \tag*{(7)} r t = ⎩ ⎨ ⎧ R slope1 U ∗ U t , R slope1 + R slope2 ( 1 − U ∗ U t − U ∗ ) , if U t ≤ U ∗ if U t > U ∗ (7)
In contrast to our proposed approach, these platforms generally set collateral factors and other market parameters through offline simulations that attempt to forecast near-future market conditions. Parameters are selected based on simulation outcomes and are subject to decentralized governance voting. Since this phase happens in an offline and opaque manner by centralized companies, we cannot compare this aspect of their protocol with ours.
Protocol design
Interest rate controller
Demand and supply curve We model the overall supply (L t L_t L t ) and demand (B t B_t B t ) as a linear functions of the interest rate (r t r_t r t ) of the previous timeslot:
B = { L t , if r t < r min , − a t b r t + b t b , if r min ≤ r t ≤ r max , 0 , if r t > r max , B =
\begin{cases}
L_t, & \text{if } r_t < r_{\min}, \\
-a_t^b r_t + b_t^b, & \text{if } r_{\min} \le r_t \le r_{\max}, \\
0, & \text{if } r_t > r_{\max},
\end{cases} B = ⎩ ⎨ ⎧ L t , − a t b r t + b t b , 0 , if r t < r m i n , if r m i n ≤ r t ≤ r m a x , if r t > r m a x ,
B t + 1 = min { B + ε t , L t } ε t ∼ N ( 0 , ν ) (8) B_{t+1} = \min\{B+\varepsilon_t,L_t\} \qquad\varepsilon_t \sim\mathcal{N}(0,\nu) \tag*{(8)} B t + 1 = min { B + ε t , L t } ε t ∼ N ( 0 , ν ) (8)
L = { B t , if r t U t < r min , a t l r t U t − b t l , if r min ≤ r t U t ≤ r max , ∞ , if r t U t > r max , L =
\begin{cases}
B_t, & \text{if } r_tU_t < r_{\min}, \\
a_t^l r_tU_t-b_t^l, & \text{if } r_{\min} \le r_tU_t \le r_{\max}, \\
\infty, & \text{if } r_tU_t > r_{\max},
\end{cases} L = ⎩ ⎨ ⎧ B t , a t l r t U t − b t l , ∞ , if r t U t < r m i n , if r m i n ≤ r t U t ≤ r m a x , if r t U t > r m a x ,
L t + 1 = max { L + ε t , B t } ε t ∼ N ( 0 , ν ) (9) L_{t+1} = \max\{L+\varepsilon_t,B_t\} \qquad\varepsilon_t \sim\mathcal{N}(0,\nu) \tag*{(9)} L t + 1 = max { L + ε t , B t } ε t ∼ N ( 0 , ν ) (9)
Where a t b , b t b , a t l , b t l ∈ R + a_t^b,b_t^b,a_t^l,b_t^l \in\mathbb{R}^+ a t b , b t b , a t l , b t l ∈ R + , and b t l a t l < r min < r max < b t b a t b \dfrac{b_t^l}{a_t^l}<r_{\min}<r_{\max}<\dfrac{b_t^b}{a_t^b} a t l b t l < r m i n < r m a x < a t b b t b . This model assumes that within a moderate range of interest rates, demand decreases linearly with the interest rate, and supply increases linearly with the lender’s effective interest rate (r t U t r_tU_t r t U t ). Outside of this moderate range, lenders and borrowers react drastically. Borrowers may attempt to take out all available funds if interest rates are too low or repay their entire debt if rates are too high. Similarly, lenders may deposit all their available funds when rates are extremely favorable or withdraw all their funds when rates are unattractive.
Estimating the parameters Our proposed interest rate controller employs a Recursive Least Squares (RLS) estimator with a forgetting factor to adaptively estimate the parameters a t b a_t^b a t b , b t b b_t^b b t b , a t l a_t^l a t l , and b t l b_t^l b t l . The RLS with a forgetting factor is a recursive version of the least squares estimator designed to handle systems modeled by y t = x t T θ t + ε t y_t=x_t^T\theta_t+\varepsilon_t y t = x t T θ t + ε t , where θ t \theta_t θ t is the state of the system that can change arbitrarily over time; And ε t \varepsilon_t ε t is an independent, zero-mean noise term. Given a new sample ( x t , y t ) (x_t,y_t) ( x t , y t ) at any time t t t , the RLS estimator updates its estimate of θ t \theta_t θ t , denoted as θ ^ t \hat{\theta}_t θ ^ t , by minimizing the following cost function [9 , 28 ] :
J t ( θ ) = ∑ τ = 0 t ρ t − τ ( y τ − x τ T θ ) 2 , (10) J_t(\theta)=\sum_{\tau=0}^{t}\rho^{t-\tau}(y_\tau-x_\tau^T\theta)^2, \tag*{(10)} J t ( θ ) = τ = 0 ∑ t ρ t − τ ( y τ − x τ T θ ) 2 , (10)
Where 0 < ρ < 1 0 < \rho< 1 0 < ρ < 1 is the forgetting factor, it assigns greater weight to more recent data compared to older data. The RLS algorithm, when incorporating a forgetting factor, dynamically updates its estimates based on new data. Similar to the Kalman filter, at each iteration, the algorithm calculates an estimation of the error covariance matrix, P t − 1 \mathbf{P}_{t-1} P t − 1 , which is then used to determine the gain matrix, K t \mathbf{K}_t K t . This gain matrix adjusts the influence of the new data point on the current estimate. If the estimated error is large or the forgetting factor is low (indicating the algorithm forgets faster), recent data points have a greater impact on the updated estimation. This process ensures that the algorithm effectively blends new information with past estimates, adapting to changes in the underlying data over time. Algorithm 1 outlines the use of RLS to estimate the parameters of the demand and supply curves.
Optimizing interest rate for desired utilization Given the demand and supply models presented in Equations 8 and 9, when the noise is small, the utilization rate can be approximated with:
U t + 1 ≈ { 1 if r t < r min , − a t b r t + b t b a t l r t U t − b t l if r min ≤ r t , and r t U t ≥ r max , 0 if r t U t > r max , (11) U_{t+1} \approx
\begin{cases}
1 & \text{if } r_t < r_{\min},\\
\dfrac{-a_t^b r_t+b_t^b}{a_t^l r_t U_t-b_t^l} & \text{if } r_{\min} \le r_t,\text{ and } r_t U_t \ge r_{\max},\\
0 & \text{if } r_t U_t > r_{\max},
\end{cases} \tag*{(11)} U t + 1 ≈ ⎩ ⎨ ⎧ 1 a t l r t U t − b t l − a t b r t + b t b 0 if r t < r m i n , if r m i n ≤ r t , and r t U t ≥ r m a x , if r t U t > r m a x , (11)
The objective of our protocol is to set the interest rate r t r_t r t such that the utilization remains close to a desired utilization U ∗ U^* U ∗ . The optimal interest rate r u t l ∗ r_{\mathrm{utl}}^* r utl ∗ that achieves this desired utilization can be derived as follows:1
− a t b r u t l ∗ + b t b a t l r u t l ∗ U ∗ − b t l = U ∗ ⟹ r u t l ∗ = b t b + b t l U ∗ a t b + a t l ( U ∗ ) 2 (12) \frac{-a_t^b r_{\mathrm{utl}}^*+b_t^b}{a_t^l r_{\mathrm{utl}}^* U^*-b_t^l}=U^* \Longrightarrow r_{\mathrm{utl}}^*=\frac{b_t^b+b_t^l U^*}{a_t^b+a_t^l(U^*)^2} \tag*{(12)} a t l r utl ∗ U ∗ − b t l − a t b r utl ∗ + b t b = U ∗ ⟹ r utl ∗ = a t b + a t l ( U ∗ ) 2 b t b + b t l U ∗ (12)
We have developed an interest rate controller module, detailed in Algorithm 2, that determines the optimal interest rate using parameters estimated from the RLS algorithm. To promote exploration when estimation error is high, the controller module samples r t r_t r t from a Gaussian distribution. The mean of this distribution is the r u t l ∗ r_{\mathrm{utl}}^* r utl ∗ calculated using the latest estimated parameters a ^ t b \hat{a}_t^b a ^ t b , b ^ t b \hat{b}_t^b b ^ t b , a ^ t l \hat{a}_t^l a ^ t l , b ^ t l \hat{b}_t^l b ^ t l , and the variance is derived from the error covariance matrix calculated by the RLS algorithm. This approach allows for more diverse data points when error is high; As the algorithm progresses and the parameter estimates become more accurate, the variance decreases, leading to less randomization. Over time, the rate converges more closely to the optimal value, ensuring more precise results.
Theoretical guarantees on the Rate Deviation We consider a canonical scenario where the parameters of the demand and supply curves, initially set to certain values, change to new values a b a^b a b , b b b^b b b , a l a^l a l , b l b^l b l at time t 0 t_0 t 0 . We then compare the Rate Deviation of the RLS-based controller with the baseline controller. For simplicity, we slightly abuse the notation and denote the rate deviation by R t ρ , ν \mathcal{R}_t^{\rho,\nu} R t ρ , ν .
Theorem 3.1. Consider using Algorithm 2 to regulate the utilization of a resource pool, where the demand and supply functions are defined by Equations 3 and 4, respectively. If the utilization rate U t > 0 U_t > 0 U t > 0 ; ∀ t \forall t ∀ t , then the rate deviation satisfies the following bound:
R t ρ , ν = O ( ρ t + ψ t ( ρ ) ) , \mathcal{R}_t^{\rho,\nu}=O\left(\rho^t+\psi_t(\rho)\right), R t ρ , ν = O ( ρ t + ψ t ( ρ ) ) , with probability at least 1 − δ 1-\delta 1 − δ , where lim sup t → ∞ ψ t ( ρ ) = ν 2 ( 1 − ρ N ) 2 ρ 2 N ln ( 1 ρ ) \limsup_{t\to\infty}\psi_t(\rho)=\dfrac{\nu^2(1-\rho^N)^2}{\rho^{2N}\ln\left(\frac{1}{\rho}\right)} lim sup t → ∞ ψ t ( ρ ) = ρ 2 N ln ( ρ 1 ) ν 2 ( 1 − ρ N ) 2 and N N N is given by:
N = Θ ( ln 1 / δ ln min t ( diam ( P t b + P t l ) ) ) . N=\Theta\left(\frac{\ln1/\delta}{\ln\min_t\left(\operatorname{diam}(P_t^b+P_t^l)\right)}\right). N = Θ ( ln min t ( diam ( P t b + P t l ) ) ln 1/ δ ) .
Theorem 3.1 demonstrates that the deviation from the optimal interest rate consists of two components: a time-dependent term, which diminishes exponentially over time after changes in the demand and supply function parameters, and a persistent bias term, which remains as long as ρ < 1 \rho< 1 ρ < 1 . This theorem highlights the tradeoff between adaptivity and precision. While a smaller ρ \rho ρ leads to quicker convergence to a stable rate, it also results in greater bias in the steady state. By selecting ρ \rho ρ sufficiently close to 1 and allowing t t t to be sufficiently large, Rate Deviation can be made arbitrarily small. When the parameters change infrequently, a larger ρ \rho ρ is preferable for greater precision. However, when the frequency of parameter changes is high, it becomes more important to prioritize adaptivity over precision to reduce overall rate deviation.
Unlike the RLS-based algorithm, the static interest rate curve cannot adapt to changes in demand and supply functions. This lack of adaptability means that whenever a b a^{b} a b , b b b^{b} b b , a l a^{l} a l , or b l b^{l} b l change, the interest rate set by the static curve has a persistent non decaying and non controllable bias compared to the optimal rate.
Theorem 3.2. Consider the baseline interest rate controller given by Equation (7) . If demand follows Equation (3) with a b > 0 a^{b} > 0 a b > 0 and supply is fixed at L L L , then the rate deviation R t P , ν \mathcal{R}^{P,\nu}_{t} R t P , ν is 0 if and only if
Δ : = ∣ R s l o p e 1 − b b − L U ∗ a b ∣ = 0 \Delta:= \left|R_{\mathrm{slope1}} - \frac{b^{b}-L U^{*}}{a^{b}}\right| = 0 Δ := R slope1 − a b b b − L U ∗ = 0 otherwise:
R t P , ν ≥ Δ 1 + a b L ⋅ max { R s l o p e 1 U ∗ , R s l o p e 2 1 − U ∗ } \mathcal{R}^{P,\nu}_{t} \geq\frac{\Delta}{1+\frac{a^{b}}{L}\cdot\max\left\{\frac{R_{\mathrm{slope1}}}{U^{*}},\frac{R_{\mathrm{slope2}}}{1-U^{*}}\right\}} R t P , ν ≥ 1 + L a b ⋅ max { U ∗ R slope1 , 1 − U ∗ R slope2 } Δ
Theorem 3.2 highlights two key points: 1) The Rate Deviation of a static interest rate curve does not decrease over time after changes in the demand and supply parameters. 2) There is no automatic mechanism to control the Rate Deviation hence R s l o p e 1 R_{\mathrm{slope1}} R slope1 must be manually adjusted each time the parameters change. Without this adjustment, P \mathcal{P} P will experience a persistent error.
Adapting the forgetting factor The forgetting factor plays a crucial role in determining how quickly the RLS estimator reacts to changes in the underlying parameters. An optimally tuned ρ ( t ) \rho(t) ρ ( t ) ensures higher stability and precision when parameters change slowly, while providing traceability when they change rapidly. Paleologu et al. [36 ] propose a method to adapt the forgetting factor based on the variance of the a posterior error, defined as ε t : = ( y t − x t T θ ^ t ) 2 \varepsilon_t := (y_t-\mathbf{x}_t^{T}\hat{\boldsymbol{\theta}}_t)^2 ε t := ( y t − x t T θ ^ t ) 2 . They argue that for a perfectly tuned filter, the error variance is determined solely by the observation noise i.e., Var ( ε t ) = σ ^ ( t ) \operatorname{Var}(\varepsilon_t)=\hat{\sigma}(t) Var ( ε t ) = σ ^ ( t ) , where σ ^ ( t ) \hat{\sigma}(t) σ ^ ( t ) is the estimated noise variance. Using this relationship and the RLS update rules, the following expression for the adaptive forgetting factor is derived: ρ ( t ) = min { σ ^ q ( t ) σ ^ ( t ) ∣ ξ + ε ( t ) − σ ^ ( t ) ∣ , λ max } \rho(t)=\min\left\{\frac{\hat{\sigma}_{q}(t)\hat{\sigma}(t)}{\left|\xi+\varepsilon(t)-\hat{\sigma}(t)\right|},\lambda_{\max}\right\} ρ ( t ) = min { ∣ ξ + ε ( t ) − σ ^ ( t ) ∣ σ ^ q ( t ) σ ^ ( t ) , λ m a x } , where q t : = x t T P t − 1 x t q_t:=\mathbf{x}_t^{T}P_{t-1}\mathbf{x}_t q t := x t T P t − 1 x t and e t : = ( y t − x t T θ ^ t ) 2 e_t:=(y_t-\mathbf{x}_t^{T}\hat{\boldsymbol{\theta}}_t)^2 e t := ( y t − x t T θ ^ t ) 2 (the a priori error), and σ ^ q ( t ) \hat{\sigma}_{q}(t) σ ^ q ( t ) , σ ^ e ( t ) \hat{\sigma}_{e}(t) σ ^ e ( t ) are their respective empirical variances. To estimate σ ^ 2 ( t ) \hat{\sigma}^{2}(t) σ ^ 2 ( t ) , the noise variance, a longer period of the a priori error signal e ( t ) e(t) e ( t ) is used through an exponentially weighted moving average:
σ ^ 2 ( t ) = β σ ^ 2 ( t − 1 ) + ( 1 − β ) e 2 ( t ) . \hat{\sigma}^{2}(t)=\beta\hat{\sigma}^{2}(t-1)+(1-\beta)e^{2}(t). σ ^ 2 ( t ) = β σ ^ 2 ( t − 1 ) + ( 1 − β ) e 2 ( t ) .
Risk parameters
Bounding default and liquidation Beyond stabilizing interest rates to maintain utilization or maximize revenue, the protocol also aims to minimize defaults and liquidations. We analyze the conditions needed to ensure near-zero expected defaults and liquidations.
Lemma 3.3. The expected default and liquidation at time t + 1 t+1 t + 1 , given the liquidation threshold L T t LT_t L T t and the loan-to-value ratio c t c_t c t at time t t t , are bounded by the following conditions:
E [ r ^ t i ( p t + 1 ) ] ≤ Φ ( log ( L T t ) − μ σ ) − exp ( σ 2 2 + μ ) / L T t ⋅ Φ ( − μ + log ( L T t ) − σ 2 σ ) \mathbb{E}\left[\hat{r}^{i}_{t}(p_{t+1})\right]\leq\Phi\left(\frac{\log(LT_t)-\mu}{\sigma}\right)-\exp\left(\frac{\sigma^{2}}{2}+\mu\right)/LT_t\cdot\Phi\left(\frac{-\mu+\log(LT_t)-\sigma^{2}}{\sigma}\right) E [ r ^ t i ( p t + 1 ) ] ≤ Φ ( σ log ( L T t ) − μ ) − exp ( 2 σ 2 + μ ) / L T t ⋅ Φ ( σ − μ + log ( L T t ) − σ 2 )
E [ λ t i ( p t + 1 ) ] = 1 1 − L T t ( Φ ( ln ( c t L T t ) − μ + σ 2 σ ) − L T t c t e μ + σ 2 Φ ( ln ( c t L T t ) − μ − σ 2 σ ) ) E[\lambda_t^i(p_{t+1})] = \frac{1}{1-LT_t}\left(\Phi\left(\frac{\ln\left(\frac{c_t}{LT_t}\right)-\mu+\sigma^2}{\sigma}\right)-\frac{LT_t}{c_t}e^{\mu+\sigma^2}\Phi\left(\frac{\ln\left(\frac{c_t}{LT_t}\right)-\mu-\sigma^2}{\sigma}\right)\right) E [ λ t i ( p t + 1 )] = 1 − L T t 1 Φ σ ln ( L T t c t ) − μ + σ 2 − c t L T t e μ + σ 2 Φ σ ln ( L T t c t ) − μ − σ 2
where Φ \Phi Φ is the cumulative distribution function of the standard normal distribution and μ , σ \mu, \sigma μ , σ are the price distribution parameters as outlined in 1.
Intuitively, the lemma presented above provides a method for adjusting the liquidation threshold L T t LT_t L T t and the collateral factor c t c_t c t to minimize these risks. By setting L T t LT_t L T t appropriately, the protocol can keep expected defaults below a threshold, while also ensuring that liquidations remain below a certain threshold. The relationship between the loan-to-value ratio and the liquidation threshold is key for dynamically adjusting risk parameters. This approach is based on [6 ] , where L T t LT_t L T t serves as an upper bound for the loan-to-value ratio, helping to limit the likelihood of default.
Adversarial analysis
In this section, we analyze the impact of strategic borrowers and lenders who aim to manipulate the interest rate for their own profit. We focus on two types of controllers: an abstract learning-based interest rate controller, which includes the RLS algorithm as an instance, and a static curve-based approach.
Learning-based interest rate controller
Learning-based interest rate controllers estimate demand and supply while incorporating prior beliefs to set optimal rates. As adaptivity increases, these controllers become more vulnerable to manipulation, quickly updating beliefs based on a few manipulated samples. To quantify this impact, we analyze an adaptive learning-based algorithm, LC, which alternates between exploration and exploitation phases. During exploration, the controller detects discrepancies between observed and expected demand and supply, testing various rates to update its beliefs. Once stabilized, the controller enters exploitation, setting rates based on the learned functions. This cycle repeats as new changes are detected. We model LC as an auction-like mechanism. In exploration, borrowers and lenders report their minimum (or maximum) acceptable rates and quantities. LC infers the demand and supply curves from this data. In exploitation, it sets a single rate r t r_t r t , allowing lenders with bids r t r_t r t or lower to deposit, and borrowers with bids r t r_t r t or higher to receive loans. This mimics a uniform price auction, where participants’ reported bids influence the interest rate, maximizing utility based on private valuations. Participant utility depends on whether the rate falls within their acceptable range and the portion of their supply or demand allocated to the protocol or external markets. More details on this auction implementation are provided in Appendix [B.5].
This auction is considered truthful if strategic borrowers and lenders prefer to report their true external rates, yielding the true demand and supply curves.
Proposition 4.1. If all the lenders or borrower are infinitesimal i.e., L t ( i ) L t ≈ 0 ∀ i ∈ Lenders \frac{L_t(i)}{L_t} \approx0\ \forall i \in\text{Lenders} L t L t ( i ) ≈ 0 ∀ i ∈ Lenders and B t ( i ) B t ≈ 0 ∀ i ∈ Borrowers \frac{B_t(i)}{B_t} \approx0\ \forall i \in\text{Borrowers} B t B t ( i ) ≈ 0 ∀ i ∈ Borrowers then LC mechanism is truthful. However, in the general case where borrowers and lenders are non infinitesimal, the mechanism is not necessarily truthful.
When each user (borrower or lender) is infinitesimal, their individual supply or demand has no impact on the resulting interest rate r t r_t r t . Consequently, their bidding strategy does not influence the price they pay or receive and they are incentivized to report their true valuation. However, in general cases, the situation changes. For example, when lenders are inelastic and the supply is fixed, with only borrowers participating, the auction reduces to a multi-unit demand auction with a uniform price, which is known to be non-truthful and susceptible to demand reduction [1 , 20 ] . The VCG (Vickrey-Clarke-Groves) auction is known to be truthful in this context; however, it assigns different prices to different participants, which is not feasible in a peer-to-pool-to-peer setting. However, a peer-to-peer protocol can be attached on top of a pool, subject to constraint on the peer-to-peer contracting (e.g. Morpho protocol [31 ] ). But whether a VCG-like truthful mechanism can be implemented using Morpho is an open question and beyond the scope of our work.
Theorem 4.2. Consider an LC interest rate controller and the following setting:
Non-strategic borrowers with a demand function of the form − a b r + b b ( 1 − δ b ) -a^{b}r+b^{b}(1-\delta_{b}) − a b r + b b ( 1 − δ b ) , and a major strategic borrower denoted by A b \mathcal{A}^{b} A b with demand b b δ b b^{b}\delta_{b} b b δ b and private valuation r b r^{b} r b , satisfying δ b < 1 − a b r b b b \delta_{b}<1-\frac{a^{b}r^{b}}{b^{b}} δ b < 1 − b b a b r b .
Non-elastic, non-strategic lenders controlling a supply of L ( 1 − δ l ) L(1-\delta_{l}) L ( 1 − δ l ) , and a major strategic lender denoted by A l \mathcal{A}^{l} A l controlling a supply of L δ l L\delta_{l} L δ l with private valuation r l r^{l} r l .
Then:
A I P ( δ b , δ l ) ≤ max { b b δ l 2 a b , U ∗ δ l L a b ( 2 − δ l ) } . AI^{\mathcal{P}}(\delta_{b},\delta_{l})\leq\max\left\{\frac{b^{b}\delta_{l}}{2a^{b}},\frac{U^{*}\delta_{l}L}{a^{b}(2-\delta_{l})}\right\}. A I P ( δ b , δ l ) ≤ max { 2 a b b b δ l , a b ( 2 − δ l ) U ∗ δ l L } .
The key idea behind the proof is as follows: a dominant strategic borrower can deliberately submit a very low interest rate bid, r ^ b \hat{r}^{b} r ^ b , forcing the protocol to adopt this rate in order to achieve the desired utilization level. However, as other borrowers are more elastic (i.e., a b a^{b} a b is larger), they become more attracted to the system at these lower rates, offsetting the strategic borrower’s influence. Therefore, when other borrowers are highly elastic, the strategic borrower cannot push the rate too low. For a strategic lender, the analysis is analogous in a symmetric way. It is worth noting that even in the presence of strategic players, LC still manages to set the closest possible utilization to U ∗ U^{*} U ∗ however with a different interest rate compared to as if the users were truthful. The key takeaway is that the elasticity of truthful users plays a crucial role in the adversary’s impact on LC. If all truthful players are inelastic, the Adversarial Impact can become unbounded.
Static interest rate curves
Unlike adaptive algorithms, which are vulnerable during the learning phase, static curves are memoryless, reducing the scope for adversarial manipulation. However, strategic users can still exploit their knowledge of the fixed curve’s structure. We identify a tactic called strategic withholding , where lenders supply less than their full capacity to raise the utilization rate, thus increasing the pool’s interest rate and boosting their returns. Similarly, borrowers might borrow less than their maximum capacity to lower their overall interest costs by fulfilling the remaining demand externally. This strategy was first introduced by [44 ] .
We derive a closed-form expression for the rate manipulation caused by strategic withholding, assuming other participants are truthful and inelastic to interest rate changes. Inelastic participants simplify the problem for adversaries, as elastic participants would adjust their behavior by depositing more or borrowing less, which could limit manipulation.
Let a strategic borrower A b \mathcal{A}^{b} A b , with external rate r b r^{b} r b , control δ b \delta_{b} δ b of the total demand B B B , and a strategic lender A l \mathcal{A}^{l} A l , with external rate r l r^{l} r l , control δ l \delta_{l} δ l of the total supply L L L . Both aim to maximize their utility by adjusting how much they participate in the pool. The full utility functions for strategic borrowers and lenders are provided in Appendix § 10 .§ 6 .
We now present the Adversarial Impact caused by strategic users through the strategic withholding strategy.
Theorem 4.3. Given the static curve described in [7 ] , with fixed truthful demand ( 1 − δ b ) B (1-\delta_{b})B ( 1 − δ b ) B and fixed truthful supply ( 1 − δ l ) L (1-\delta_{l})L ( 1 − δ l ) L , and the remaining demand δ b B \delta_{b}B δ b B and supply δ l L \delta_{l}L δ l L controlled by strategic
borrowers and lenders, the Adversarial Impact is bounded by:
A I P ( δ b , δ l ) ≤ max { B δ b R s l o p e 2 L ( 1 − U ∗ ) , B δ l R s l o p e 2 L ( 1 − δ l ) ( 1 − U ∗ ) } (13) AI^{P}(\delta_b,\delta_l) \le\max\left\{ \frac{B\delta_b R_{\mathrm{slope2}}}{L(1-U^*)}, \frac{B\delta_l R_{\mathrm{slope2}}}{L(1-\delta_l)(1-U^*)} \right\} \tag*{(13)} A I P ( δ b , δ l ) ≤ max { L ( 1 − U ∗ ) B δ b R slope2 , L ( 1 − δ l ) ( 1 − U ∗ ) B δ l R slope2 } (13)
The intuition behind the proof is to maximize the adversary’s utility and determine the worst-case rate manipulation possible compared to their truthful behavior. Static curves limit adversarial manipulation, as their impact is bounded even with inelastic truthful users. Notably, while R s l o p e 1 R_{\mathrm{slope1}} R slope1 does not affect adversarial robustness, R s l o p e 2 R_{\mathrm{slope2}} R slope2 significantly influences the likelihood of strategic withholding attacks.
Mitigating the effects of manipulation
Ecosystem modification
In Theorem 4.2 , we showed that an adaptive interest rate in lending pools is vulnerable to adversarial manipulation via strategic withholding. The core issue arises from the delayed response of liquidity demand (or supply) to deviations from the norm, where elasticity plays a crucial role in mitigating such manipulation. Higher elasticity ensures that observed demand better reflects true market demand, reducing manipulation risks. To enhance elasticity, lending pool designers can increase exposure to alternative trading venues, deploy pools across multiple blockchain platforms with robust cross-chain bridges, and foster arbitrage opportunities. Additionally, deep derivatives markets for interest rates, such as those enabled by yield tokenization (e.g., Pendle [21 ] ), fixed-rate lending (e.g., IPOR [8 ] ), and futures markets (e.g., Timeswap [35 ] ), can help sophisticated traders assess fair interest rates and respond accordingly. By allowing speculators and arbitrageurs to act on discrepancies between expected and actual rates, these mechanisms increase demand and supply elasticity, making lending protocols more resilient. A transparent valuation model for such derivatives remains an open problem and is left for future research.
Algorithmic mitigation
To address adversarial manipulation of the demand and supply functions, we propose a robust version of the RLS algorithm where the adaptive controller evaluates the plausibility of incoming data by comparing it to prior estimations of system dynamics. Data points that deviate significantly from expected patterns are given a lower weights in estimating the demand and supply functions. In particular, we employ the outlier-robust recursive least squares (RLS) estimator with a forgetting factor, as introduced in [29 , 46 ] . This robust estimator minimizes the following modified loss function, an alternative to the standard RLS loss function with a forgetting factor in Equation (10) :
J t ( θ ) = ∑ τ = 0 t ρ t − τ ϕ ( ( y τ − x τ T θ ) 2 ) , (14) J_t(\theta) = \sum_{\tau=0}^{t} \rho^{t-\tau}\phi\left((y_\tau-x_\tau^{T}\theta)^2\right), \tag*{(14)} J t ( θ ) = τ = 0 ∑ t ρ t − τ ϕ ( ( y τ − x τ T θ ) 2 ) , (14)
where ϕ ( . ) \phi(.) ϕ ( . ) is the M-estimate function. The M-estimate function is a redescending function, meaning its derivative decreases to zero as the residual e e e becomes very large. Refer to Appendix § 10 .8 for the description of the M-estimate function we adopt. Zou et al. show that minimizing the robust loss function in Equation (14) results in a recursive algorithm similar to the standard RLS with forgetting factor, except that the gain is updated as: K t = q ( e t ) P t − 1 x t ρ + q ( e t ) x t T P t − 1 x t K_t = \frac{q(e_t)P_{t-1}x_t}{\rho+q(e_t)x_t^{T}P_{t-1}x_t} K t = ρ + q ( e t ) x t T P t − 1 x t q ( e t ) P t − 1 x t , where e t : = ( y t − x t T θ ^ t − 1 ) 2 e_t := (y_t-x_t^{T}\hat{\theta}_{t-1})^2 e t := ( y t − x t T θ ^ t − 1 ) 2 and q ( e ) : = d ϕ ( e ) d e / e q(e) := \frac{d\phi(e)}{de}/e q ( e ) := d e d ϕ ( e ) / e .
Evaluation
Empirical validation of demand and supply models:
We applied our RLS-based algorithm to demand and supply data from Compound market pools, analyzing the relationship between interest rates and the demand and supply curves in 3-hour intervals. Specifically, we fitted the data (Feb 2024 - Feb 2025, RLS with ρ = 0.95 \rho= 0.95 ρ = 0.95 ) to our demand and supply models (Equations (9) and (8) ) and estimated the parameters a t b a_t^b a t b , b t b b_t^b b t b , a t l a_t^l a t l , and b t l b_t^l b t l over time. To evaluate the accuracy of these parameter estimates, we predicted demand and supply for the next timeslot and summarized the prediction errors in Table 1 . The relatively low error across the three main pools demonstrates the effectiveness of our model and methodology. More details about our experiment are provided in the Appendix § 11 .§ 1 .
Table 1. Normalized error of Compound demand and supply estimates from Feb 2024 - Feb 2025.
Figure 1. (a) Robust RLS achieves near-zero rate deviation even at extreme (σ a t t a c k \sigma_{\mathrm{attack}} σ attack ).
Figure 2. (b) Impact of transition noise on average utilization error for RLS and Aave controllers.
Interest rate controller
To evaluate our interest rate controller, we analyze two demand-supply models: one based on real-world Compound data (§ 5.1 ) and another using synthetic parameter trajectories. The latter follows a Gaussian random walk, where each parameter (a t b a_t^b a t b , b t b b_t^b b t b , a t l a_t^l a t l , b t l b_t^l b t l ) evolves every T T T steps as a t + T b = a t b + ϵ t a_{t+T}^b = a_t^b + \epsilon_t a t + T b = a t b + ϵ t , with ϵ t ∼ N ( 0 , σ t r n s ⋅ ∣ a t b ∣ ) \epsilon_t \sim N(0, \sigma_{\mathrm{trns}} \cdot|a_t^b|) ϵ t ∼ N ( 0 , σ trns ⋅ ∣ a t b ∣ ) . Demand and supply are then generated using Equations (8) and (9) , incorporating normally distributed noise (σ n o i s e \sigma_{\mathrm{noise}} σ noise ).
Utilization error We evaluate our RLS-based controller against Compound’s static interest rate curves tuned for optimal utilization of 0.8. Using Compound’s data (Feb 2024–Feb 2025), we infer a t b a_t^b a t b , b t b b_t^b b t b , a t l a_t^l a t l , b t l b_t^l b t l to simulate user behavior. Our controller achieves significantly lower utilization mean squared error (MSE) across all pools (Table 2 ). We use ρ = 0.85 \rho= 0.85 ρ = 0.85 . To assess robustness, we test synthetic data. As σ t r n s \sigma_{\mathrm{trns}} σ trns increases, inducing greater demand-supply fluctuations, our controller incurs more errors but consistently outperforms the Aave/Compound static approach (Figure 2b). For details, see Appendix § 11 .§ 2 .
Table 2. Utilization MSE comparison for RLS-based controller and Compound Static Curve.
Variable Forgetting Factor This experiment evaluates the impact of different forgetting factors on demand estimation under varying parameter evolution rates (a t b a_t^b a t b , b t b b_t^b b t b ) and examines whether the adaptive forgetting factor outperforms RLS with a fixed forgetting factor. We consider transition noise levels σ t r n s = 0.1 \sigma_{\mathrm{trns}} = 0.1 σ trns = 0.1 , 0.2 0.2 0.2 , and 0.4 0.4 0.4 . As shown in Table 3 , the optimal fixed forgetting factor decreases with increasing noise: ρ = 0.99 \rho= 0.99 ρ = 0.99 performs best at σ t r n s = 0.1 \sigma_{\mathrm{trns}} = 0.1 σ trns = 0.1 , while ρ = 0.9 \rho= 0.9 ρ = 0.9 and ρ = 0.85 \rho= 0.85 ρ = 0.85 yield lower errors at σ t r n s = 0.2 \sigma_{\mathrm{trns}} = 0.2 σ trns = 0.2 and 0.4 0.4 0.4 , respectively. However, the adaptive forgetting factor consistently achieves the lowest error across all cases.
Table 3. RMSE of estimated demand function by RLS for different transition noises and forgetting factors.
Robust RLS We assess the robustness of robust RLS against adversarial demand and supply manipulation. The metric of interest is the normalized rate deviation , measuring deviation from the optimal rate for U ∗ = 0.7 U^* = 0.7 U ∗ = 0.7 . Two attack strategies are considered. The first is an intermittent adversary , which randomly activates with probability 0.1, increasing the demand and supply noise variance up to σ a t t a c k \sigma_{\mathrm{attack}} σ attack (20%–300% of demand or supply). As shown in Figure 2a, plain RLS exhibits sharp deviation growth, whereas robust RLS maintains near-zero deviation. The second strategy simulates a persistent adversarial borrower who inflates a t b a_t^b a t b by γ a d v \gamma_{\mathrm{adv}} γ adv to exaggerate demand sensitivity, tricking the protocol into setting lower rates. With T a t t a c k = 100 T_{\mathrm{attack}} = 100 T attack = 100 and γ a d v ∈ { 2 , 5 , 10 , 20 } \gamma_{\mathrm{adv}} \in\{2, 5, 10, 20\} γ adv ∈ { 2 , 5 , 10 , 20 } , plain RLS suffers a normalized rate deviation of up to 3.13, meaning the rate reaches 3.13 times its optimal value. Robust RLS keeps it below 0.5, demonstrating resilience.
Risk controller
Figure 5 shows our risk controller adjusting the collateral factor to liquidation threshold ratio as Ethereum’s volatility changes. The goal is to maintain an average liquidation rate of 1% (orange) or 0.1% (blue), with a fixed liquidation threshold of L T t = 0.9 LT_t = 0.9 L T t = 0.9 . The controller lowers the collateral factor during high volatility to prompt borrowers to add collateral and avoid liquidation.
Figure 5. ETH volatility over time, with the controller dynamically adjusting the collateral factor. The bottom plot compares the actual liquidations resulting from this adjusted collateral factor with the target expected liquidations, L T t = 0.9 L T_t = 0.9 L T t = 0.9 .
Conclusion
Adaptivity and robustness In this work, we introduced a model of non-stationary borrower and lender behavior that aligns with empirical data, along with an interest rate controller designed to maintain stability under dynamic market conditions. We also characterized the protocol’s responsiveness to market changes and analyzed the limits of this adaptivity when facing adversarial manipulation. We suggested solutions to reduce adversarial manipulation.
Limitations and future work Our model has three key limitations, suggesting directions for future work. First, it assumes lending does not impact collateral prices, which may not hold for low-liquidity assets. Second, it considers only a single lent-collateral pair, whereas a broader model would account for multiple assets with correlated price and volatility movements. Third, we focus on Compound-style pools, where collateral remains idle, unlike Aave’s cross-asset model, which generates yield but adds complexity to the risk analysis of the protocol. Due to these risk management challenges, Compound opts for a simpler design, which we also adopt in our analysis [25 ] . Finally, leveraging neural networks and deep reinforcement learning could enhance user modeling and protocol design. However, their computational inefficiency hinders on-chain use, even with rollups, and their lack of interpretability challenges financial transparency. Developing efficient, interpretable algorithms remains an open problem.
Acknowledgment
This work was supported by the National Science Foundation via grants CCF-1705007, CNS-2325477, the Army Research Office via grant W911NF2310147, a grant from C3.AI and a gift from XinFin Private Limited.
References
Details for our algorithms
In this section, we detail the algorithms we use in Section 3.1.
Supplementary explanations about the model and the results
Related work
Collateralized lending in traditional finance Collateralized lending has been extensively studied in traditional finance, where the main challenge is information asymmetry between borrowers and lenders, leading to issues like moral hazard and credit rationing [11 , 42 ] . In contrast, DeFi platforms
Algorithm 1 Estimating the demand and supply curve using RLS with forgetting factor
Initialize: θ ^ 0 l \hat{\boldsymbol{\theta}}_0^l θ ^ 0 l , θ ^ 0 b \hat{\boldsymbol{\theta}}_0^b θ ^ 0 b , P 0 l \mathbf{P}_0^l P 0 l , P 0 b ← \mathbf{P}_0^b \leftarrow P 0 b ← large positive definite matrix, ρ \rho ρ (forgetting factor), ν \nu ν noise standard deviation
for each time step t t t do
Observe r t − 1 , U t − 1 r_{t-1}, U_{t-1} r t − 1 , U t − 1 and L t , B t L_t, B_t L t , B t ; And set x t b = [ r t − 1 , 1 ] T \mathbf{x}_t^b = [r_{t-1},1]^{\mathsf{T}} x t b = [ r t − 1 , 1 ] T , x t l = [ r t − 1 U t − 1 , 1 ] T \mathbf{x}_t^l = [r_{t-1}U_{t-1},1]^{\mathsf{T}} x t l = [ r t − 1 U t − 1 , 1 ] T
Compute the gain vector for the supply and demand observation:
K t l = P t − 1 l x t l ( ρ + ( x t l ) T P t − 1 l x t l ) , K t b = P t − 1 b x t b ( ρ + ( x t b ) T P t − 1 b x t b ) \mathbf{K}_t^l = \frac{\mathbf{P}_{t-1}^l\mathbf{x}_t^l}{\left(\rho+ (\mathbf{x}_t^l)^{\mathsf{T}}\mathbf{P}_{t-1}^l\mathbf{x}_t^l\right)}, \qquad\mathbf{K}_t^b = \frac{\mathbf{P}_{t-1}^b\mathbf{x}_t^b}{\left(\rho+ (\mathbf{x}_t^b)^{\mathsf{T}}\mathbf{P}_{t-1}^b\mathbf{x}_t^b\right)} K t l = ( ρ + ( x t l ) T P t − 1 l x t l ) P t − 1 l x t l , K t b = ( ρ + ( x t b ) T P t − 1 b x t b ) P t − 1 b x t b
Update the parameter estimate:
θ ^ t l = θ ^ t − 1 l + K t l ( L t − ( x t l ) T θ ^ t − 1 l ) , θ ^ t b = θ ^ t − 1 b + K t b ( B t − ( x t b ) T θ ^ t − 1 b ) \hat{\boldsymbol{\theta}}_t^l = \hat{\boldsymbol{\theta}}_{t-1}^l + \mathbf{K}_t^l\left(L_t - (\mathbf{x}_t^l)^{\mathsf{T}}\hat{\boldsymbol{\theta}}_{t-1}^l\right), \qquad\hat{\boldsymbol{\theta}}_t^b = \hat{\boldsymbol{\theta}}_{t-1}^b + \mathbf{K}_t^b\left(B_t - (\mathbf{x}_t^b)^{\mathsf{T}}\hat{\boldsymbol{\theta}}_{t-1}^b\right) θ ^ t l = θ ^ t − 1 l + K t l ( L t − ( x t l ) T θ ^ t − 1 l ) , θ ^ t b = θ ^ t − 1 b + K t b ( B t − ( x t b ) T θ ^ t − 1 b )
Update the covariance matrix:
P t l = 1 ρ ( I − K t l ( x t l ) T ) P t − 1 l , P t b = 1 ρ ( I − K t b ( x t b ) T ) P t − 1 b \mathbf{P}_t^l = \frac{1}{\rho}\left(\mathbf{I} - \mathbf{K}_t^l(\mathbf{x}_t^l)^{\mathsf{T}}\right)\mathbf{P}_{t-1}^l, \qquad\mathbf{P}_t^b = \frac{1}{\rho}\left(\mathbf{I} - \mathbf{K}_t^b(\mathbf{x}_t^b)^{\mathsf{T}}\right)\mathbf{P}_{t-1}^b P t l = ρ 1 ( I − K t l ( x t l ) T ) P t − 1 l , P t b = ρ 1 ( I − K t b ( x t b ) T ) P t − 1 b
Parse [ a ^ t l , − b ^ t l ] ← θ ^ t l [\hat{a}_t^l,-\hat{b}_t^l] \leftarrow\hat{\boldsymbol{\theta}}_t^l [ a ^ t l , − b ^ t l ] ← θ ^ t l and [ − a ^ t b , b ^ t b ] ← θ ^ t b [-\hat{a}_t^b,\hat{b}_t^b] \leftarrow\hat{\boldsymbol{\theta}}_t^b [ − a ^ t b , b ^ t b ] ← θ ^ t b
end
Algorithm 2 Setting the optimal interest rate to achieve desired utilization
Initialize: U ∗ U^* U ∗ , ζ \zeta ζ (randomness probability), ξ \xi ξ (error threshold to do randomization)
for each time step t t t do
Read a ^ t b , b ^ t b , a ^ t l , b ^ t l , P t l , P t b \hat{a}_t^b,\hat{b}_t^b,\hat{a}_t^l,\hat{b}_t^l,\mathbf{P}_t^l,\mathbf{P}_t^b a ^ t b , b ^ t b , a ^ t l , b ^ t l , P t l , P t b from Algorithm 1
Var ( a ^ t b ) ← P t b ( 1 , 1 ) \operatorname{Var}(\hat{a}_t^b) \leftarrow\mathbf{P}_t^b(1,1) Var ( a ^ t b ) ← P t b ( 1 , 1 ) , Var ( b ^ t b ) ← P t b ( 2 , 2 ) \operatorname{Var}(\hat{b}_t^b) \leftarrow\mathbf{P}_t^b(2,2) Var ( b ^ t b ) ← P t b ( 2 , 2 ) , Var ( a ^ t l ) ← P t l ( 1 , 1 ) \operatorname{Var}(\hat{a}_t^l) \leftarrow\mathbf{P}_t^l(1,1) Var ( a ^ t l ) ← P t l ( 1 , 1 ) , Var ( b ^ t l ) ← P t l ( 2 , 2 ) \operatorname{Var}(\hat{b}_t^l) \leftarrow\mathbf{P}_t^l(2,2) Var ( b ^ t l ) ← P t l ( 2 , 2 )
E [ r t ] ← b ^ t b + b ^ t l U ∗ a ^ t b + a ^ t l ( U ∗ ) 2 \mathbb{E}[r_t] \leftarrow\frac{\hat{b}_t^b+\hat{b}_t^lU^*}{\hat{a}_t^b+\hat{a}_t^l(U^*)^2} E [ r t ] ← a ^ t b + a ^ t l ( U ∗ ) 2 b ^ t b + b ^ t l U ∗
Var ( r t ) ← ( b ^ t b + b ^ t l U ∗ ) 2 ( a ^ t b + a ^ t l ( U ∗ ) 2 ) 2 ( Var ( b ^ t b ) + ( U ∗ ) 2 Var ( b ^ t l ) ) + ( b ^ t b + b ^ t l U ∗ ) 2 ( a ^ t b + a ^ t l ( U ∗ ) 2 ) 4 ( Var ( a ^ t b ) + ( U ∗ ) 4 Var ( a ^ t l ) ) \operatorname{Var}(r_t) \leftarrow\frac{(\hat{b}_t^b+\hat{b}_t^lU^*)^2}{(\hat{a}_t^b+\hat{a}_t^l(U^*)^2)^2}\left(\operatorname{Var}(\hat{b}_t^b)+(U^*)^2\operatorname{Var}(\hat{b}_t^l)\right)
+\frac{(\hat{b}_t^b+\hat{b}_t^lU^*)^2}{(\hat{a}_t^b+\hat{a}_t^l(U^*)^2)^4}\left(\operatorname{Var}(\hat{a}_t^b)+(U^*)^4\operatorname{Var}(\hat{a}_t^l)\right) Var ( r t ) ← ( a ^ t b + a ^ t l ( U ∗ ) 2 ) 2 ( b ^ t b + b ^ t l U ∗ ) 2 ( Var ( b ^ t b ) + ( U ∗ ) 2 Var ( b ^ t l ) ) + ( a ^ t b + a ^ t l ( U ∗ ) 2 ) 4 ( b ^ t b + b ^ t l U ∗ ) 2 ( Var ( a ^ t b ) + ( U ∗ ) 4 Var ( a ^ t l ) )
Sample r t ∼ N ( E [ r t ] , Var [ r t ] ) r_t \sim\mathcal{N}(\mathbb{E}[r_t],\operatorname{Var}[r_t]) r t ∼ N ( E [ r t ] , Var [ r t ])
end
benefit from shared access to crypto price history, allowing for more transparent, algorithmic risk assessment. The key challenge in DeFi borrow-lending is determining a fair, adaptive interest rate in a rapidly changing, competitive environment, unlike traditional finance where rates change infrequently and competition is limited.
Collateralized lending in decentralized finance and adaptive protocols Various models have explored lender and borrower behavior in DeFi, focusing on interest rate equilibria and protocol efficiency. Some models propose equilibrium-based rates but overlook external markets and default risk strategies [16 ] . Others consider external market dynamics but lack focus on long-term decisions and liquidation risks [38 ] . Nash equilibrium studies highlight how protocol-driven prices can cause oscillations and require contract adjustments [14 ] . Empirical data has helped refine models of user behavior [23 , 24 , 39 ] , and adversarial risks to DeFi protocols have been examined, exposing vulnerabilities [10 , 13 , 15 ] . Recent work on adaptive financial mechanisms addresses impermanent loss and arbitrage in market makers [22 , 30 , 33 , 34 , 45 ] . Strategic behavior exploiting static rate curves has also been identified [44 ] . Protocols like Morpho [31 ] and Ajna [5 ] support adaptive rate discovery but require continuous monitoring. Our work is closest to [6 ] which proposes a two-timescale adaptive lending protocol. However, it uses a simplistic model of user behaviour and only considers shortsighted adversaries. While [6 ] focuses on a specific demand-supply dynamic yielding a single equilibrium rate, we use a simpler linear demand and supply model with varying parameters, supported by empirical data. This allows for a range of possible equilibrium rates, enabling the protocol to select the one that best achieves the desired utilization.
Explicit definition of various objectives
Demand-supply balancing
In decentralized finance (DeFi) platforms, maintaining an optimal balance between supply and demand is crucial, and a key metric for balance is the platform’s proximity to the target utilization rate, U ∗ U^{*} U ∗ [23 , 24 ] . Low utilization indicates that deposited supply is not being efficiently utilized, while high utilization negatively impacts user experience, as it restricts lenders from withdrawing their funds, effectively locking them up.
To assess the effectiveness of a protocol P \mathcal{P} P in achieving optimal utilization, we define the optimal interest rate and measure the deviation of the protocol’s interest rate from this target. Specifically, we consider a pool where demand and supply are modeled as noisy versions of f ( r ; B t ) f(r;\mathcal{B}_{t}) f ( r ; B t ) and g ( r e f f ; L t ) g(r_{\mathrm{eff}};\mathcal{L}_{t}) g ( r eff ; L t ) , respectively with a Gaussian noise with standard deviation ν \nu ν . At time t 0 t_{0} t 0 , the pool variables B t \mathcal{B}_{t} B t and L t \mathcal{L}_{t} L t shift from their initial values to B 0 \mathcal{B}_{0} B 0 and L 0 \mathcal{L}_{0} L 0 , after which they remain constant. This allows the system to stabilize at a certain utilization U U U and interest rate r r r . The optimal interest rate r u t l ∗ r^{*}_{\mathrm{utl}} r utl ∗ is defined as:
r u t l ∗ : = arg min r ∣ U − U ∗ ∣ subject to U = f ( r ; B 0 ) g ( r e f f ; L 0 ) , r e f f : = U ⋅ r (15) r^{*}_{\mathrm{utl}} := \underset{r}{\arg\min}\ \lvert U-U^{*}\rvert\quad\text{subject to}\quad U=\frac{f(r;\mathcal{B}_{0})}{g(r_{\mathrm{eff}};\mathcal{L}_{0})},\quad r_{\mathrm{eff}}:=U\cdot r \tag*{(15)} r utl ∗ := r arg min ∣ U − U ∗ ∣ subject to U = g ( r eff ; L 0 ) f ( r ; B 0 ) , r eff := U ⋅ r (15)
We propose a metric called Rate Deviation denoted by R t P , ν ( U ∗ ) R^{\mathcal{P},\nu}_{t}(U^{*}) R t P , ν ( U ∗ ) to assess the P \mathcal{P} P ’s performance in maintaining U ∗ U^{*} U ∗ :
R t P , ν ( U ∗ ) : = E [ ∣ r t − r u t l ∗ ∣ ] (16) R^{\mathcal{P},\nu}_{t}(U^{*}) := \mathbb{E}\left[\left\lvert r_{t}-r^{*}_{\mathrm{utl}}\right\rvert\right] \tag*{(16)} R t P , ν ( U ∗ ) := E [ ∣ r t − r utl ∗ ∣ ] (16)
The expectation is taken over the protocol’s randomness, as well as the noise present in the users’ demand and supply. 2
Adversarial robustness
Strategic borrowers and lenders seek to manipulate the protocol’s interest rate to their advantage by exploiting the structure of the interest rate controller. They may simulate the protocol’s responses to various demand and supply scenarios, selecting the one that maximizes their own utility rather than acting truthfully. We aim to quantify how much influence these strategic users can exert on the interest rate. Specifically, we consider a lending pool governed by the protocol P \mathcal{P} P with a set of truthful users characterized by fixed demand and supply curves f ( r ; B t ) f(r;\mathcal{B}_{t}) f ( r ; B t ) and g ( r e f f ; L t ) g(r_{\mathrm{eff}};\mathcal{L}_{t}) g ( r eff ; L t ) ; Plus one strategic lender, A l \mathcal{A}^{l} A l , who has an external interest rate r l r^{l} r l and a deposit of δ l × ( max x g ( x ; L t ) ) \delta_{l}\times(\max_{x}g(x;\mathcal{L}_{t})) δ l × ( max x g ( x ; L t )) , and one strategic borrower, A b \mathcal{A}^{b} A b , with an external rate r b r^{b} r b and demand of δ b × ( max x f ( x ; B t ) ) \delta_{b}\times(\max_{x}f(x;\mathcal{B}_{t})) δ b × ( max x f ( x ; B t )) .
Let r t r u t h f u l r_{\mathrm{truthful}} r truthful and r s t r a t e g i c r_{\mathrm{strategic}} r strategic , respectively denote the steady-state interest rates set by P \mathcal{P} P if A l \mathcal{A}^{l} A l and A b \mathcal{A}^{b} A b behave truthfully versus strategically. We introduce a new metric, Adversarial Impact Deviation , to formally quantify the impact of strategic users on interest rate manipulation:
A I P ( δ b , δ l ) : = sup r b , r l E [ ∣ r t r u t h f u l − r s t r a t e g i c ∣ ] (17) AI^{\mathcal{P}}(\delta_{b},\delta_{l}) := \underset{r^{b},r^{l}}{\sup}\ \mathbb{E}\left[\left\lvert r_{\mathrm{truthful}}-r_{\mathrm{strategic}}\right\rvert\right] \tag*{(17)} A I P ( δ b , δ l ) := r b , r l sup E [ ∣ r truthful − r strategic ∣ ] (17)
Liquidation and default risk control
In a peer-to-pool-to-peer lending platform, as discussed in § 2.1 , the main risks are defaults for lenders and liquidations for borrowers. To mitigate these risks, the protocol must dynamically adjust parameters like the collateral factor c t c_t c t , liquidation threshold L T t LT_t L T t , and liquidation incentive L I t LI_t L I t in response to price volatility.
Pool defaults occur when a borrower’s debt exceeds the value of their collateral due to a price drop, making the pool unable to recover the full loan amount. Liquidation occurs when a borrower, maintaining the maximum loan-to-value ratio, faces a price drop that forces the protocol to liquidate part of their collateral to bring the ratio back below the liquidation threshold. These risks are formally defined in Appendix [§ 10 .§ 7 ], where the exact conditions for pool default and liquidation are detailed.
The protocol’s effectiveness in managing these risks can be measured using metrics like the expected value or the 95th percentile of pool defaults and liquidations, computed with respect to the price distribution.
Alternate objective for demand/supply balancing
Traditionally, balance in Defi lending has been measured by how closely the utilization rate, U t U_t U t , approaches its optimal level, U ∗ U^* U ∗ . However, this approach can be limiting, particularly in situations where supply is high and demand is low. In such cases, maintaining utilization at a preset level requires setting a very low interest rate, which discourages lenders and may ultimately undermine the system’s revenue. To address these limitations, we broaden the definition of balance beyond utilization alone. We define an optimal pool state as one characterized by specific values of L t L_t L t , B t B_t B t , and U t U_t U t , and measure how closely the protocol approaches the interest rate that best satisfies this state. One example of this objective is maximizing the combined demand and supply while keeping utilization below a safe threshold U max U_{\max} U m a x , thereby enhancing both revenue and user experience. The optimal interest rate, according to this new metric, is given by:
r r e v ∗ : = arg max r [ f ( r ; θ ) + g ( r U ; ω ) ] subject to U < U max where U = f ( r ; θ ) g ( r U ; ω ) (18) r_{\mathrm{rev}}^* := \underset{r}{\arg\max}\left[f(r;\theta)+g(rU;\omega)\right]\quad\text{subject to }U<U_{\max}\text{ where }U=\frac{f(r;\theta)}{g(rU;\omega)} \tag*{(18)} r rev ∗ := r arg max [ f ( r ; θ ) + g ( r U ; ω ) ] subject to U < U m a x where U = g ( r U ; ω ) f ( r ; θ ) (18)
We can define an interest rate deviation metric for this objective, akin to the utility-optimizing case in Equation (16) .
Optimizing interest rate to maximize revenue
Maximizing revenue can be also considered as an objective to set the interest rate, in order to do that it turns out that we need a parameter estimator exactly the same as Algorithm 1 and an optimizer similar to Algorithm 2 but the formula for the optimal rate based on the estimated parameters is given in the following theorem:
Theorem B.1. Given the user behavior models described in Equations (9) and (8) , the revenue maximization problem, as described in Equation (18) , can be formulated as follows:
max r ( − a b r + a l r U ) (19) \max_r\left(-a^b r+a^l rU\right) \tag*{(19)} r max ( − a b r + a l r U ) (19) Subject to U = b l + ( b l ) 2 − 4 a l r ( a b r − b b ) 2 a l r and U < U max \text{Subject to}\quad U=\frac{b^l+\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}}{2a^l r}\quad\text{and}\quad U<U_{\max} Subject to U = 2 a l r b l + ( b l ) 2 − 4 a l r ( a b r − b b ) and U < U m a x And its solution is:
r r e v ∗ = { b b + b l U max a b + a l ( U max ) 2 if a b b l ( 1 + 1 − 4 a b a l ) a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) ≥ U max b b + ( b b ) 2 + 4 ( a b b l ) 2 2 a b O.W. (20) r_{\mathrm{rev}}^*=
\begin{cases}
\frac{b^b+b^lU_{\max}}{a^b+a^l(U_{\max})^2}
&\text{if }\frac{a^b b^l(1+\sqrt{1-4a^b a^l})}{a^l\left(b^b+\sqrt{(b^b)^2+4(a^b b^l)^2}\right)}\geq U_{\max}\\[1.2ex]
\frac{b^b+\sqrt{(b^b)^2+4(a^b b^l)^2}}{2a^b}
&\text{O.W.}
\end{cases} \tag*{(20)} r rev ∗ = ⎩ ⎨ ⎧ a b + a l ( U m a x ) 2 b b + b l U m a x 2 a b b b + ( b b ) 2 + 4 ( a b b l ) 2 if a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) a b b l ( 1 + 1 − 4 a b a l ) ≥ U m a x O.W. (20)
Informally speaking, replacing the expected optimal rate at line 4 of Algorithm 2 with Equation (20) will result in an RLS-based revenue-maximizing rate controller, offering similar convergence guarantees as those outlined in Theorem 3.1 .
Formally, LC is implemented as follows:
In the exploration phase, each borrower i i i privately reports a demand quantity B ^ t ( i ) \hat{B}_t(i) B ^ t ( i ) along with the maximum interest rate they are willing to pay as their bid r ^ t b ( i ) \hat{r}^{b}_t(i) r ^ t b ( i ) . Similarly, each lender i i i privately reports their supply quantity L ^ t ( i ) \hat{L}_t(i) L ^ t ( i ) and their bid r ^ t l ( i ) \hat{r}^{l}_t(i) r ^ t l ( i ) .
LC determines the demand and supply curves f ^ ( r ; θ ) \hat{f}(r;\theta) f ^ ( r ; θ ) and g ^ ( r U ; ω ) \hat{g}(r\,U;\omega) g ^ ( r U ; ω ) from the reported values as follows:
f ^ ( r ; θ ) = ∑ i B ^ t ( i ) ⋅ 1 ( r ^ t b ( i ) ≥ r ) \hat{f}(r;\theta)=\sum_i \hat{B}_t(i)\cdot\mathbb{1}_{(\hat{r}^{b}_t(i)\ge r)} f ^ ( r ; θ ) = i ∑ B ^ t ( i ) ⋅ 1 ( r ^ t b ( i ) ≥ r )
g ^ ( r U ; ω ) = ∑ i L ^ t ( i ) ⋅ 1 ( r ^ t l ( i ) ≤ r U ) \hat{g}(r\,U;\omega)=\sum_i \hat{L}_t(i)\cdot\mathbb{1}_{(\hat{r}^{l}_t(i)\le r\,U)} g ^ ( r U ; ω ) = i ∑ L ^ t ( i ) ⋅ 1 ( r ^ t l ( i ) ≤ r U )
LC sets the interest rate as: r t = arg min r ∣ U − U ∗ ∣ r_t=\operatorname*{arg\,min}_{r}|U-U^*| r t = arg min r ∣ U − U ∗ ∣ subject to U = f ^ ( r ; θ ) g ^ ( r U ; ω ) U=\frac{\hat{f}(r;\theta)}{\hat{g}(rU;\omega)} U = g ^ ( r U ; ω ) f ^ ( r ; θ )
The utility of borrower i i i at time t t t is defined by:
Utility i , t B ( B ^ t , L ^ t , r ^ t b , r ^ t l ) : = { − B ^ t ( i ) r t − ( B t ( i ) − B ^ t ( i ) ) r t b ( i ) , if r t ≤ r ^ t b ( i ) , − B t ( i ) r t b ( i ) , otherwise. \operatorname{Utility}^{B}_{i,t}(\hat{B}_t,\hat{L}_t,\hat{r}^{b}_t,\hat{r}^{l}_t):=
\begin{cases}
-\hat{B}_t(i)\,r_t-\left(B_t(i)-\hat{B}_t(i)\right)r^{b}_t(i), & \text{if }r_t\le\hat{r}^{b}_t(i),\\
-B_t(i)\,r^{b}_t(i), & \text{otherwise.}
\end{cases} Utility i , t B ( B ^ t , L ^ t , r ^ t b , r ^ t l ) := { − B ^ t ( i ) r t − ( B t ( i ) − B ^ t ( i ) ) r t b ( i ) , − B t ( i ) r t b ( i ) , if r t ≤ r ^ t b ( i ) , otherwise.
Here, the vectors B ^ t \hat{\mathbf{B}}_t B ^ t , L ^ t \hat{\mathbf{L}}_t L ^ t , r ^ t b \hat{\mathbf{r}}^{b}_t r ^ t b , and r ^ t l \hat{\mathbf{r}}^{l}_t r ^ t l represent the bids and quantities for all participants. And r t b ( i ) r^{b}_t(i) r t b ( i ) is the true external rate of borrower i i i . Similarly, the utility of lender i i i at time t t t is given by:
Utility i , t L ( B ^ t , L ^ t , r ^ t b , r ^ t l ) : = { L ^ t ( i ) r t U + ( L t ( i ) − L ^ t ( i ) ) r t l ( i ) , if r t ≥ r ^ t l ( i ) , L t ( i ) r t l ( i ) , otherwise. \operatorname{Utility}^{L}_{i,t}(\hat{B}_t,\hat{L}_t,\hat{r}^{b}_t,\hat{r}^{l}_t):=
\begin{cases}
\hat{L}_t(i)\,r_t\,U+\left(L_t(i)-\hat{L}_t(i)\right)r^{l}_t(i), & \text{if }r_t\ge\hat{r}^{l}_t(i),\\
L_t(i)\,r^{l}_t(i), & \text{otherwise.}
\end{cases} Utility i , t L ( B ^ t , L ^ t , r ^ t b , r ^ t l ) := { L ^ t ( i ) r t U + ( L t ( i ) − L ^ t ( i ) ) r t l ( i ) , L t ( i ) r t l ( i ) , if r t ≥ r ^ t l ( i ) , otherwise.
Utility Functions for Strategic Withholding
In this section, we provide the detailed utility functions for strategic borrowers and lenders who engage in the strategic withholding strategy.
The utility of a strategic borrower A b \mathcal{A}^{b} A b , with external rate r b r^{b} r b , who borrows an amount B ^ ≤ δ b B \hat{B}\le\delta_bB B ^ ≤ δ b B from the pool while borrowing the rest from an external market, is given by:
Utility A b ( B ^ ) : = − B ^ ⋅ ϕ ( B ( 1 − δ b ) + B ^ L ) − ( B ⋅ δ b − B ^ ) r b \operatorname{Utility}_{\mathcal{A}^{b}}(\hat{B}):=-\hat{B}\cdot\phi\left(\frac{B(1-\delta_b)+\hat{B}}{L}\right)-(B\cdot\delta_b-\hat{B})\,r^{b} Utility A b ( B ^ ) := − B ^ ⋅ ϕ ( L B ( 1 − δ b ) + B ^ ) − ( B ⋅ δ b − B ^ ) r b
where ϕ ( . ) \phi(.) ϕ ( . ) denotes the baseline interest rate curve (see Equation (7) ).
Similarly, the utility of a strategic lender A l \mathcal{A}^{l} A l , with external rate r l r^{l} r l , who deposits L ^ ≤ δ l L \hat{L}\le\delta_lL L ^ ≤ δ l L in the pool and allocates the remainder to an external market, is given by:
Utility A l ( L ^ ) : = L ^ ⋅ ϕ ( B L ( 1 − δ l ) + L ^ ) ⋅ B L ( 1 − δ l ) + L ^ + ( L ⋅ δ l − L ^ ) r l \operatorname{Utility}_{\mathcal{A}^{l}}(\hat{L}):=\hat{L}\cdot\phi\left(\frac{B}{L(1-\delta_l)+\hat{L}}\right)\cdot\frac{B}{L(1-\delta_l)+\hat{L}}+(L\cdot\delta_l-\hat{L})\,r^{l} Utility A l ( L ^ ) := L ^ ⋅ ϕ ( L ( 1 − δ l ) + L ^ B ) ⋅ L ( 1 − δ l ) + L ^ B + ( L ⋅ δ l − L ^ ) r l
These utility functions are used to determine the worst-case adversarial impact, where strategic users maximize their utilities by adopting the strategic withholding strategy.
Risk Metrics for Default and Liquidation
In this section, we provide the formal definitions for pool default and liquidation.
The pool default between timeslot t t t and t + 1 t+1 t + 1 , due to a price change from p t p_t p t to p t + 1 p_{t+1} p t + 1 , is defined as:
π t ( p t + 1 ) ≔ ∑ i ∈ Borrowers max { 0 , B t ( i ) − C t ( i ) ⋅ p t + 1 } (21) \pi_t(p_{t+1}) \coloneqq\sum_{i \in\text{Borrowers}} \max\{0, B_t(i) - C_t(i) \cdot p_{t+1}\} \tag*{(21)} π t ( p t + 1 ) : = i ∈ Borrowers ∑ max { 0 , B t ( i ) − C t ( i ) ⋅ p t + 1 } (21)
This equation captures the total amount by which the borrowers’ debt exceeds their collateral value, resulting in a default.
For liquidation, consider a borrower i i i who maintains the maximum loan-to-value ratio allowed by P \mathcal{P} P at time t t t . If the price drops at time t + 1 t+1 t + 1 , the borrower may need to undergo a liquidation to ensure the loan-to-value ratio stays below the liquidation threshold. The minimum required liquidation amount, λ t i ( p t + 1 ) \lambda_t^i(p_{t+1}) λ t i ( p t + 1 ) , is given by:
λ t i ( p t + 1 ) ≔ min { x | B t ( i ) − x C t ( i ) p t + 1 − x ( 1 + L I t ) ≤ L T t } \lambda_t^i(p_{t+1}) \coloneqq\min\left\{x \ \middle| \ \frac{B_t(i)-x}{C_t(i)p_{t+1}-x(1+LI_t)} \le LT_t \right\} λ t i ( p t + 1 ) : = min { x C t ( i ) p t + 1 − x ( 1 + L I t ) B t ( i ) − x ≤ L T t }
where B t + 1 ( i ) = B t ( i ) − x B_{t+1}(i)=B_t(i)-x B t + 1 ( i ) = B t ( i ) − x is the remaining debt after liquidation, and C t + 1 ( i ) = C t ( i ) − x ( 1 + L I t ) C_{t+1}(i)=C_t(i)-x(1+LI_t) C t + 1 ( i ) = C t ( i ) − x ( 1 + L I t ) is the remaining collateral after the liquidator receives their reward.
These risk metrics allow us to quantify the potential impact of price volatility on the protocol’s stability.
M-estimate function for robust RLS
We adopt the M-estimate function proposed by [46 ] :
ϕ ( e ) ≔ { e 2 2 , 0 < ∣ e ∣ < ξ , ξ ∣ e ∣ − ξ 2 2 , ξ ≤ ∣ e ∣ < Δ 1 , ξ 2 ( Δ 2 + Δ 1 ) − ξ 2 2 + ξ ( ∣ e ∣ − Δ 2 ) 2 Δ 1 − Δ 2 , Δ 1 ≤ ∣ e ∣ < Δ 2 , ξ 2 ( Δ 2 + Δ 1 ) − ξ 2 2 , Δ 2 ≤ ∣ e ∣ . (22) \phi(e) \coloneqq
\begin{cases}
\frac{e^2}{2}, & 0<|e|<\xi,\\
\xi|e|-\frac{\xi^2}{2}, & \xi\le|e|<\Delta_1,\\
\frac{\xi}{2}(\Delta_2+\Delta_1)-\frac{\xi^2}{2}+\frac{\xi(|e|-\Delta_2)^2}{\Delta_1-\Delta_2}, & \Delta_1\le|e|<\Delta_2,\\
\frac{\xi}{2}(\Delta_2+\Delta_1)-\frac{\xi^2}{2}, & \Delta_2\le|e|.
\end{cases} \tag*{(22)} ϕ ( e ) : = ⎩ ⎨ ⎧ 2 e 2 , ξ ∣ e ∣ − 2 ξ 2 , 2 ξ ( Δ 2 + Δ 1 ) − 2 ξ 2 + Δ 1 − Δ 2 ξ ( ∣ e ∣ − Δ 2 ) 2 , 2 ξ ( Δ 2 + Δ 1 ) − 2 ξ 2 , 0 < ∣ e ∣ < ξ , ξ ≤ ∣ e ∣ < Δ 1 , Δ 1 ≤ ∣ e ∣ < Δ 2 , Δ 2 ≤ ∣ e ∣. (22)
Following [46 ] , the thresholds ξ \xi ξ , Δ 1 \Delta_1 Δ 1 , and Δ 2 \Delta_2 Δ 2 are determined using confidence levels of 0.05, 0.025, and 0.01. Under the assumption of Gaussian noise, these thresholds are computed as ξ = 1.96 σ ^ ( t ) \xi=1.96\hat{\sigma}(t) ξ = 1.96 σ ^ ( t ) , Δ 1 = 2.24 σ ^ ( t ) \Delta_1=2.24\hat{\sigma}(t) Δ 1 = 2.24 σ ^ ( t ) , and Δ 2 = 2.576 σ ^ ( t ) \Delta_2=2.576\hat{\sigma}(t) Δ 2 = 2.576 σ ^ ( t ) , where σ ^ ( t ) \hat{\sigma}(t) σ ^ ( t ) is the estimated standard deviation of the noise.
Complimentary Material of Evaluation
Parameter estimation of Compound demand and supply curves
We analyze data from the three major lending pools—DAI, USDC, and USDT—on Compound V2 over the period from February 9, 2024, to February 9, 2025. Compound V2 uses different interest rates for borrowing and supplying assets. To model the relationship between past interest rates and subsequent demand and supply, we estimate the functional dependence between the interest rate at time t − Δ t-\Delta t − Δ and the corresponding demand and supply at time t t t .
A key challenge is determining the appropriate time lag Δ \Delta Δ , as the response time of users to interest rate changes is not known a priori. To identify a reasonable lag, we evaluate different values of Δ \Delta Δ ranging from 1 to 30 time slots (each time slot corresponding to a three-hour interval). For each candidate Δ \Delta Δ , we apply Recursive Least Squares (RLS) with a forgetting factor of ρ = 0.95 \rho=0.95 ρ = 0.95 and estimate future demand and supply. The optimal lag is selected based on the value that minimizes the mean squared error (MSE) of the RLS predictions.
The results indicate that users of the DAI pool exhibit slower reactions to interest rate changes compared to those in USDC and USDT pools. Specifically, the optimal lag for the DAI demand and supply curves is found to be Δ D A I , d e m a n d = 26 \Delta_{\mathrm{DAI},\ \mathrm{demand}} = 26 Δ DAI , demand = 26 and Δ D A I , s u p p l y = 16 \Delta_{\mathrm{DAI},\ \mathrm{supply}} = 16 Δ DAI , supply = 16 , whereas for USDC and USDT, the optimal lag is Δ = 1 \Delta= 1 Δ = 1 . Using these optimal shift values, we apply RLS to estimate the evolution of the demand and supply parameters ( a t b , b t b , a t l , b t l ) (a^{b}_{t}, b^{b}_{t}, a^{l}_{t}, b^{l}_{t}) ( a t b , b t b , a t l , b t l ) over time for each pool.
Utilization optimization
We now provide the detailed specifications of the experiment used to generate Figure 2b. The synthetic parameters a t b , b t b , a t l , b t l a^{b}_{t}, b^{b}_{t}, a^{l}_{t}, b^{l}_{t} a t b , b t b , a t l , b t l evolve via a Gaussian random walk with an update interval of T = 25 T = 25 T = 25 , following:
a t + T b = a t b + ϵ t , ϵ t ∼ N ( 0 , σ t r n s ⋅ ∣ a t b ∣ ) , a^{b}_{t+T} = a^{b}_{t} + \epsilon_{t}, \qquad\epsilon_{t} \sim\mathcal{N}\left(0, \sigma_{\mathrm{trns}} \cdot\lvert a^{b}_{t} \rvert\right), a t + T b = a t b + ϵ t , ϵ t ∼ N ( 0 , σ trns ⋅ ∣ a t b ∣ ) ,
with similar updates for b t b , a t l , b t l b^{b}_{t}, a^{l}_{t}, b^{l}_{t} b t b , a t l , b t l . The noise variance is set to σ n o i s e = 1 \sigma_{\mathrm{noise}} = 1 σ noise = 1 , while σ t r n s \sigma_{\mathrm{trns}} σ trns varies from 0.1 to 1 (1% to 100%). Simulations run for 1000 time steps, averaging results over 50 independent runs. The initial parameter values are:
a 0 b = − 10 , a 0 b = 5000 , a 0 l = 500 , b 0 l = − 50. a^{b}_{0} = -10,\quad a^{b}_{0} = 5000,\quad a^{l}_{0} = 500,\quad b^{l}_{0} = -50. a 0 b = − 10 , a 0 b = 5000 , a 0 l = 500 , b 0 l = − 50.
Desired utilization is U ∗ = 0.7 U^{*} = 0.7 U ∗ = 0.7 and forgetting factor is 0.8.
Robust RLS experiment
We evaluate the robustness of the robust RLS algorithm against adversarial manipulation of demand and supply using two distinct strategies. The metric of interest is the normalized rate deviation , defined as the deviation of the interest rate from the optimal rate that achieves the target utilization U ∗ = 0.7 U^{*} = 0.7 U ∗ = 0.7 . The first strategy is an intermittent adversary, which randomly activates in every timeslot with a probability of 0.1 to enforce large noise on demand and supply. When inactive, the noise variance is σ n o i s e = 10 \sigma_{\mathrm{noise}} = 10 σ noise = 10 , and when active, it increases to σ n o i s e = ∣ B t ∣ ⋅ σ a t t a c k \sigma_{\mathrm{noise}} = \lvert B_{t} \rvert\cdot\sigma_{\mathrm{attack}} σ noise = ∣ B t ∣ ⋅ σ attack for demand and σ n o i s e = ∣ L t ∣ ⋅ σ a t t a c k \sigma_{\mathrm{noise}} = \lvert L_{t} \rvert\cdot\sigma_{\mathrm{attack}} σ noise = ∣ L t ∣ ⋅ σ attack for supply, where σ a t t a c k \sigma_{\mathrm{attack}} σ attack varies from 0.2 to 3 (20% to 300% of demand or supply). As shown in Figure 2a, the normalized rate deviation for plain RLS increases sharply with σ a t t a c k \sigma_{\mathrm{attack}} σ attack , while the robust RLS algorithm maintains near-zero deviation, demonstrating resilience to such attacks. The second strategy simulates a persistent and more realistic adversarial borrower, which activates with probability 0.01 and stays active for T a t t a c k T_{\mathrm{attack}} T attack steps. The adversary inflates demand using a t b r t ⋅ γ a d v + b t b a^{b}_{t} r_{t} \cdot\gamma_{\mathrm{adv}} + b^{b}_{t} a t b r t ⋅ γ adv + b t b , where γ a d v > 1 \gamma_{\mathrm{adv}} > 1 γ adv > 1 exaggerates sensitivity to interest rates, tricking the protocol into lowering rates. Stress tests with T a t t a c k = 100 T_{\mathrm{attack}} = 100 T attack = 100 and γ a d v ∈ { 2 , 5 , 10 , 20 } \gamma_{\mathrm{adv}} \in\{2, 5, 10, 20\} γ adv ∈ { 2 , 5 , 10 , 20 } show that while plain RLS suffers increasing normalized rate deviation (up to 3.13 for γ a d v = 20 \gamma_{\mathrm{adv}} = 20 γ adv = 20 ), robust RLS keeps it below 0.5, even under extreme attacks.
These experiments were conducted using synthetic demand and supply functions, following the experimental setup described in Appendix § 11 .§ 2 .
Forgetting factor and estimation error
The forgetting factor governs the trade-off between adaptivity and precision; therefore, depending on the dynamics of the demand and supply parameters, different forgetting factors should be used. Figure 3 illustrates the mean squared error (MSE) of the parameters a t b , b t b , a t l , b t l a^{b}_{t}, b^{b}_{t}, a^{l}_{t}, b^{l}_{t} a t b , b t b , a t l , b t l estimated by the RLS-based algorithm. The parameters were generated using a random walk with Gaussian noise, with a frequency of change every T = 50 T = 50 T = 50 steps and σ t r n s = 0.1 \sigma_{\mathrm{trns}} = 0.1 σ trns = 0.1 . We run the experiment for 1000 timeslots and average the results across 50 independent runs. In this experiment setup, the optimal forgetting factor, which minimizes the overall MSE across all parameters, is approximately ρ = 0.82 \rho= 0.82 ρ = 0.82 .
Figure 3. Impact of forgetting factor on the mean square error of the estimated parameters by the RLS-based algorithms.
Revenue maximizing
We run our RLS-based controller with the objective of maximizing the supply, which serves as a proxy for the pool’s revenue. The user behavior parameters are modeled as random walk stochastic processes with Gaussian noise. In figure 4 we plot the supply against the std of the transition noise in the process. As the noise increases, it becomes more difficult for the RLS-based algorithm to adapt, resulting in a performance decline. When the relative standard deviation of the noise reaches 20%—meaning the parameters change with severe 20% noise at every time slot—the performance of the RLS-based algorithm drops to a level comparable to Aave-style algorithms.
Risk controller
Proofs
Proof of theorem 3.1
Proof. Our proof is applying a slightly modified version of the proof provided in [9 ] . The condition required for convergence of the RLS algorithm is that the input vector of the linear system should be persistently excited. In other words if we want to estimate θ t \theta_t θ t , and the linear system is y t = x t T θ t + e t y_t = \mathbf{x}_t^{T}\theta_t + e_t y t = x t T θ t + e t then x t \mathbf{x}_t x t should hold in:
Figure 4. Comparison of supply, used as a proxy for revenue, between the RLS-based controller and Aave’s static curves. The parameters evolve according to a random walk with Gaussian noise. The x-axis represents the relative standard deviation of the noise in percentage. The fixed factor is set to ρ = 0.8 \rho= 0.8 ρ = 0.8 .
m I ≤ ∑ i = t t + N x i x i T ≤ M I , ∀ t > 0 mI \le\sum_{i=t}^{t+N} \mathbf{x}_i\mathbf{x}_i^{T} \le MI, \forall t > 0 m I ≤ i = t ∑ t + N x i x i T ≤ M I , ∀ t > 0
for some positive m , M , N m, M, N m , M , N . We first prove the following claim:
Claim: Let x i = [ 1 r i ] \mathbf{x}_i = \begin{bmatrix} 1 \\ r_i \end{bmatrix} x i = [ 1 r i ] for i = 1 , 2 , … , N i = 1, 2, \ldots, N i = 1 , 2 , … , N , where r i ∈ R r_i \in\mathbb{R} r i ∈ R , and suppose at least two of the r i r_i r i are distinct. Then, the matrix
S = ∑ i = t t + N x i x i T S = \sum_{i=t}^{t+N} \mathbf{x}_i\mathbf{x}_i^{T} S = i = t ∑ t + N x i x i T is positive definite, satisfying the persistent excitation condition. In order to show the claim holds, we compute the sum matrix S S S :
S = ∑ i = t t + N x i x i T = ∑ i = t N [ 1 r i ] [ 1 r i ] = ∑ i = t N [ 1 r i r i r i 2 ] = [ N ∑ i = t N r i ∑ i = t N r i ∑ i = t N r i 2 ] . S = \sum_{i=t}^{t+N} \mathbf{x}_i\mathbf{x}_i^{T} = \sum_{i=t}^{N} \begin{bmatrix} 1 \\ r_i \end{bmatrix} \begin{bmatrix} 1 & r_i \end{bmatrix} = \sum_{i=t}^{N} \begin{bmatrix} 1 & r_i \\ r_i & r_i^2 \end{bmatrix} = \begin{bmatrix} N & \sum_{i=t}^{N} r_i \\ \sum_{i=t}^{N} r_i & \sum_{i=t}^{N} r_i^2 \end{bmatrix}. S = i = t ∑ t + N x i x i T = i = t ∑ N [ 1 r i ] [ 1 r i ] = i = t ∑ N [ 1 r i r i r i 2 ] = [ N ∑ i = t N r i ∑ i = t N r i ∑ i = t N r i 2 ] . We compute det ( S − λ I ) \det(S - \lambda I) det ( S − λ I ) to find the eigenvalues:
( N − λ ) ( c − λ ) − ( ∑ i = t N r i ) 2 = 0. (N - \lambda)(c - \lambda) - \left(\sum_{i=t}^{N} r_i\right)^2 = 0. ( N − λ ) ( c − λ ) − ( i = t ∑ N r i ) 2 = 0. Let: b : = ∑ i = t N r i , c : = ∑ i = t N r i 2 . b := \sum_{i=t}^{N} r_i,\quad c := \sum_{i=t}^{N} r_i^2. b := ∑ i = t N r i , c := ∑ i = t N r i 2 .
λ 1 , 2 = N + c ± ( N − c ) 2 + 4 b 2 2 . \lambda_{1,2} = \frac{N + c \pm\sqrt{(N-c)^2 + 4b^2}}{2}. λ 1 , 2 = 2 N + c ± ( N − c ) 2 + 4 b 2 . λ 1 + λ 2 = N + c > 0 , \lambda_1 + \lambda_2 = N + c > 0, λ 1 + λ 2 = N + c > 0 , λ 1 λ 2 = N c − b 2 . \lambda_1\lambda_2 = Nc - b^2. λ 1 λ 2 = N c − b 2 .
Therefore the eigenvalues are both positive if and only if N c − b 2 > 0 Nc-b^2>0 N c − b 2 > 0 . From Cauchy-Schwarz inequality we know:
( ∑ i = t N r i ) 2 ≤ N ∑ i = t N r i 2 \left(\sum_{i=t}^{N}r_i\right)^2 \le N\sum_{i=t}^{N}r_i^2 ( i = t ∑ N r i ) 2 ≤ N i = t ∑ N r i 2
which implies: λ 1 λ 2 = N c − b 2 ≥ 0 \lambda_1\lambda_2=Nc-b^2\ge0 λ 1 λ 2 = N c − b 2 ≥ 0 . Equality holds if and only if all r i r_i r i are equal. When at least two r i r_i r i are distinct, the inequality is strict:
λ 1 λ 2 > 0. \lambda_1\lambda_2>0. λ 1 λ 2 > 0.
The persistent excitation condition requires:
m I ≤ S ≤ M I , mI\le S\le MI, m I ≤ S ≤ M I ,
for some constants 0 < m ≤ M 0<m\le M 0 < m ≤ M . Since S S S has positive eigenvalues λ min \lambda_{\min} λ m i n and λ max \lambda_{\max} λ m a x , we can set:
m = λ min , M = λ max . m=\lambda_{\min},\qquad M=\lambda_{\max}. m = λ m i n , M = λ m a x .
The above analysis shows that as long as for any t t t , there is some N N N such that Algorithm 2 sets at least two distinct interest rates from time t t t to t + N t+N t + N , then the excitation condition of paper [9 ] is met.
In Algorithm 2, the rate r t r_t r t is sampled from a Gaussian distribution. The mean of this distribution is the optimal rate based on the latest estimates of the parameters a b a^b a b , b b b^b b b , a l a^l a l , and b l b^l b l , and the variance is determined by the variance of the optimal rate estimation. The covariance matrix used for this estimation is derived from P t b P_t^b P t b and P t l P_t^l P t l . It is important to note that as long as at least one of the matrices P t b P_t^b P t b or P t l P_t^l P t l has a positive element in its main diagonal (diameter), the rate r t r_t r t is sampled from a distribution with non-zero variance. This implies that with high probability, after some of trials, the sampled r t r_t r t will differ, even in the worst-case scenario. To determine the required number of timeslots N N N to get at least two different r t r_t r t with probability at least 1 − δ 1-\delta 1 − δ we conduct the following analysis:
Claim. Let X X X be a random variable following a Gaussian distribution with mean μ \mu μ and variance ζ \zeta ζ (i.e., X ∼ N ( μ , ζ ) X\sim\mathcal{N}(\mu,\zeta) X ∼ N ( μ , ζ ) ). Let δ ∈ ( 0 , 1 ) \delta\in(0,1) δ ∈ ( 0 , 1 ) be a desired confidence level. Then, the minimum number of independent samples N N N needed to ensure that, with probability at least 1 − δ 1-\delta 1 − δ , there are at least two different samples among the N N N samples is given by:
N ≥ ln ( δ ) ln ( ϵ 2 π ζ ) , N\ge\frac{\ln(\delta)}{\ln\left(\frac{\epsilon}{\sqrt{2\pi\zeta}}\right)}, N ≥ ln ( 2 π ζ ϵ ) ln ( δ ) , where ϵ \epsilon ϵ is the quantization level (measurement precision).
Proof of the claim The maximum value of the PDF occurs at the mean μ \mu μ : f max = f ( μ ) = 1 2 π ζ f_{\max}=f(\mu)=\frac{1}{\sqrt{2\pi\zeta}} f m a x = f ( μ ) = 2 π ζ 1 . The maximum probability that a sample falls into any single bin (the bin containing μ \mu μ ) is approximately: p max = f max × ϵ = ϵ 2 π ζ p_{\max}=f_{\max}\times\epsilon=\frac{\epsilon}{\sqrt{2\pi\zeta}} p m a x = f m a x × ϵ = 2 π ζ ϵ . Assuming independence, the probability that all N N N samples fall into the same bin is:
P ( all samples in the same bin ) = p max N . P(\text{all samples in the same bin})=p_{\max}^{N}. P ( all samples in the same bin ) = p m a x N .
We require:
1 − P ( all samples in the same bin ) ≥ 1 − δ ⟹ P ( all samples in the same bin ) ≤ δ 1-P(\text{all samples in the same bin})\ge1-\delta\quad\Longrightarrow\quad P(\text{all samples in the same bin})\le\delta 1 − P ( all samples in the same bin ) ≥ 1 − δ ⟹ P ( all samples in the same bin ) ≤ δ
p max N ≤ δ ⟹ N ln ( p max ) ≤ ln ( δ ) p_{\max}^{N} \le\delta\Longrightarrow N\ln(p_{\max}) \le\ln(\delta) p m a x N ≤ δ ⟹ N ln ( p m a x ) ≤ ln ( δ )
Substitute p max p_{\max} p m a x :
N ≥ ln ( δ ) ln ( ϵ 2 π ζ ) = Θ ( ln δ ln ϵ − ln ζ ) = Θ ( − ln δ − ln ϵ + ln ζ ) N \ge\frac{\ln(\delta)}{\ln\left(\sqrt{\frac{\epsilon}{2\pi\zeta}}\right)} = \Theta\left(\frac{\ln\delta}{\ln\epsilon-\ln\zeta}\right) = \Theta\left(\frac{-\ln\delta}{-\ln\epsilon+\ln\zeta}\right) N ≥ ln ( 2 π ζ ϵ ) ln ( δ ) = Θ ( ln ϵ − ln ζ ln δ ) = Θ ( − ln ϵ + ln ζ − ln δ )
Applying the following claim to our case, ϵ = Δ r \epsilon= \Delta r ϵ = Δ r (precision of the interest rate), ζ = Θ ( diam ( P t b + P t l ) ) \zeta= \Theta\left(\operatorname{diam}(P_t^b+P_t^l)\right) ζ = Θ ( diam ( P t b + P t l ) ) . Hence as long as diam ( P t b + P t l ) > 0 \operatorname{diam}(P_t^b+P_t^l)>0 diam ( P t b + P t l ) > 0 , there is some bounded N N N that satisfies the condition.
So now we can apply the results of [9 ] for the convergence of the RLS algorithm to the right θ t \theta_t θ t . They write the estimation error θ ~ t = θ t − θ ^ t \tilde{\theta}_t=\theta_t-\hat{\theta}_t θ ~ t = θ t − θ ^ t as sum of three terms θ ~ t : = θ ~ t 1 + θ ~ t 2 + θ ~ t 3 \tilde{\theta}_t:=\tilde{\theta}_t^1+\tilde{\theta}_t^2+\tilde{\theta}_t^3 θ ~ t := θ ~ t 1 + θ ~ t 2 + θ ~ t 3 . Given that θ \theta θ has some major change at time t 0 t_0 t 0 , the question is at time t > t 0 t>t_0 t > t 0 what is an upper bound of each of θ ~ t 1 , θ ~ t 2 , θ ~ t 3 \tilde{\theta}_t^1,\tilde{\theta}_t^2,\tilde{\theta}_t^3 θ ~ t 1 , θ ~ t 2 , θ ~ t 3 ? They show that the first and second terms decay exponentially over time i.e., ∥ θ ~ t 1 + θ ~ t 2 ∥ = O ( ρ t ) \left\|\tilde{\theta}_t^1+\tilde{\theta}_t^2\right\|=O(\rho^t) θ ~ t 1 + θ ~ t 2 = O ( ρ t ) whereas the third term θ ~ t 3 \tilde{\theta}_t^3 θ ~ t 3 which is the only term that is a function of the observation noise, is as follows:
lim sup t → ∞ E ( ∥ θ ~ t 3 ∥ 2 ) ≤ ν 2 M m 2 ( 1 − ρ N ρ N ) 2 1 ln ( 1 ρ ) = O ( ( 1 − ρ N ρ N ) 2 ν 2 ln ( 1 ρ ) ) \limsup_{t\to\infty}\mathbb{E}\left(\left\|\tilde{\theta}_t^3\right\|^2\right)\le\nu^2\frac{M}{m^2}\left(\frac{1-\rho^N}{\rho^N}\right)^2\frac{1}{\ln\left(\frac{1}{\rho}\right)}=O\left(\left(\frac{1-\rho^N}{\rho^N}\right)^2\frac{\nu^2}{\ln\left(\frac{1}{\rho}\right)}\right) t → ∞ lim sup E ( θ ~ t 3 2 ) ≤ ν 2 m 2 M ( ρ N 1 − ρ N ) 2 ln ( ρ 1 ) 1 = O ( ρ N 1 − ρ N ) 2 ln ( ρ 1 ) ν 2
Where ν \nu ν is the variance of the observation noise.
Proof of theorem 3.2
Proof.
Case 1: U ≤ U ∗ U\le U^* U ≤ U ∗
U = − a b r + b b L U=\frac{-a^b r+b^b}{L} U = L − a b r + b b
U = − a b U R s l o p e 1 + b b U ∗ L U ∗ ⟹ U = b b L + a b R s l o p e 1 U ∗ ⟹ r = b b R s l o p e 1 U ∗ L + a b R s l o p e 1 U=\frac{-a^b U R_{\mathrm{slope1}}+b^b U^*}{L U^*}
\Longrightarrow U=\frac{b^b}{L+\frac{a^bR_{\mathrm{slope1}}}{U^*}}
\Longrightarrow r=\frac{b^bR_{\mathrm{slope1}}}{U^*L+a^bR_{\mathrm{slope1}}} U = L U ∗ − a b U R slope1 + b b U ∗ ⟹ U = L + U ∗ a b R slope1 b b ⟹ r = U ∗ L + a b R slope1 b b R slope1
r − r ∗ = b b R s l o p e 1 U ∗ L + a b R s l o p e 1 − b b − L U ∗ a b r-r^*=\frac{b^bR_{\mathrm{slope1}}}{U^*L+a^bR_{\mathrm{slope1}}}-\frac{b^b-LU^*}{a^b} r − r ∗ = U ∗ L + a b R slope1 b b R slope1 − a b b b − L U ∗
R s l o p e 1 = b b − L U ∗ a b R_{\mathrm{slope1}}=\frac{b^b-LU^*}{a^b} R slope1 = a b b b − L U ∗
R s l o p e 1 ≥ b b − U ∗ L a b R_{\mathrm{slope1}}\ge\frac{b^b-U^*L}{a^b} R slope1 ≥ a b b b − U ∗ L
Case 2: U t > U ∗ U_t>U^* U t > U ∗
U = − a b ( R s l o p e 1 + R s l o p e 2 ( U − U ∗ 1 − U ∗ ) ) + b b L ⟹ U = b b − a b R s l o p e 1 + a b R s l o p e 2 U ∗ 1 − U ∗ L + a b R s l o p e 2 1 − U ∗ (23) U=\frac{-a^b\left(R_{\mathrm{slope1}}+R_{\mathrm{slope2}}\left(\frac{U-U^*}{1-U^*}\right)\right)+b^b}{L}
\Longrightarrow U=\frac{b^b-a^bR_{\mathrm{slope1}}+\frac{a^bR_{\mathrm{slope2}}U^*}{1-U^*}}{L+\frac{a^bR_{\mathrm{slope2}}}{1-U^*}} \tag*{(23)} U = L − a b ( R slope1 + R slope2 ( 1 − U ∗ U − U ∗ ) ) + b b ⟹ U = L + 1 − U ∗ a b R slope2 b b − a b R slope1 + 1 − U ∗ a b R slope2 U ∗ (23)
⟹ r = R s l o p e 1 + R s l o p e 2 ( b b − a b R s l o p e 1 − U ∗ L ) ( L + a b R s l o p e 2 1 − U ∗ ) ( 1 − U ∗ ) (24) \Longrightarrow r=R_{\mathrm{slope1}}+\frac{R_{\mathrm{slope2}}\left(b^b-a^bR_{\mathrm{slope1}}-U^*L\right)}{\left(L+\frac{a^bR_{\mathrm{slope2}}}{1-U^*}\right)(1-U^*)} \tag*{(24)} ⟹ r = R slope1 + ( L + 1 − U ∗ a b R slope2 ) ( 1 − U ∗ ) R slope2 ( b b − a b R slope1 − U ∗ L ) (24)
r − r ∗ = R s l o p e 1 + R s l o p e 2 ( b b − a b R s l o p e 1 − U ∗ L ) ( L + a b R s l o p e 2 1 − U ∗ ) ( 1 − U ∗ ) − b b − L U ∗ a b r-r^{*}=R_{\mathrm{slope1}}+\frac{R_{\mathrm{slope2}}\left(b^{b}-a^{b}R_{\mathrm{slope1}}-U^{*}L\right)}{\left(L+\frac{a^{b}R_{\mathrm{slope2}}}{1-U^{*}}\right)\left(1-U^{*}\right)}-\frac{b^{b}-LU^{*}}{a^{b}} r − r ∗ = R slope1 + ( L + 1 − U ∗ a b R slope2 ) ( 1 − U ∗ ) R slope2 ( b b − a b R slope1 − U ∗ L ) − a b b b − L U ∗
R t P , ν ( U ∗ ) = { ∣ R s l o p e 1 + R s l o p e 2 ( b b − a b R s l o p e 1 − U ∗ L ) ( L + a b R s l o p e 2 1 − U ∗ ) ( 1 − U ∗ ) − b b − L U ∗ a b ∣ if R s l o p e 1 < b b − L U ∗ a b , ∣ b b R s l o p e 1 U ∗ L + a b R s l o p e 1 − b b − L U ∗ a b ∣ if R s l o p e 1 > b b − L U ∗ a b . \mathcal{R}_{t}^{P,\nu}(U^{*})=
\begin{cases}
\left|R_{\mathrm{slope1}}+\frac{R_{\mathrm{slope2}}\left(b^{b}-a^{b}R_{\mathrm{slope1}}-U^{*}L\right)}{\left(L+\frac{a^{b}R_{\mathrm{slope2}}}{1-U^{*}}\right)\left(1-U^{*}\right)}-\frac{b^{b}-LU^{*}}{a^{b}}\right| & \text{if }R_{\mathrm{slope1}}<\frac{b^{b}-LU^{*}}{a^{b}},\\
\left|\frac{b^{b}R_{\mathrm{slope1}}}{U^{*}L+a^{b}R_{\mathrm{slope1}}}-\frac{b^{b}-LU^{*}}{a^{b}}\right| & \text{if }R_{\mathrm{slope1}}>\frac{b^{b}-LU^{*}}{a^{b}}.
\end{cases} R t P , ν ( U ∗ ) = ⎩ ⎨ ⎧ R slope1 + ( L + 1 − U ∗ a b R slope2 ) ( 1 − U ∗ ) R slope2 ( b b − a b R slope1 − U ∗ L ) − a b b b − L U ∗ U ∗ L + a b R slope1 b b R slope1 − a b b b − L U ∗ if R slope1 < a b b b − L U ∗ , if R slope1 > a b b b − L U ∗ .
R t P , ν ( U ∗ ) = { Δ 1 + a b R s l o p e 1 L U ∗ if R s l o p e 1 < b b − L U ∗ a b , Δ 1 + a b R s l o p e 2 L ( 1 − U ∗ ) if R s l o p e 1 > b b − L U ∗ a b . \mathcal{R}_{t}^{P,\nu}(U^{*})=
\begin{cases}
\frac{\Delta}{1+\frac{a^{b}R_{\mathrm{slope1}}}{LU^{*}}} & \text{if }R_{\mathrm{slope1}}<\frac{b^{b}-LU^{*}}{a^{b}},\\
\frac{\Delta}{1+\frac{a^{b}R_{\mathrm{slope2}}}{L(1-U^{*})}} & \text{if }R_{\mathrm{slope1}}>\frac{b^{b}-LU^{*}}{a^{b}}.
\end{cases} R t P , ν ( U ∗ ) = ⎩ ⎨ ⎧ 1 + L U ∗ a b R slope1 Δ 1 + L ( 1 − U ∗ ) a b R slope2 Δ if R slope1 < a b b b − L U ∗ , if R slope1 > a b b b − L U ∗ .
R t P , ν ( U ∗ ) ≥ Δ 1 + max { a b L } ⋅ max { R s l o p e 1 U ∗ , R s l o p e 2 1 − U ∗ } \mathcal{R}_{t}^{P,\nu}(U^{*})\geq\frac{\Delta}{1+\max\left\{\frac{a^{b}}{L}\right\}\cdot\max\left\{\frac{R_{\mathrm{slope1}}}{U^{*}},\frac{R_{\mathrm{slope2}}}{1-U^{*}}\right\}} R t P , ν ( U ∗ ) ≥ 1 + max { L a b } ⋅ max { U ∗ R slope1 , 1 − U ∗ R slope2 } Δ
Proof of theorem B.1
Proof. Given the demand function B t = − a b r t + b b B_{t}=-a^{b}r_{t}+b^{b} B t = − a b r t + b b and the supply function L t = a l r t U t − b l L_{t}=a^{l}r_{t}U_{t}-b^{l} L t = a l r t U t − b l , we first find U t U_{t} U t by solving the following equation for U t U_{t} U t :
U t = − a b r t + b b a l r t U t − b l U_{t}=\frac{-a^{b}r_{t}+b^{b}}{a^{l}r_{t}U_{t}-b^{l}} U t = a l r t U t − b l − a b r t + b b
Solving this equation will yield:
U t = b l + ( b l ) 2 − 4 a l r t ( a b r t − b b ) 2 a l r t U_{t}=\frac{b^{l}+\sqrt{(b^{l})^{2}-4a^{l}r_{t}(a^{b}r_{t}-b^{b})}}{2a^{l}r_{t}} U t = 2 a l r t b l + ( b l ) 2 − 4 a l r t ( a b r t − b b )
To maximize the sum of demand and supply, we first express the sum in terms of r r r :
B t + L t = − a b r + b b + ( a l r b l + a l r ( b l ) 2 − 4 a l r ( a b r − b b ) 2 a l r − b l ) = − a b r + b b + ( b l 2 + ( b l ) 2 − 4 a l r ( a b r − b b ) 2 − b l ) = − a b r + b b − b l 2 + ( b l ) 2 − 4 a l r ( a b r − b b ) 2 . \begin{aligned}
B_{t}+L_{t}=-a^{b}r+b^{b}+\left(\frac{a^{l}rb^{l}+a^{l}r\sqrt{(b^{l})^{2}-4a^{l}r(a^{b}r-b^{b})}}{2a^{l}r}-b^{l}\right) \\
&=-a^{b}r+b^{b}+\left(\frac{b^{l}}{2}+\frac{\sqrt{(b^{l})^{2}-4a^{l}r(a^{b}r-b^{b})}}{2}-b^{l}\right) \\
&=-a^{b}r+b^{b}-\frac{b^{l}}{2}+\frac{\sqrt{(b^{l})^{2}-4a^{l}r(a^{b}r-b^{b})}}{2}.
\end{aligned} B t + L t = − a b r + b b + ( 2 a l r a l r b l + a l r ( b l ) 2 − 4 a l r ( a b r − b b ) − b l ) = − a b r + b b + ( 2 b l + 2 ( b l ) 2 − 4 a l r ( a b r − b b ) − b l ) = − a b r + b b − 2 b l + 2 ( b l ) 2 − 4 a l r ( a b r − b b ) .
We define:
f ( r ) : = − a b r + b b − b l 2 + ( b l ) 2 − 4 a l r ( a b r − b b ) 2 f(r):=-a^{b}r+b^{b}-\frac{b^{l}}{2}+\frac{\sqrt{(b^{l})^{2}-4a^{l}r(a^{b}r-b^{b})}}{2} f ( r ) := − a b r + b b − 2 b l + 2 ( b l ) 2 − 4 a l r ( a b r − b b )
We differentiate f ( r ) f(r) f ( r ) with respect to r r r and set the derivative to zero to find the critical points:
f ′ ( r ) = − a b + d d r ( ( b l ) 2 − 4 a l r ( a b r − b b ) 2 ) f^{\prime}(r)=-a^{b}+\frac{d}{dr}\left(\frac{\sqrt{(b^{l})^{2}-4a^{l}r(a^{b}r-b^{b})}}{2}\right) f ′ ( r ) = − a b + d r d ( 2 ( b l ) 2 − 4 a l r ( a b r − b b ) )
d d r ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = 1 2 ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) − 1 / 2 ⋅ d d r ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) \frac{d}{dr}\left(\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}\right)=\frac{1}{2}\left((b^l)^2-4a^l r(a^b r-b^b)\right)^{-1/2}\cdot\frac{d}{dr}\left((b^l)^2-4a^l r(a^b r-b^b)\right) d r d ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = 2 1 ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) − 1/2 ⋅ d r d ( ( b l ) 2 − 4 a l r ( a b r − b b ) )
We compute the inner derivative:
d d r ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = − 4 a l ( a b r − b b ) − 4 a l r ( a b ) = − 4 a l ( a b r − b b + a b r ) = − 4 a l ( 2 a b r − b b ) \frac{d}{dr}\left((b^l)^2-4a^l r(a^b r-b^b)\right)=-4a^l(a^b r-b^b)-4a^l r(a^b)=-4a^l(a^b r-b^b+a^b r)=-4a^l(2a^b r-b^b) d r d ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = − 4 a l ( a b r − b b ) − 4 a l r ( a b ) = − 4 a l ( a b r − b b + a b r ) = − 4 a l ( 2 a b r − b b )
Thus:
d d r ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = − 2 a l ( 2 a b r − b b ) ( b l ) 2 − 4 a l r ( a b r − b b ) \frac{d}{dr}\left(\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}\right)=\frac{-2a^l(2a^b r-b^b)}{\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}} d r d ( ( b l ) 2 − 4 a l r ( a b r − b b ) ) = ( b l ) 2 − 4 a l r ( a b r − b b ) − 2 a l ( 2 a b r − b b )
Therefore:
f ′ ( r ) = − a b − a l ( 2 a b r − b b ) 2 ( b l ) 2 − 4 a l r ( a b r − b b ) f'(r)=-a^b-\frac{a^l(2a^b r-b^b)}{2\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}} f ′ ( r ) = − a b − 2 ( b l ) 2 − 4 a l r ( a b r − b b ) a l ( 2 a b r − b b )
Set f ′ ( r ) = 0 f'(r)=0 f ′ ( r ) = 0 and solve for r r r :
2 a b ( b l ) 2 − 4 a l r ( a b r − b b ) = − a l ( 2 a b r − b b ) 2a^b\sqrt{(b^l)^2-4a^l r(a^b r-b^b)}=-a^l(2a^b r-b^b) 2 a b ( b l ) 2 − 4 a l r ( a b r − b b ) = − a l ( 2 a b r − b b )
Square both sides and expand and simplify:
4 ( a b ) 2 ( b l ) 2 − 16 ( a b ) 2 a l r ( a b r − b b ) = ( a l ) 2 ( 4 ( a b ) 2 r 2 − 4 a b r b b + ( b b ) 2 ) ⟹ 4(a^b)^2(b^l)^2-16(a^b)^2a^l r(a^b r-b^b)=(a^l)^2(4(a^b)^2r^2-4a^b r b^b+(b^b)^2)\quad\Longrightarrow 4 ( a b ) 2 ( b l ) 2 − 16 ( a b ) 2 a l r ( a b r − b b ) = ( a l ) 2 ( 4 ( a b ) 2 r 2 − 4 a b r b b + ( b b ) 2 ) ⟹
r = b b + ( b b ) 2 + 4 ( a b ) 2 ( b l ) 2 2 a b (25) r=\frac{b^b+\sqrt{(b^b)^2+4(a^b)^2(b^l)^2}}{2a^b} \tag*{(25)} r = 2 a b b b + ( b b ) 2 + 4 ( a b ) 2 ( b l ) 2 (25)
Due to the constraints of the optimization problem U t < U max U_t<U_{\max} U t < U m a x , if the above r t r_t r t results in a utilization higher than U max U_{\max} U m a x we cannot set that. In order to make sure this constraint is met we plug r r r from (25) in eq:25 and find the resulting U t U_t U t which is a b b l ( 1 + 1 − 4 a b a l ) a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) \frac{a^b b^l(1+\sqrt{1-4a^b a^l})}{a^l(b^b+\sqrt{(b^b)^2+4(a^b b^l)^2})} a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) a b b l ( 1 + 1 − 4 a b a l ) . Hence if a b b l ( 1 + 1 − 4 a b a l ) a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) > U max \frac{a^b b^l(1+\sqrt{1-4a^b a^l})}{a^l(b^b+\sqrt{(b^b)^2+4(a^b b^l)^2})}>U_{\max} a l ( b b + ( b b ) 2 + 4 ( a b b l ) 2 ) a b b l ( 1 + 1 − 4 a b a l ) > U m a x , the interest rate should be set such that U t = U max U_t=U_{\max} U t = U m a x therefore:
U max = − a b r t + b b a l r t U max − b l ⟹ r t = b b + b l U max a b + a l ( U max ) 2 U_{\max}=\frac{-a^b r_t+b^b}{a^l r_tU_{\max}-b^l}\Longrightarrow r_t=\frac{b^b+b^lU_{\max}}{a^b+a^l(U_{\max})^2} U m a x = a l r t U m a x − b l − a b r t + b b ⟹ r t = a b + a l ( U m a x ) 2 b b + b l U m a x
Proof of Proposition 4.1
Proof. Consider a user i i i with negligible B t ( i ) B_t(i) B t ( i ) , no matter what i i i reports f ^ ( r ; θ ) \hat{f}(r;\theta) f ^ ( r ; θ ) formed by the protocol remains the same hence i i i cannot change the interest rate in any way. i i i chooses B ^ t ( i ) \hat{B}_t(i) B ^ t ( i ) to maximizes his own utility function for a given r t r_t r t :
− B ^ t ( i ) r t − ( B t ( i ) − B ^ t ( i ) ) r t b ( i ) -\hat{B}_t(i)r_t-\left(B_t(i)-\hat{B}_t(i)\right)r_t^b(i) − B ^ t ( i ) r t − ( B t ( i ) − B ^ t ( i ) ) r t b ( i )
The maximum points of this function are B ^ t ( i ) = B t \hat{B}_t(i)=B_t B ^ t ( i ) = B t if r t < r t b ( i ) r_t<r_t^b(i) r t < r t b ( i ) and B ^ t ( i ) = 0 \hat{B}_t(i)=0 B ^ t ( i ) = 0 otherwise. This is by definition the truthful strategy. A similar argument holds for a lender with negligible L t ( i ) L_t(i) L t ( i ) .
Proof of Theorem 4.2
Proof. First, we only focus on the case that there is one strategic borrower without any strategic lender and then we show how this result changes in the presence of a strategic lender.
Strategic borrower We outline an adversarial strategy that a major borrower denoted by A b \mathcal{A}^{b} A b might employ to mislead the protocol into selecting a lower interest rate. Consider A b \mathcal{A}^{b} A b controlling δ b \delta_b δ b fraction of the total demand b b b^{b} b b , with a private interest rate r b r^{b} r b . In the presence of such an adversary, the true demand curve, alongside the continuum users’ linear function, is depicted as the black curve B ( r ) B(r) B ( r ) in Figure 6 . The true preference of A b \mathcal{A}^{b} A b is to borrow b b δ b b^{b}\delta_b b b δ b whenever r < r b r < r^{b} r < r b .
Figure 6.
Ideally during the exploration phase C D C_D C D will learn the demand curve B ( r ) B(r) B ( r ) and during the exploitation phase, selects the optimal interest rate r ∗ r^{*} r ∗ such that r ∗ = arg min r ∣ B ( r ) L − U ∗ ∣ r^{*} = \arg\min_r \left|\frac{B(r)}{L} - U^{*}\right| r ∗ = arg min r L B ( r ) − U ∗ .
However, the adversary can misreport their value by pretending that the maximum rate they are willing to pay is r ˉ b \bar{r}^{b} r ˉ b , by repaying whenever the interest rate exceeds r ˉ b \bar{r}^{b} r ˉ b during the exploration phase. Consequently, A b \mathcal{A}^{b} A b deceives C D C_D C D into believing that the red curve B ˉ ( r ) \bar{B}(r) B ˉ ( r ) in Figure 6 represents the true demand curve. This misreporting leads C D C_D C D to choose a different interest rate, r ˉ = arg min r ∣ B ˉ ( r ) L − U ∗ ∣ \bar{r} = \arg\min_r \left|\frac{\bar{B}(r)}{L} - U^{*}\right| r ˉ = arg min r L B ˉ ( r ) − U ∗ .
This proof addresses two key questions: 1) When is it beneficial for the adversary to misreport their value considering that during the exploration phase they might financially suffer from lying? 2) Given that misreporting is advantageous, to what extent can the adversary influence the interest rate?
We start with the first point, We first compare the utility of an honest strategy and that of the adversarial strategy doe the major borrower during the exploration and exploitation phases of C D C_D C D .
Utility b h o n e s t ≥ − ( δ b b b τ ζ r b − r min r max − r min r b + r min 2 + C τ , ζ b + δ b b b ( T − τ ) r b ) (26) \operatorname{Utility}_{b}^{\mathrm{honest}} \geq-\left(\delta_b b^{b}\tau\zeta\frac{r^{b}-r_{\min}}{r_{\max}-r_{\min}}\frac{r^{b}+r_{\min}}{2}+C_{\tau,\zeta}^{b}+\delta_b b^{b}(T-\tau)r^{b}\right) \tag*{(26)} Utility b honest ≥ − ( δ b b b τ ζ r m a x − r m i n r b − r m i n 2 r b + r m i n + C τ , ζ b + δ b b b ( T − τ ) r b ) (26)
If the borrower follows the honest strategy and reports r b r^b r b , during the exploration phase, they will borrow whenever r ∈ [ r min , r b ] r \in[r_{\min},r^b] r ∈ [ r m i n , r b ] and pay an average interest rate of r min + r b 2 \frac{r_{\min}+r^b}{2} 2 r m i n + r b during those timeslots. There are τ ζ r b − r min r max − r min \tau\zeta\frac{r^b-r_{\min}}{r_{\max}-r_{\min}} τ ζ r m a x − r m i n r b − r m i n such timeslots based on the uniform randomization of C D C_D C D described in Appendix [§ 10 .§ 5 ]. During the rest of the exploration phase, i.e., when r > r b r > r^b r > r b or during the non-randomized times, we denote the cost of the borrower by C τ , ζ r b C_{\tau,\zeta}^{r^b} C τ , ζ r b . Finally, during the exploitation phase T − τ T-\tau T − τ , the borrower pays at most rate r b r^b r b (potentially even lower depending on the rest of the parameters and objective utilization U ∗ U^* U ∗ ).
Now, we discuss the utility of the borrower by misreporting r ˉ b < r b \bar{r}^b < r^b r ˉ b < r b instead of r b r^b r b :
Utility b a d v ≤ ( δ b b τ ζ r ˉ b − r min r max − r min r ˉ b + r min 2 + δ b b τ ζ r b − r ˉ b r max − r min r b + C τ , ζ r b + δ b b ( T − τ ) r ˉ b ) (27) \operatorname{Utility}_b^{\mathrm{adv}} \leq\left( \delta_b b \tau\zeta\frac{\bar{r}^b-r_{\min}}{r_{\max}-r_{\min}}\frac{\bar{r}^b+r_{\min}}{2}+\delta_b b \tau\zeta\frac{r^b-\bar{r}^b}{r_{\max}-r_{\min}}r^b+C_{\tau,\zeta}^{r^b}+\delta_b b(T-\tau)\bar{r}^b \right) \tag*{(27)} Utility b adv ≤ ( δ b b τ ζ r m a x − r m i n r ˉ b − r m i n 2 r ˉ b + r m i n + δ b b τ ζ r m a x − r m i n r b − r ˉ b r b + C τ , ζ r b + δ b b ( T − τ ) r ˉ b ) (27)
During the randomization phase, whenever r < r ˉ b r < \bar{r}^b r < r ˉ b , the adversarial borrower pays r r r . There are τ ζ r ˉ b − r min r max − r min \tau\zeta\frac{\bar{r}^b-r_{\min}}{r_{\max}-r_{\min}} τ ζ r m a x − r m i n r ˉ b − r m i n such timeslots with an average rate r ˉ b + r min 2 \frac{\bar{r}^b+r_{\min}}{2} 2 r ˉ b + r m i n . However, the adversary incurs a loss compared to the honest strategy during the exploration phase when r ˉ b < r < r b \bar{r}^b < r < r^b r ˉ b < r < r b , because they cannot borrow from the protocol in these timeslots, even though following the honest strategy, they could have borrowed and made a strict profit compared to borrowing from outside at rate r b r^b r b . This extra cost is the second term δ b b τ ζ r b − r ˉ b r max − r min r b \delta_b b\tau\zeta\frac{r^b-\bar{r}^b}{r_{\max}-r_{\min}}r^b δ b b τ ζ r m a x − r m i n r b − r ˉ b r b . During the rest of the exploration phase timeslots, the cost is the same as if they had followed the honest strategy, hence C τ , ζ r b C_{\tau,\zeta}^{r^b} C τ , ζ r b . Finally, during the exploitation phase, the adversary at best forces C D C_D C D to set r ˉ b \bar{r}^b r ˉ b (we consider r ˉ b \bar{r}^b r ˉ b to be the minimum enforceable rate by A b \mathcal{A}^b A b ). Hence by solving the trade-off between the extra cost incurred during the exploration phase and the strict profit made during the exploration phase by following the adversarial strategy, we find an upper bound on the set of profitable r ˉ b \bar{r}^b r ˉ b .
Utility b a d v − Utility b h o n e s t ≤ − δ b b ( τ ζ 2 ( r b − r ˉ b ) 2 r max − r min + ( T − τ ) ( r ˉ b − r b ) ) (28) \operatorname{Utility}_b^{\mathrm{adv}}-\operatorname{Utility}_b^{\mathrm{honest}} \leq-\delta_b b\left(\frac{\tau\zeta}{2}\frac{(r^b-\bar{r}^b)^2}{r_{\max}-r_{\min}}+(T-\tau)(\bar{r}^b-r^b)\right) \tag*{(28)} Utility b adv − Utility b honest ≤ − δ b b ( 2 τ ζ r m a x − r m i n ( r b − r ˉ b ) 2 + ( T − τ ) ( r ˉ b − r b ) ) (28)
Utility b a d v − Utility b h o n e s t ≥ 0 (29) \operatorname{Utility}_b^{\mathrm{adv}}-\operatorname{Utility}_b^{\mathrm{honest}} \geq0 \tag*{(29)} Utility b adv − Utility b honest ≥ 0 (29)
⟹ ( τ ζ 2 ( r b − r ˉ b ) 2 r max − r min + ( T − τ ) ( r ˉ b − r b ) ) ≤ 0 (30) \Longrightarrow\left(\frac{\tau\zeta}{2}\frac{(r^b-\bar{r}^b)^2}{r_{\max}-r_{\min}}+(T-\tau)(\bar{r}^b-r^b)\right)\leq0 \tag*{(30)} ⟹ ( 2 τ ζ r m a x − r m i n ( r b − r ˉ b ) 2 + ( T − τ ) ( r ˉ b − r b ) ) ≤ 0 (30)
⟹ 0 < r b − r ˉ b < 2 ( r max − r min ) ζ ( T τ − 1 ) (31) \Longrightarrow0<r^b-\bar{r}^b<\frac{2(r_{\max}-r_{\min})}{\zeta}\left(\frac{T}{\tau}-1\right) \tag*{(31)} ⟹ 0 < r b − r ˉ b < ζ 2 ( r m a x − r m i n ) ( τ T − 1 ) (31)
Next, we address the second point: given that C D C_D C D aims to minimize ∣ B ˉ ( r ) − U ∗ ∣ |\bar{B}(r)-U^*| ∣ B ˉ ( r ) − U ∗ ∣ , what is the minimum r ˉ b \bar{r}^b r ˉ b that A b \mathcal{A}^b A b can choose to force C D C_D C D to set r ˉ = r ˉ b \bar{r}=\bar{r}^b r ˉ = r ˉ b ? Additionally, how far can r ˉ \bar{r} r ˉ deviate from r ∗ r^* r ∗ ?
We first express r ∗ r^* r ∗ as a function of the remaining parameters. If the adversary reports r b r^b r b , C D C_D C D solves:
b b ( 1 − δ b ) − a b r L = U ∗ ⟹ r = b b ( 1 − δ b ) − L U ∗ a b \frac{b^b(1-\delta_b)-a^b r}{L}=U^* \Longrightarrow r=\frac{b^b(1-\delta_b)-LU^*}{a^b} L b b ( 1 − δ b ) − a b r = U ∗ ⟹ r = a b b b ( 1 − δ b ) − L U ∗
If r > r b r > r^b r > r b , C D C_D C D does not require the adversary’s demand to achieve optimal utilization. Hence, regardless of the interest rate reported by the adversary, C D C_D C D sets the steady-state interest rate to b b ( 1 − δ b ) − L U ∗ a b \frac{b^b(1-\delta_b)-LU^*}{a^b} a b b b ( 1 − δ b ) − L U ∗ , resulting in no manipulation (r ∗ − r ˉ = 0 r^*-\bar{r}=0 r ∗ − r ˉ = 0 ).
However, if b b ( 1 − δ b ) − a b r b L < U ∗ \frac{b^b(1-\delta_b)-a^b r^b}{L}<U^* L b b ( 1 − δ b ) − a b r b < U ∗ , the utilization with the demand generated by infinitesimal borrowers is lower than U ∗ U^* U ∗ at r b r^b r b . Therefore, C D C_D C D might need to set a lower interest rate than r b r^b r b to incorporate the adversary’s demand. Several scenarios arise:
If b b − a b r b L < U ∗ \frac{b^b-a^b r^b}{L}<U^* L b b − a b r b < U ∗ , even including the adversary’s demand at r b r^b r b , the utilization remains low. In this case, r ∗ r^* r ∗ will be lower than r b r^b r b to attract further demand, given by r ∗ = b b − L U ∗ a b < r b r^*=\frac{b^b-LU^*}{a^b}<r^b r ∗ = a b b b − L U ∗ < r b . The adversary can report any r ˉ \bar{r} r ˉ that satisfies the following conditions to convince C D C_D C D to select r ˉ \bar{r} r ˉ :
b b ( 1 − δ b ) − a b r ˉ L < U ∗ ⟹ r ˉ > b b ( 1 − δ b ) − L U ∗ a b (32) \frac{b^b(1-\delta_b)-a^b\bar{r}}{L}<U^* \Longrightarrow\bar{r}>\frac{b^b(1-\delta_b)-LU^*}{a^b} \tag*{(32)} L b b ( 1 − δ b ) − a b r ˉ < U ∗ ⟹ r ˉ > a b b b ( 1 − δ b ) − L U ∗ (32)
and
U ∗ − b b ( 1 − δ b ) − a b r ˉ L > b b − a b r ˉ L − U ∗ ⟹ r ˉ > b b ( 1 − δ b 2 ) − L U ∗ a b (33) U^*-\frac{b^b(1-\delta_b)-a^b\bar{r}}{L}>\frac{b^b-a^b\bar{r}}{L}-U^* \Longrightarrow\bar{r}>\frac{b^b\left(1-\frac{\delta_b}{2}\right)-LU^*}{a^b} \tag*{(33)} U ∗ − L b b ( 1 − δ b ) − a b r ˉ > L b b − a b r ˉ − U ∗ ⟹ r ˉ > a b b b ( 1 − 2 δ b ) − L U ∗ (33)
In this scenario:
∣ r ∗ − r ˉ ∣ = ∣ b b − L U ∗ a b − b b ( 1 − δ b 2 ) − L U ∗ a b ∣ = b b δ b 2 a b |r^*-\bar{r}|=\left|\frac{b^b-LU^*}{a^b}-\frac{b^b\left(1-\frac{\delta_b}{2}\right)-LU^*}{a^b}\right|=\frac{b^b\delta_b}{2a^b} ∣ r ∗ − r ˉ ∣ = a b b b − L U ∗ − a b b b ( 1 − 2 δ b ) − L U ∗ = 2 a b b b δ b
Next, we consider the following scenario: b b − a b r b L > U ∗ \frac{b^b-a^b r^b}{L}>U^* L b b − a b r b > U ∗ and b b − a b r b L − U ∗ < U ∗ − b b ( 1 − δ b ) − a b r b L \frac{b^b-a^b r^b}{L}-U^*<U^*-\frac{b^b(1-\delta_b)-a^b r^b}{L} L b b − a b r b − U ∗ < U ∗ − L b b ( 1 − δ b ) − a b r b . In this case, attracting the adversary’s demand will cause the utilization to exceed U ∗ U^* U ∗ , but it is closer to U ∗ U^* U ∗ than the case where the adversary is not involved. Consequently, C D C_D C D sets r ∗ = r b − ε r^*=r^b-\varepsilon r ∗ = r b − ε . The adversary can only choose r ˉ \bar{r} r ˉ that satisfies conditions (33) and (34); otherwise, C D C_D C D will choose r > r ˉ r>\bar{r} r > r ˉ . Therefore, we have:
r ˉ > b b ( 1 − δ b 2 ) − L U ∗ a b \bar{r}>\frac{b^b\left(1-\frac{\delta_b}{2}\right)-LU^*}{a^b} r ˉ > a b b b ( 1 − 2 δ b ) − L U ∗
Moreover, we know in this case r ∗ = r b ≤ b b − L U ∗ a b r^*=r^b\le\frac{b^b-LU^*}{a^b} r ∗ = r b ≤ a b b b − L U ∗ . Hence, we again find:
∣ r ∗ − r ˉ ∣ ≤ b b δ b 2 a b |r^*-\bar{r}|\le\frac{b^b\delta_b}{2a^b} ∣ r ∗ − r ˉ ∣ ≤ 2 a b b b δ b
Now, consider the scenario: b b − a b r b L > U ∗ \frac{b^b-a^b r^b}{L}>U^* L b b − a b r b > U ∗ and b b − a b r b L − U ∗ > U ∗ − b b ( 1 − δ b ) − a b r b L \frac{b^b-a^b r^b}{L}-U^*>U^*-\frac{b^b(1-\delta_b)-a^b r^b}{L} L b b − a b r b − U ∗ > U ∗ − L b b ( 1 − δ b ) − a b r b . In this case, attracting the adversary’s demand will cause the utilization to exceed U ∗ U^* U ∗ , and the protocol achieves a utilization closer to U ∗ U^* U ∗ without the adversary’s demand. Consequently, the protocol sets r ∗ = r b + ε r^*=r^b+\varepsilon r ∗ = r b + ε . In this scenario, the adversarial borrower cannot change the steady-state interest rate by misreporting a lower interest rate because the protocol is not willing to set any interest rate equal to or lower than r b r^b r b since this increases the utilization excessively. Therefore, r ∗ − r ˉ = 0 r^*-\bar{r}=0 r ∗ − r ˉ = 0 .
Strategic lender Now, we consider the scenario where there is only one strategic lender, denoted as A l A^l A l , without any strategic borrowers. The adversarial strategy for the lender is to report a higher rate r ˉ l \bar{r}^l r ˉ l instead of r l r^l r l . Refer to Figure 7 for an illustration.
Figure 7. Fig. 7
First, we compare the utility of A l \mathcal{A}^{l} A l under the honest strategy and the adversarial strategy. We assume the lender’s utility is directly proportional to r r r for simplification:
Utility l h o n e s t ≥ ( δ l L τ ζ r max − r l r max − r min r l + r max 2 + C τ , ζ r l + δ l L ( T − τ ) r l ) (34) \operatorname{Utility}^{\mathrm{honest}}_{l} \ge\left(\delta_{l}L\tau\zeta\frac{r_{\max}-r^{l}}{r_{\max}-r_{\min}}\frac{r^{l}+r_{\max}}{2}+C_{\tau,\zeta}^{r^{l}}+\delta_{l}L(T-\tau)r^{l}\right) \tag*{(34)} Utility l honest ≥ ( δ l Lτ ζ r m a x − r m i n r m a x − r l 2 r l + r m a x + C τ , ζ r l + δ l L ( T − τ ) r l ) (34)
Utility l a d v ≤ ( δ l L τ ζ r max − r ˉ l r max − r min r ˉ l + r max 2 + δ l L τ ζ r l − r ˉ l r max − r min r l + C τ , ζ r l + δ l L ( T − τ ) r ˉ l ) (35) \operatorname{Utility}^{\mathrm{adv}}_{l} \le\left(\delta_{l}L\tau\zeta\frac{r_{\max}-\bar{r}^{l}}{r_{\max}-r_{\min}}\frac{\bar{r}^{l}+r_{\max}}{2}+\delta_{l}L\tau\zeta\frac{r^{l}-\bar{r}^{l}}{r_{\max}-r_{\min}}r^{l}
+C_{\tau,\zeta}^{r^{l}}+\delta_{l}L(T-\tau)\bar{r}^{l}\right) \tag*{(35)} Utility l adv ≤ ( δ l Lτ ζ r m a x − r m i n r m a x − r ˉ l 2 r ˉ l + r m a x + δ l Lτ ζ r m a x − r m i n r l − r ˉ l r l + C τ , ζ r l + δ l L ( T − τ ) r ˉ l ) (35)
By finding the range of r ˉ l \bar{r}^{l} r ˉ l that makes Utility l a d v − Utility l h o n e s t > 0 \operatorname{Utility}^{\mathrm{adv}}_{l}-\operatorname{Utility}^{\mathrm{honest}}_{l}>0 Utility l adv − Utility l honest > 0 , we can derive the exact bound as in Equation (31) .
Next, we determine r ∗ r^{*} r ∗ . The controller C D C_{D} C D solves b b − a b r L ( 1 − δ l ) = U ∗ \frac{b^{b}-a^{b}r}{L(1-\delta_{l})}=U^{*} L ( 1 − δ l ) b b − a b r = U ∗ . If r = b b − L ( 1 − δ l ) U ∗ a b < r l r=\frac{b^{b}-L(1-\delta_{l})U^{*}}{a^{b}}<r^{l} r = a b b b − L ( 1 − δ l ) U ∗ < r l , the protocol can achieve the desired utilization without A l \mathcal{A}^{l} A l ’s supply, and A l \mathcal{A}^{l} A l cannot manipulate the interest rate, resulting in r ˉ − r ∗ = 0 \bar{r}-r^{*}=0 r ˉ − r ∗ = 0 . If b b − a b r l L ( 1 − δ l ) > U ∗ \frac{b^{b}-a^{b}r^{l}}{L(1-\delta_{l})}>U^{*} L ( 1 − δ l ) b b − a b r l > U ∗ , A l \mathcal{A}^{l} A l ’s supply is necessary for maintaining the desired utilization. The following cases are possible:
If b b − a b r l L > U ∗ \frac{b^{b}-a^{b}r^{l}}{L}>U^{*} L b b − a b r l > U ∗ , even with A l \mathcal{A}^{l} A l ’s funds, r ∗ = b b − L U ∗ a b r^{*}=\frac{b^{b}-LU^{*}}{a^{b}} r ∗ = a b b b − L U ∗ . In this case, A l \mathcal{A}^{l} A l can misreport any r ˉ l \bar{r}^{l} r ˉ l that satisfies:
b b − a b r ˉ L ( 1 − δ l ) > U ∗ ⟹ r ˉ < b b − L ( 1 − δ l ) U ∗ a b (36) \frac{b^{b}-a^{b}\bar{r}}{L(1-\delta_{l})}>U^{*}\Longrightarrow\bar{r}<\frac{b^{b}-L(1-\delta_{l})U^{*}}{a^{b}} \tag*{(36)} L ( 1 − δ l ) b b − a b r ˉ > U ∗ ⟹ r ˉ < a b b b − L ( 1 − δ l ) U ∗ (36)
and
b b − a b r ˉ L ( 1 − δ l ) − U ∗ > U ∗ − b b − a b r ˉ L ⟹ r ˉ < b b − U ∗ L 1 − δ l 1 − δ l 2 a b (37) \frac{b^{b}-a^{b}\bar{r}}{L(1-\delta_{l})}-U^{*}>U^{*}-\frac{b^{b}-a^{b}\bar{r}}{L}\Longrightarrow\bar{r}<\frac{b^{b}-U^{*}L\frac{1-\delta_{l}}{1-\frac{\delta_{l}}{2}}}{a^{b}} \tag*{(37)} L ( 1 − δ l ) b b − a b r ˉ − U ∗ > U ∗ − L b b − a b r ˉ ⟹ r ˉ < a b b b − U ∗ L 1 − 2 δ l 1 − δ l (37)
Therefore, ∣ r ˉ − r ∗ ∣ < U ∗ L δ l a b ( 2 − δ l ) |\bar{r}-r^{*}|<\frac{U^{*}L\delta_{l}}{a^{b}(2-\delta_{l})} ∣ r ˉ − r ∗ ∣ < a b ( 2 − δ l ) U ∗ L δ l .
If b b − a b r l L < U ∗ \frac{b^{b}-a^{b}r^{l}}{L}<U^{*} L b b − a b r l < U ∗ , but b b − a b r l L ( 1 − δ l ) − U ∗ > U ∗ − b b − a b r l L \frac{b^{b}-a^{b}r^{l}}{L(1-\delta_{l})}-U^{*}>U^{*}-\frac{b^{b}-a^{b}r^{l}}{L} L ( 1 − δ l ) b b − a b r l − U ∗ > U ∗ − L b b − a b r l holds, C D C_{D} C D sets r l + ε r^{l}+\varepsilon r l + ε to get A l \mathcal{A}^{l} A l ’s demand with maximum utilization possible. Again, A l \mathcal{A}^{l} A l can report interest rates as high as b b − U ∗ L 1 − δ l 1 − δ l 2 a b \frac{b^{b}-U^{*}L\frac{1-\delta_{l}}{1-\frac{\delta_{l}}{2}}}{a^{b}} a b b b − U ∗ L 1 − 2 δ l 1 − δ l and get C D C_{D} C D to set this rate. Since r ∗ = r l > b b − L U ∗ a b r^{*}=r^{l}>\frac{b^{b}-LU^{*}}{a^{b}} r ∗ = r l > a b b b − L U ∗ , ∣ r ˉ − r ∗ ∣ < U ∗ L δ l a b ( 2 − δ l ) |\bar{r}-r^{*}|<\frac{U^{*}L\delta_{l}}{a^{b}(2-\delta_{l})} ∣ r ˉ − r ∗ ∣ < a b ( 2 − δ l ) U ∗ L δ l .
If b b − a b r l L < U ∗ \frac{b^{b}-a^{b}r^{l}}{L}<U^{*} L b b − a b r l < U ∗ and b b − a b r l L ( 1 − δ l ) − U ∗ > U ∗ − b b − a b r l L \frac{b^{b}-a^{b}r^{l}}{L(1-\delta_{l})}-U^{*}>U^{*}-\frac{b^{b}-a^{b}r^{l}}{L} L ( 1 − δ l ) b b − a b r l − U ∗ > U ∗ − L b b − a b r l does not hold, C D C_{D} C D gets closer to U ∗ U^{*} U ∗ by setting r ∗ = r l − ε r^{*}=r^{l}-\varepsilon r ∗ = r l − ε and not involving A l \mathcal{A}^{l} A l ’s funds at all. In this case, A l \mathcal{A}^{l} A l cannot manipulate the interest rate.
Strategic Lender and Borrower In the presence of both strategic lenders and borrowers, the potential manipulation of the interest rate is bounded by the influence each could exert in isolation. The strategic borrower (A b \mathcal{A}^{b} A b ) aims to report the minimum rate, while the strategic lender (A l \mathcal{A}^{l} A l ) aims to report the maximum rate. If the protocol requires only one of them to achieve the desired utilization, the scenario reduces to the case of a single adversary. However, if C D C_{D} C D needs both A b \mathcal{A}^{b} A b ’s demand and A l \mathcal{A}^{l} A l ’s supply to achieve the desired utilization, the party controlling a larger market share may influence the rate more significantly. Despite this, the rate manipulation cannot exceed the influence they would have if they were the sole adversary, assuming all other participants are truthful. This is because C D C_{D} C D aims to satisfy both A b \mathcal{A}^{b} A b and A l \mathcal{A}^{l} A l , making it more challenging for either party to manipulate the rate to an extreme due to the inherent competition between them.
Proof of Theorem 4.3
Proof. A l \mathcal{A}^{l} A l has a more severe impact on the interest rate when A b \mathcal{A}^{b} A b is absent, and vice versa, because they push the rate in opposite directions. Therefore, evaluating each adversary separately while assuming the other is truthful provides an upper bound on their combined adversarial effects. We begin by analyzing the lender’s utility function to determine the optimal L ^ \hat{L} L ^ that maximizes utility. For simplicity, we omit the utilization term multiplier B ( 1 − δ l ) L + L ^ \frac{B}{(1-\delta_{l})L+\hat{L}} ( 1 − δ l ) L + L ^ B . Moreover, we replace ϕ ( U ) \phi(U) ϕ ( U ) in the Utility function with the steeper section of the baseline curve, for simplicity, we call the slope and intercept of the curve in the steeper part respectively by α \alpha α and β \beta β :
α : = R s l o p e 2 1 − U ∗ , β : = R s l o p e 1 − R s l o p e 2 U ∗ 1 − U ∗ . \alpha:=\frac{R_{\mathrm{slope2}}}{1-U^{*}},\qquad\beta:=R_{\mathrm{slope1}}-R_{\mathrm{slope2}}\frac{U^{*}}{1-U^{*}}. α := 1 − U ∗ R slope2 , β := R slope1 − R slope2 1 − U ∗ U ∗ .
Focusing on the steeper part of the curve intensifies the attack, as it increases lenders’ incentives to strategically withhold deposits. Even small withholdings can significantly impact the interest rate since in this region the interest rate is very sensitive to changes of utilization.
We take the derivative of utilization with respect to L ^ \hat{L} L ^ and set it to zero, to find the optimal L ^ \hat{L} L ^ for a strategic lender.
d U t i l i t y A l ( L ^ ) d L ^ = 0 ⟹ L ^ s t r t g c = L ( 1 − δ l ) ( β − r o l ) + B L ( 1 − δ l ) α ( r o l − β ) r o l − β = − L ( 1 − δ l ) + B L ( 1 − δ l ) α r o l − β \begin{aligned}
\frac{d\,\mathrm{Utility}_{\mathcal{A}^{l}}(\hat{L})}{d\hat{L}}=0\ \Longrightarrow\ \hat{L}_{\mathrm{strtgc}}=\frac{L(1-\delta_{l})(\beta-r_{o}^{l})+\sqrt{BL(1-\delta_{l})\alpha(r_{o}^{l}-\beta)}}{r_{o}^{l}-\beta} \\
&=-L(1-\delta_{l})+\sqrt{\frac{BL(1-\delta_{l})\alpha}{r_{o}^{l}-\beta}}
\end{aligned} d L ^ d Utility A l ( L ^ ) = 0 ⟹ L ^ strtgc = r o l − β L ( 1 − δ l ) ( β − r o l ) + B L ( 1 − δ l ) α ( r o l − β ) = − L ( 1 − δ l ) + r o l − β B L ( 1 − δ l ) α
We note that in order for the attack to be effective L ^ s t r t g c \hat{L}_{\mathrm{strtgc}} L ^ strtgc should be greater than zero and less than δ L \delta L δ L , hence:
L ^ s t r t g c > 0 ⟹ r o l ≤ B α L ( 1 − δ l ) + β (38) \hat{L}_{\mathrm{strtgc}} > 0 \ \Longrightarrow\ r_o^l \le\frac{B\alpha}{L(1-\delta_l)}+\beta \tag*{(38)} L ^ strtgc > 0 ⟹ r o l ≤ L ( 1 − δ l ) B α + β (38)
Now we compare the utilization when A l \mathcal{A}^l A l behaves truthfully versus when it behaves strategically. Behaving truthfully based on the definition means that A l \mathcal{A}^l A l will add deposit as long as the ϕ ( B ( 1 − δ ) L + L ^ ) ≥ r o l \phi\left(\frac{B}{(1-\delta)L+\hat{L}}\right) \ge r_o^l ϕ ( ( 1 − δ ) L + L ^ B ) ≥ r o l , so the truthful supply for A l \mathcal{A}^l A l is:
L ^ t r t h f l : = arg max L ^ ≤ δ L { L ^ | α ( B ( 1 − δ ) L + L ^ ) + β ≥ r o l } \hat{L}_{\mathrm{trthfl}} := \arg\max_{\hat{L}\le\delta L}\left\{\hat{L}\ \middle|\ \alpha\left(\frac{B}{(1-\delta)L+\hat{L}}\right)+\beta\ge r_o^l\right\} L ^ trthfl := arg L ^ ≤ δ L max { L ^ α ( ( 1 − δ ) L + L ^ B ) + β ≥ r o l }
We are interested in max ∣ U s t r t g c − U t r t h f l ∣ \max\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right| max ∣ U strtgc − U trthfl ∣ where U s t r t g c : = B L ( 1 − δ l ) + L ^ s t r t g c U_{\mathrm{strtgc}}:=\frac{B}{L(1-\delta_l)+\hat{L}_{\mathrm{strtgc}}} U strtgc := L ( 1 − δ l ) + L ^ strtgc B and U t r t h f l : = B L ( 1 − δ l ) + L ^ t r t h f l U_{\mathrm{trthfl}}:=\frac{B}{L(1-\delta_l)+\hat{L}_{\mathrm{trthfl}}} U trthfl := L ( 1 − δ l ) + L ^ trthfl B
We have:
∣ U s t r t g c − U t r t h f l ∣ = U s t r t g c − U t r t h f l ≤ U s t r t g c − B L ≤ B L ( 1 − δ l ) − B L ≤ δ l B L ( 1 − δ l ) \begin{aligned}
\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right| &= U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}} \\
&\le U_{\mathrm{strtgc}}-\frac{B}{L} \\
&\le\frac{B}{L(1-\delta_l)}-\frac{B}{L} \\
&\le\frac{\delta_l B}{L(1-\delta_l)}
\end{aligned} ∣ U strtgc − U trthfl ∣ = U strtgc − U trthfl ≤ U strtgc − L B ≤ L ( 1 − δ l ) B − L B ≤ L ( 1 − δ l ) δ l B
Hence:
A I P ( δ b , δ l , B , L ) = ∣ r s t r t g c − r t r t h f l ∣ = α ∣ U s t r t g c − U t r t h f l ∣ ≤ B δ l R s l o p e 2 L ( 1 − δ l ) ( 1 − U ∗ ) \begin{aligned}
AI^{\mathcal{P}}(\delta_b,\delta_l,B,L) &= \left|r_{\mathrm{strtgc}}-r_{\mathrm{trthfl}}\right| \\
&= \alpha\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right| \\
&\le\frac{B\delta_l R_{\mathrm{slope2}}}{L(1-\delta_l)(1-U^*)}
\end{aligned} A I P ( δ b , δ l , B , L ) = ∣ r strtgc − r trthfl ∣ = α ∣ U strtgc − U trthfl ∣ ≤ L ( 1 − δ l ) ( 1 − U ∗ ) B δ l R slope2
Now we do a similar analysis for the borrower:
d U t i l i t y A b ( B ^ ) d B ^ = 0 ⟹ B ^ s t r t g c = r o b − β 2 α / L − B ( 1 − δ b ) 2 (39) \frac{d\ \mathrm{Utility}_{\mathcal{A}^b}(\hat{B})}{d\hat{B}}=0 \ \Longrightarrow\ \hat{B}_{\mathrm{strtgc}}=\frac{r_o^b-\beta}{2\alpha/L}-\frac{B(1-\delta_b)}{2} \tag*{(39)} d B ^ d Utility A b ( B ^ ) = 0 ⟹ B ^ strtgc = 2 α / L r o b − β − 2 B ( 1 − δ b ) (39)
Moreover, by definition:
B ^ t r t h f l : = arg max B ^ ≤ B δ b { B ^ | α B ( 1 − δ b ) + B ^ L + β ≤ r o b } \hat{B}_{\mathrm{trthfl}}:=\arg\max_{\hat{B}\le B\delta_b}\left\{\hat{B}\ \middle|\ \alpha\frac{B(1-\delta_b)+\hat{B}}{L}+\beta\le r_o^b\right\} B ^ trthfl := arg B ^ ≤ B δ b max { B ^ α L B ( 1 − δ b ) + B ^ + β ≤ r o b }
We note that strategic withholding attack is only relevant if the strategic player borrows strictly less than the truthful borrower therefore B ^ t r t h f l > 0 \hat{B}_{\mathrm{trthfl}}>0 B ^ trthfl > 0 , this means that
α B ( 1 − δ b ) L + β ≤ r o b (40) \frac{\alpha B(1-\delta_b)}{L}+\beta\le r_o^b \tag*{(40)} L α B ( 1 − δ b ) + β ≤ r o b (40)
We are interested in max ∣ U s t r t g c − U t r t h f l ∣ \max\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right| max ∣ U strtgc − U trthfl ∣ where U s t r t g c : = B ( 1 − δ b ) + B ^ s t r t g c L U_{\mathrm{strtgc}}:=\frac{B(1-\delta_b)+\hat{B}_{\mathrm{strtgc}}}{L} U strtgc := L B ( 1 − δ b ) + B ^ strtgc and U t r t h f l : = B ( 1 − δ b ) + B ^ t r t h f l L U_{\mathrm{trthfl}}:=\frac{B(1-\delta_b)+\hat{B}_{\mathrm{trthfl}}}{L} U trthfl := L B ( 1 − δ b ) + B ^ trthfl . In an effective attack, A b \mathcal{A}^b A b borrowers less compare to the truthful alternative, hence causing a lower utilization:
∣ U s t r t g c − U t r t h f l ∣ = U t r t h f l − U s t r t g c ≤ B L − U s t r t g c = B L − B ( 1 − δ b ) 2 + r b b − β 2 α L (41) \begin{aligned}
\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right|=U_{\mathrm{trthfl}}-U_{\mathrm{strtgc}} \\
&\le\frac{B}{L}-U_{\mathrm{strtgc}}
=\frac{B}{L}-\frac{\frac{B(1-\delta_b)}{2}+\frac{r_b^b-\beta}{2\alpha}}{L} \tag*{(41)}
\end{aligned} ∣ U strtgc − U trthfl ∣ = U trthfl − U strtgc ≤ L B − U strtgc = L B − L 2 B ( 1 − δ b ) + 2 α r b b − β (41)
< B ( 1 + δ b ) 2 L − α B ( 1 − δ b ) L ( 2 α / L ) = B δ b L (42) <\frac{B(1+\delta_b)}{2L}-\frac{\alpha B(1-\delta_b)}{L(2\alpha/L)}=\frac{B\delta_b}{L} \tag*{(42)} < 2 L B ( 1 + δ b ) − L ( 2 α / L ) α B ( 1 − δ b ) = L B δ b (42)
Hence:
A I P ( δ b , δ l , B , L ) = ∣ r s t r t g c − r t r t h f l ∣ = α ∣ U s t r t g c − U t r t h f l ∣ ≤ B δ b R s l o p e 2 L ( 1 − U ∗ ) AI^P(\delta_b,\delta_l,B,L)=\left|r_{\mathrm{strtgc}}-r_{\mathrm{trthfl}}\right|
=\alpha\left|U_{\mathrm{strtgc}}-U_{\mathrm{trthfl}}\right|
\le\frac{B\delta_b R_{\mathrm{slope2}}}{L(1-U^*)} A I P ( δ b , δ l , B , L ) = ∣ r strtgc − r trthfl ∣ = α ∣ U strtgc − U trthfl ∣ ≤ L ( 1 − U ∗ ) B δ b R slope2
Least square estimation related work
Recursive least square estimation Recursive least squares (RLS) estimation is an online adaptation of the standard least squares method, enabling efficient updating of parameter estimates as new data becomes available. While applying the full least squares estimator to n n n datapoints incurs a computational cost of Θ ( n 2 ) \Theta(n^2) Θ ( n 2 ) , the RLS algorithm reduces this complexity to Θ ( n ) \Theta(n) Θ ( n ) [41 ] . To accommodate time-varying parameters, the RLS algorithm is typically augmented with a forgetting factor, which assigns exponentially decaying weights to older datapoints [28 ] . Notably, there exists a close relationship between RLS with a forgetting factor and Kalman filtering. In fact, [40 ] demonstrates that minimizing a weighted least squares loss is equivalent to estimating the state in a Kalman filter with state evolution given by x i + 1 = x i λ x_{i+1}=\frac{x_i}{\sqrt{\lambda}} x i + 1 = λ x i , hence a smaller forgetting factor λ \lambda λ is appropriate for more rapidly changing conditions. Moreover, Canetti et al. [9 ] establish a trade-off between estimation precision and adaptivity: while setting λ = 1 \lambda=1 λ = 1 (i.e., no forgetting) perfectly cancels the effect of measurement noise, it impedes the algorithm’s ability to track changes in the system. Therefore, selecting the appropriate forgetting factor is critical and should reflect the pace of the underlying dynamics. To this end, Paleologu et al. [36 ] propose tuning the forgetting factor based on the posterior estimation error, aligning it with the noise variance to ensure that the estimator’s error matches the expected noise level.
Robust linear estimation Conventional recursive least squares (RLS) estimators lack robustness to outliers due to their linear structure. While nonlinear transformations of residuals can mitigate impulsive noise [29 , 46 ] , such approaches remain vulnerable to strategic adversarial corruptions that subtly bias estimates without extreme outliers. Bhati et al. [7 ] employ hard thresholding to identify adversarial samples, guaranteeing exact parameter recovery under bounded corruption. However, their framework requires multiple full-batch iterations to find the clean data points, rendering them unsuitable and inefficient for recursive settings with dynamically evolving parameters. Chen et al. explore the adversarial robustness of Kalman filtering under probabilistic corruption models [12 ] , where they theoretically guarantee sublinear regret in competing with an oracle aware of corruption locations, but they fail to suggest a practical algorithm. Alternative approaches [43 ] model the adversary as long-tail observation noise but with a known distribution which limits real-world applicability.