IRM Authoring

Complete guide to designing, configuring, and operating custom interest rate models for Lotus markets including adaptive, managed, and fixed rate curves.

Lotus lets markets choose their interest rate model (IRM). This page covers how to author and operate IRMs safely.

circle-exclamation

When to Build a Custom IRM

Build a custom IRM when the default adaptive linear kink model does not match your market's rate dynamics:

  • You need a distinct rate policy per collateral or market structure.

  • You want managed parameters (operator‑driven) vs adaptive (signal‑driven).

Design Choices

  • Curve family: linear kink, exponential, fixed, or hybrid.

  • Control strategy: adaptive (auto‑tuning) vs managed (operator updates).

  • Guardrails: min/max rates, max per‑update delta, min update interval, grace periods.

Configuration Bounds

  • Target utilization: choose ranges that reflect realistic liquidity goals.

  • Base/target rates: express in per‑second wads; cap global maxima.

  • Slopes: enforce non‑negative slopes; cap steep region aggressiveness.

Operational Safeguards

  • Timelocks or staged changes for managed models.

  • Pausable adaptation for adaptive models.

  • Eventing for visibility (config changes, updates, out‑of‑band corrections).

Minimal IRM Implementation

Every IRM must implement the IIrm interface: initialize for setup and getTrancheBorrowRate for rate computation.

Function
Purpose

initialize

Called once at market creation; decode irmParams and store config

getTrancheBorrowRate

Called on every interest accrual; return rate in WAD per second

Testing Checklist

  • Low/mid/high utilization scenarios; kink transition continuity.

  • Stress tests for update cadence and max change bounds.

  • Interaction with tranche utilization computation and accrual cadence.

spinner

Guardrails applied:

  • Grace period: dampens updates for new markets.

  • Min update interval: prevents rapid-fire rate changes.

  • Max rate change: caps delta per update for stability.

  • Rate bounds: absolute min/max rate limits.

  • Interaction count: optional seeding protection.

See Also

Last updated