MathFin
Map / Risk · Credit portfolio risk / MathFin.Markets.DeFi.Aave

Aave v2: kinked interest-rate model, health factor, liquidity index

MathFin.Markets.DeFi.AaveMSC 91G80JEL G23 source

Adapted from the Aave v2 whitepaper (Aave, "Aave Protocol V2", 2020, <https://github.com/aave/protocol-v2/blob/master/aave-v2-whitepaper.pdf>), §5 ("Formal Definitions"), which states the kinked borrow-rate model and the health factor; the liquidity-index recurrence is §3.1 ("aTokens").

Main definitions

  • kinkedRate: the piecewise-linear Aave v2 borrow rate in the utilization U, with optimal utilization Uopt and slopes slope1, slope2.
  • healthFactorV1: the single-asset health factor collateral * liquidationThreshold / (borrows + fees).
  • healthFactorV2: the multi-asset health factor summed over i ∈ s.
  • liquidityIndexStep: the per-period growth factor R * U * ΔT / Tyear + 1 of the liquidity index.
  • stableRateUpdate: the stable-rate weighted average after a new stable-rate borrow.

Main results

  • kinkedRate_apply_optimal: the rate at the kink is R₀ + slope1, for Uopt ≠ 0 (the value of the U ≤ Uopt branch).
  • kinkedRate_eq_affine_add_hinge: for Uopt ≠ 0 the kinked curve is an affine rate plus (slope2/(1 − Uopt) − slope1/Uopt) · max (U − Uopt) 0, a call payoff on utilization struck at the kink; hence continuous_kinkedRate, the curve is continuous (at the kink included).
  • kinkedRate_monotone: the curve is monotone nondecreasing on [0, 1] when 0 < Uopt < 1 and both slopes are nonnegative.
  • healthFactorV1, healthFactorV2: the single-asset and multi-asset (summed) health-factor definitions; healthFactorV1_lt_one_iff, the liquidation criterion Hf < 1 ↔ collateral · LT < debt (whitepaper §5: below 1 the loan "can be liquidated"). The probability of Hf < 1 at a horizon, for lognormal collateral, is prob_healthFactorV1_lt_one_eq_kmvPD in MathFin/Markets/DeFi/LiquidationAsStructuralDefault.lean.
  • liquidityIndexStep, liquidityIndex_eq_prod_mul: the linear recurrence LI_t = (R_t·U_t·ΔT/T_year + 1)·LI_{t-1} and its closed-form (product) solution, matching the whitepaper's LiquidityRate_t = BorrowRate_t·U_t exactly (R here stands for BorrowRate). Scope disclosure: the deployed DefaultReserveInterestRateStrategy contract additionally multiplies by (1 − reserveFactor), a refinement not in the whitepaper and not modeled here (equivalently, the reserveFactor = 0 simplification relative to the on-chain contract).
  • liquidityIndex_eq_pow_mul, tendsto_liquidityIndexStep_pow: at a constant borrow rate and utilization the index grows by a power of one step factor, and splitting a horizon into n equal update intervals, that power tends to 1 / zcb (R·U) 0 (T/Tyear) — continuous compounding at the liquidity rate, the library's zero-coupon bond (Models/Rates/PeriodicCompounding.lean). Time-varying rates are not covered by the limit.
  • stableRateUpdate, stableRateUpdate_mem_interval: the weighted-average new stable rate, shown to lie in [SRprev, SRnew] when the new borrower's rate is at least the pool's prior average, the prior stable debt is nonnegative and the new borrow is positive.

Tags

Aave protocol, lending pool, borrow rate, utilization, health factor, liquidation, liquidity index, MSC 91G80, JEL G23

Import neighbourhood

Above: what it imports. Below: what imports it.

Declarations 16

defMathFin.DeFi.Aave.kinkedRatesource
ℝ → ℝ → ℝ → ℝ → ℝ → ℝ

Aave v2 kinked borrow-rate model (whitepaper §5, Formal Definitions): below the optimal utilization U_opt, the rate rises linearly from R₀ with slope slope1/U_opt; above it, it rises linearly from R₀ + slope1 with slope slope2/(1-U_opt). U_opt ∈ (0,1) is the kink location.

theoremMathFin.DeFi.Aave.kinkedRate_apply_optimalsource
∀ (R₀ slope1 slope2 Uopt : ℝ), Uopt ≠ 0 → kinkedRate R₀ slope1 slope2 Uopt Uopt = R₀ + slope1

The rate at the kink is R₀ + slope1 — the value the U ≤ Uopt branch takes at U = Uopt. That the else branch approaches the same value is continuous_kinkedRate.

theoremMathFin.DeFi.Aave.kinkedRate_eq_affine_add_hingesource
∀ (R₀ slope1 slope2 : ℝ) {Uopt : ℝ}, Uopt ≠ 0 → ∀ (U : ℝ), kinkedRate R₀ slope1 slope2 Uopt U = R₀ + slope1 / Uopt * U + (slope2 / (1 - Uopt) - slope1 / Uopt) * max (U - Uopt) 0

The kinked rate is an affine rate plus a call on utilization. For Uopt ≠ 0,

kinkedRate R₀ slope1 slope2 Uopt U = R₀ + (slope1/Uopt)·U + c · max (U − Uopt) 0,

with c = slope2/(1−Uopt) − slope1/Uopt the jump in slope at the kink. Below the kink only the affine part is active; above it the hinge max (U − Uopt) 0, the payoff of a call on utilization struck at Uopt, adds the jump.

theoremMathFin.DeFi.Aave.continuous_kinkedRatesource
∀ (R₀ slope1 slope2 : ℝ) {Uopt : ℝ}, Uopt ≠ 0 → Continuous (kinkedRate R₀ slope1 slope2 Uopt)

The kinked rate is continuous for Uopt ≠ 0, at the kink included: by kinkedRate_eq_affine_add_hinge it is an affine function plus a multiple of max (U − Uopt) 0.

theoremMathFin.DeFi.Aave.kinkedRate_monotonesource
∀ {R₀ slope1 slope2 Uopt : ℝ}, 0 < Uopt → Uopt < 1 → 0 ≤ slope1 → 0 ≤ slope2 → MonotoneOn (kinkedRate R₀ slope1 slope2 Uopt) (Set.Icc 0 1)

Monotonicity on [0,1]: if 0 < Uopt < 1 and both slopes are nonnegative, the kinked rate is monotone nondecreasing in utilization U.

defMathFin.DeFi.Aave.healthFactorV1source
ℝ → ℝ → ℝ → ℝ → ℝ

Aave v1/v2 single-asset health factor: collateral weighted by its liquidation threshold, over total debt (borrows plus accrued fees). Values > 1 indicate a safe position.

theoremMathFin.DeFi.Aave.one_lt_healthFactorV1_iffsource
∀ {collateral liquidationThreshold borrows fees : ℝ}, 0 < borrows + fees → (1 < healthFactorV1 collateral liquidationThreshold borrows fees ↔ borrows + fees < collateral * liquidationThreshold)

Health factor safety criterion: 1 < Hf ↔ debt < collateral·LT, when total debt is positive.

theoremMathFin.DeFi.Aave.healthFactorV1_lt_one_iffsource
∀ {collateral liquidationThreshold borrows fees : ℝ}, 0 < borrows + fees → (healthFactorV1 collateral liquidationThreshold borrows fees < 1 ↔ collateral * liquidationThreshold < borrows + fees)

Liquidation criterion: Hf < 1 ↔ collateral·LT < debt, when total debt is positive. The Aave v2 whitepaper (§5, Formal Definitions) calls a loan with Hf < 1 undercollateralised and liquidatable.

defMathFin.DeFi.Aave.healthFactorV2source
{ι : Type u_1} → Finset ι → (ι → ℝ) → (ι → ℝ) → (ι → ℝ) → ℝ

Aave v2 multi-asset health factor: summed over the borrower's assets i ∈ s, collateral weighted by each asset's liquidation threshold over total borrows across assets.

theoremMathFin.DeFi.Aave.one_lt_healthFactorV2_iffsource
∀ {ι : Type u_1} {s : Finset ι} {collateral liquidationThreshold borrows : ι → ℝ}, 0 < ∑ i ∈ s, borrows i → (1 < healthFactorV2 s collateral liquidationThreshold borrows ↔ ∑ i ∈ s, borrows i < ∑ i ∈ s, collateral i * liquidationThreshold i)

Multi-asset health factor safety criterion, the healthFactorV2 analogue of one_lt_healthFactorV1_iff.

defMathFin.DeFi.Aave.liquidityIndexStepsource
ℝ → ℝ → ℝ → ℝ → ℝ

Aave v2 liquidity-index recurrence (whitepaper §3.1, aTokens): the index accrues each period by the per-period yield R · U · ΔT / T_year, where R stands for the borrow rate, matching the whitepaper's LiquidityRate_t = BorrowRate_t·U_t exactly. Scope disclosure: the deployed DefaultReserveInterestRateStrategy contract additionally multiplies by (1 − reserveFactor), a refinement not in the whitepaper and not modeled here.

theoremMathFin.DeFi.Aave.liquidityIndex_eq_prod_mulsource
∀ (LI R U : ℕ → ℝ) (ΔT Tyear : ℝ), (∀ (n : ℕ), LI (n + 1) = liquidityIndexStep (R (n + 1)) (U (n + 1)) ΔT Tyear * LI n) → ∀ (n : ℕ), LI n = (∏ t ∈ Finset.range n, liquidityIndexStep (R (t + 1)) (U (t + 1)) ΔT Tyear) * LI 0

Closed form of the liquidity-index recurrence: given a sequence LI satisfying LI (n+1) = liquidityIndexStep (R (n+1)) (U (n+1)) ΔT Tyear * LI n for every step, the index after n steps equals the initial index times the product of all per-step growth factors. Proved by induction on n.

theoremMathFin.DeFi.Aave.liquidityIndex_eq_pow_mulsource
∀ (LI : ℕ → ℝ) (R U ΔT Tyear : ℝ), (∀ (n : ℕ), LI (n + 1) = liquidityIndexStep R U ΔT Tyear * LI n) → ∀ (n : ℕ), LI n = liquidityIndexStep R U ΔT Tyear ^ n * LI 0

Constant rates: the index grows by a power of one step factor. If the borrow rate R and utilization U do not change, liquidityIndex_eq_prod_mul collapses to LI n = liquidityIndexStep R U ΔT Tyear ^ n · LI 0.

theoremMathFin.DeFi.Aave.tendsto_liquidityIndexStep_powsource
∀ (R U T Tyear : ℝ), Filter.Tendsto (fun n => liquidityIndexStep R U (T / ↑n) Tyear ^ n) Filter.atTop (nhds (zcb (R * U) 0 (T / Tyear))⁻¹)

Frequent updates converge to continuous compounding at the liquidity rate. At a constant borrow rate R and utilization U, splitting a horizon T into n equal update intervals T / n gives the index growth liquidityIndexStep R U (T / n) Tyear ^ n, which tends to 1 / zcb (R·U) 0 (T / Tyear) = exp (R·U·T/Tyear) as n → ∞. Each step accrues linear interest; the limit is the zero-coupon bond's continuous compounding.

defMathFin.DeFi.Aave.stableRateUpdatesource
ℝ → ℝ → ℝ → ℝ → ℝ

Aave v2 stable-rate weighted average (whitepaper §3.4): when a new stable-rate borrow of size SBnew at rate SRnew joins an existing stable debt pool SDprev at average rate SRprev, the new pool average is the debt-weighted mean of the two rates.

theoremMathFin.DeFi.Aave.stableRateUpdate_mem_intervalsource
∀ {SRprev SDprev SRnew SBnew : ℝ}, 0 ≤ SDprev → 0 < SBnew → SRprev ≤ SRnew → SRprev ≤ stableRateUpdate SRprev SDprev SRnew SBnew ∧ stableRateUpdate SRprev SDprev SRnew SBnew ≤ SRnew

The updated stable rate lies between the previous average and the new borrower's rate when the new borrower's rate is at least the prior average (hle : SRprev ≤ SRnew), the prior stable debt is nonnegative and the new borrow is positive. It is a weighted average with nonnegative weights and positive total weight, so it cannot exceed (resp. fall below) the larger (resp. smaller) of the two inputs.