When this is useful
| Curator profile | Recommendation |
|---|---|
| Public market with retail borrowers | Optional. The grace period is borrower-friendly but adds operational complexity |
| Institutional / fixed-term market | Skip. Institutional borrowers prefer immediate, predictable liquidation behavior |
| Stable-only / eMode-heavy market | Skip. Correlated-asset liquidations are small and fast |
| Newly-listed volatile asset | Optional. If enabled, use a shorter margin_call_period (e.g., 4 hours) |
Market-level enablement
| Field | What it does |
|---|---|
autodeleverage_enabled | Master switch. 1 enables auto-deleverage on the market |
individual_autodeleverage_margin_call_period_secs | Default grace period (seconds) between when a position is margin-called and when liquidation opens up. 86400 = 24 hours |
insolvency_risk_unhealthy_ltv_pct | LTV at which a position is considered to be in insolvency risk territory and may be marked for auto-deleverage. Default 100 |
Reserve-level config
| Field | What it does |
|---|---|
autodeleverage_enabled | Per-reserve enablement. Both market and reserve must be 1 for auto-deleverage to apply to positions involving this reserve |
deleveraging_margin_call_period_secs | Per-reserve override for the margin-call period. 0 falls back to the market-level value |
deleveraging_threshold_decrease_bps_per_day | The position’s effective liquidation threshold drops by this many bps per day after margin call. Allows liquidators in over time |
deleveraging_bonus_increase_bps_per_day | Liquidator bonus rises by this many bps per day after margin call. Compounds the incentive over time |
min_deleveraging_bonus_bps | Floor on the deleveraging-specific bonus |
- SDK
- API
- Kamino CLI
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
ThemarkObligationForDeleveraging 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.klend-sdk/src/@codegen/klend/instructions/markObligationForDeleveraging.ts.The lifecycle
When a position’s LTV crossesinsolvency_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.| Field | Higher value means |
|---|---|
deleveraging_threshold_decrease_bps_per_day | Liquidation threshold drops faster, opening up the position to liquidators sooner |
deleveraging_bonus_increase_bps_per_day | Liquidator bonus grows faster, paying executors more for clearing the position |
| Risk profile | threshold_decrease | bonus_increase | margin_call_period |
|---|---|---|---|
| Borrower-friendly | 12 bps/day | 50 bps/day | 48 hours |
| Standard | 24 bps/day | 100 bps/day | 24 hours |
| Aggressive (volatile asset) | 50 bps/day | 200 bps/day | 4 hours |
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_pctbreaches and submitsmark-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
Reference
- Liquidations — base liquidation mechanics
- Reserve config reference —
autodeleverage_enabled,deleveraging_*fields - Market config reference —
autodeleverage_enabled,individual_autodeleverage_margin_call_period_secs,insolvency_risk_unhealthy_ltv_pct