Skip to main content
Auto-deleverage is a softer alternative to immediate liquidation. When a position crosses an unhealthy threshold, the curator (or an off-chain bot) marks it for deleveraging: the borrower receives a grace period to self-deleverage, and only after the grace period elapses does liquidation become available — at a ramped bonus that grows over time. This is a niche feature most curators leave disabled. Standard Liquidations (immediate, threshold-triggered) are sufficient for most markets. Enable auto-deleverage when you specifically want a borrower-friendly margin-call window before liquidations open up.

When this is useful

Market-level enablement

Reserve-level config

Configure auto-deleverage via SDK

Auto-deleverage is enabled through standard market and reserve config updates.

Enable on the market

Enable on a reserve

Marking a position for deleveraging

The markObligationForDeleveraging instruction is exposed via the SDK codegen. An off-chain monitor (or any wallet) can submit it once a position breaches insolvency_risk_unhealthy_ltv_pct.
For full args / accounts shapes, see klend-sdk/src/@codegen/klend/instructions/markObligationForDeleveraging.ts.

The lifecycle

When a position’s LTV crosses insolvency_risk_unhealthy_ltv_pct, an off-chain monitor (anyone, typically a bot) calls mark-obligation-for-deleveraging. The position is now margin-called and the program records a timestamp. Standard liquidation is gated by the auto-deleverage state from this point forward. For deleveraging_margin_call_period_secs (or the market default if the reserve doesn’t override), the borrower has a grace window to repay or add collateral. Once grace ends, the deleveraging state begins to ramp: the effective liquidation threshold drops by deleveraging_threshold_decrease_bps_per_day and the liquidator bonus rises by deleveraging_bonus_increase_bps_per_day. Each elapsed day makes the position progressively easier to liquidate and progressively more profitable to clear, until a liquidator finally executes.

Tuning the ramp

Two reserve-level fields shape how aggressively the deleveraging state ramps after grace ends. Reference settings:

Off-chain infrastructure

Auto-deleverage is useful in proportion to the off-chain monitoring around it. A typical setup:
  • Position monitor: an off-chain service watches insolvency_risk_unhealthy_ltv_pct breaches and submits mark-obligation-for-deleveraging
  • Borrower notification: when a position is marked, notify the borrower (email / push / wallet message) so they can react inside the grace window
  • Liquidator coordination: standard liquidator infrastructure picks up margin-called positions once the grace window expires
For curator markets, you either rely on Kamino’s existing infrastructure (for whitelisted markets) or run your own.

Reference