Liquidation and loss allocation

The flash and emergency liquidation instruction interface deployed on devnet.

Updated Oct 16, 2026

InstructionArgumentsResult
preview_liquidation_healthdebt_assetRead-only current health; no stored observation
preview_flash_liquidationdebt_asset, max_repayment, fullCollateral debit/credit, net payment, repayment, fees, before/after health and incentive rates
begin_flash_liquidationposition, debt_asset, max_repayment, max_payment, min_collateral_credit, full, settle_indexOpens a position-bound session and flashes collateral
settle_flash_liquidationNoneSettles the bound obligation and releases the session
preview_emergency_liquidationdebt_asset, collateral_debit, fullReference price/depth, proceeds, reward, fees, loss allocation and health
emergency_liquidationdebt_asset, collateral_debit, full, min_reward_credit, min_swap_outputExecutes permitted internal settlement with bounded payouts

debt_asset is 0 for base and 1 for quote. Token amounts are raw atoms; use lossless integers.

Pass exactly one of borrow_position and leverage_position. The common account group includes owner payout, collateral custody, debt reserve and interest vaults, applicable referrals and both token program identities.

The session PDA uses liquidation-session and the position. The payment PDA uses liquidation-payment, the position and debt mint.

The program verifies the exact begin/settle pairing through the instructions sysvar. Failure rolls back the entire transaction.

A present collateral_reserve_vault selects Dusk settlement on settle_flash_liquidation; an absent account selects external payment. Internal settlement and emergency execution require the current hLP remaining-account list when hLP is active. Use the matching SDK builders rather than a manually maintained account order.

The payment vault may remain allocated after settlement. Its pre-existing donations do not discharge a new payment. The session must close, and settlement preserves the vault's pre-existing balance.

start_liquidation_auction, fill_liquidation_auction, backstop_liquidation_auction and liquidate_leverage_position are no longer program calls. Protocol-revenue auctions remain separate. Funded losses reach junior then senior; no instruction donates to or draws from a separate loss fund.

See liquidation policy, keeper builders and the pinned IDL in keeper PR #2.