IRM Authoring
Complete guide to designing, configuring, and operating custom interest rate models for Lotus markets including adaptive, managed, and fixed rate curves.
Last updated
Complete guide to designing, configuring, and operating custom interest rate models for Lotus markets including adaptive, managed, and fixed rate curves.
Last updated
┌─────────────────────────────────────────────────────────────────────┐
│ IRM Update and Rate Evaluation Flow │
│ (Adaptive Linear Kink Example) │
└─────────────────────────────────────────────────────────────────────┘
getBorrowRate() called
│
▼
┌─────────────────────────┐
│ Calculate Utilization │
│ u = borrow / supply │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐ NO
│ Should Update State? ├──────────┐
│ - Grace period over? │ │
│ - Min interval passed? │ │
│ - Not paused? │ │
└────────────┬────────────┘ │
│ YES │
▼ │
┌─────────────────────────┐ │
│ Update Adaptive State │ │
│ │ │
│ Δ = (u - targetU) │ │
│ adjustment = f(Δ) │ │
│ │ │
│ New rate = clamp( │ │
│ oldRate + adjustment,│ │
│ oldRate - maxChange, │ │
│ oldRate + maxChange │ │
│ ) │ │
└────────────┬────────────┘ │
│ │
▼ │
┌─────────────────────────┐ │
│ Store Updated State │ │
│ - rateAtTarget │ │
│ - lastUtilization │ │
│ - lastUpdate │ │
└────────────┬────────────┘ │
│ │
└───────────┬───────────┘
│
▼
┌──────────────────────────────┐
│ Apply Kink Curve │
│ │
│ if u < targetUtilization: │
│ rate = baseRate + │
│ u * gentleSlope │
│ │
│ else: │
│ rate = rateAtTarget + │
│ (u - targetU) * │
│ steepSlope │
└──────────────┬───────────────┘
│
▼
Return borrow rate
Guardrails Applied:
┌──────────────────────────────────────────────────────────────┐
│ • Grace Period: Dampens updates for new markets │
│ • Min Update Interval: Prevents rapid-fire rate changes │
│ • Max Rate Change: Caps Δ per update for stability │
│ • Rate Bounds: Absolute min/max rate limits │
│ • Interaction Count: Optional seeding protection │
└──────────────────────────────────────────────────────────────┘