Market-level enablement
| Field | What it does |
|---|---|
obligation_order_creation_enabled | If 1, borrowers can create new orders on their obligations |
obligation_order_execution_enabled | If 1, executors can fill orders when conditions are met |
price_triggered_liquidation_disabled | If 1, blocks all price-triggered liquidations market-wide (incident response) |
Reserve-level fee
| Field | What it does |
|---|---|
protocol_order_execution_fee_pct | Percent (0–100) of order-execution proceeds routed to the protocol fee account |
- SDK
- API
- Kamino CLI
Enable obligation orders via SDK
Curator-side: flip the market flags. User-side: build a price-based order via SDK helpers and submitsetObligationOrder.Curator: enable on the market
Curator: set the per-reserve execution fee
UpdateprotocolOrderExecutionFeePct in the reserve config (range 0–100):Borrower: set a stop-loss order
The SDK provides high-level helperscreatePriceBasedOrder and readPriceBasedOrder, plus KaminoAction.buildSetObligationOrderIxn to wrap the on-chain instruction.Order conditions
An order specifies aConditionType and a threshold:
| ConditionType | When it fires |
|---|---|
Never (0) | Never. Disabled placeholder |
UserLtvAbove (1) | Borrower’s LTV exceeds the threshold |
UserLtvBelow (2) | Borrower’s LTV drops below the threshold |
DebtCollPriceRatioAbove (3) | Debt asset’s price relative to collateral exceeds the threshold |
DebtCollPriceRatioBelow (4) | Same ratio drops below the threshold |
Always (5) | Always fires (manual-trigger orders) |
LiquidationLtvCloserThan (6) | Borrower’s LTV is closer to the liquidation threshold than the configured distance |
UserLtvAbove and LiquidationLtvCloserThan. The price-ratio conditions are useful for protecting against specific pair movements.
Order opportunities (the action)
| OpportunityType | What it does |
|---|---|
DeleverageSingleDebtAmount (0) | Repay a specified amount of a single debt position by liquidating collateral |
DeleverageAllDebt (1) | Repay all debt on the obligation (or all debt against a specified collateral) |
DeleverageSingleDebtAmount is the granular case — pay down a chunk of debt, leave the rest. DeleverageAllDebt is the full unwind.
The execution flow
The borrower callsset-obligation-order from their wallet, supplying a condition type, threshold, opportunity type, amount, and any reserve references the order needs. The order is stored on the obligation account and is now visible to executors.
Execution is permissionless. Anyone can run a monitor that watches the program for orders whose condition is currently met; the standard pattern is an executor bot that scans active orders and submits fill-obligation-order against any that are fillable, referencing the obligation, the collateral reserve, the debt reserve, and the amount.
When the bot’s call lands, the program performs the deleverage in a single instruction: it liquidates the specified amount of collateral, repays the corresponding debt, pays the standard liquidation bonus to the executor, and routes protocol_order_execution_fee_pct of the proceeds to the protocol fee account. The order is cleared (or partially filled, if the action was specified as an amount and the bot only filled a portion).
Why a curator enables this
Standard liquidation only fires when a borrower’s LTV crosses the per-reserveliquidationThresholdPct. That’s the safety floor. Obligation orders let a borrower set a softer trigger above that floor — a stop-loss that fires before the position becomes liquidatable, on terms the borrower controls.
An institutional borrower running a 10× yield loop on SOL/mSOL might set:
- Order 1:
UserLtvAbove 70%→DeleverageSingleDebtAmount 20% of position(gradual deleveraging as risk rises) - Order 2:
UserLtvAbove 78%→DeleverageAllDebt(full exit before liquidation threshold at 80%)
Common conditions for self-deleverage
| Strategy | Condition | Threshold | Action |
|---|---|---|---|
| Soft stop-loss on an LST loop | UserLtvAbove | 5–10pp below liquidation threshold | DeleverageSingleDebtAmount covering ~20% |
| Hard exit on rapid drop | LiquidationLtvCloserThan | 2pp distance | DeleverageAllDebt |
| Pair-specific protection | DebtCollPriceRatioAbove | Asset-specific | DeleverageSingleDebtAmount |
| Manual cancel-on-call | Always | — | DeleverageSingleDebtAmount (only fires on executor call) |
Pausing during an incident
The market-level kill switch isprice_triggered_liquidation_disabled. Setting it to 1 blocks all price-triggered actions, including obligation order fills, while leaving non-price flows (manual repay, manual deposit, etc.) operational.
Useful for: oracle outage, suspicious price movement, before a planned migration. Reset to 0 once the incident is resolved.
Reference
- Market config reference —
obligation_order_*_enabled,price_triggered_liquidation_disabled - Reserve config reference —
protocol_order_execution_fee_pct - Liquidations — the protocol-managed equivalent
- Auto-deleverage — protocol-managed margin-call mechanism
- klend-sdk obligation order example