Liquidations
How liquidations protect the protocol and its users
Liquidation Eligibility
A position becomes liquidatable when:
health_factor < 1.0This means the risk-adjusted collateral value no longer covers the debt.
For the borrower-facing safety display, Liquidium may show position safety as Health %, while technical examples often use decimal Health Factor. See the Health Factor guide for the Health Factor to Health % conversion table and calculation.
Close Factor
The close factor determines how much of a position can be liquidated in a single transaction:
Health Factor | Close Factor | Meaning |
|---|---|---|
0.95 - 1.0 | 50% | Partial liquidation |
< 0.95 | 100% | Full liquidation allowed |
Partial liquidation gives borrowers a chance to recover their position before complete closure.
Liquidation Bonus
Liquidators receive a bonus as incentive to maintain protocol health:
Asset | Liquidation Bonus |
|---|---|
BTC | 5%* |
ETH | 5%* |
USDC | 5%* |
USDT | 5%* |
ICP | 7.5%* |
Live liquidation bonuses can change. Check the live Markets page for current asset-specific liquidation bonuses, liquidation thresholds, and Max LTV values.
The bonus is paid in collateral tokens, meaning liquidators receive more collateral than the debt they repay.
Liquidation Math
Collateral Calculation
max_repay_amount = position.debt × close_factor
repay_value_usd = repay_amount × debt_asset_price
bonus_value_usd = repay_value_usd × liquidation_bonus
seized_value_usd = repay_value_usd + bonus_value_usd
seized_collateral = seized_value_usd / collateral_asset_priceProtocol Fee
The protocol takes a small fee from liquidations:
protocol_fee = seized_collateral × protocol_liquidation_fee (e.g., 2%)
liquidator_receives = seized_collateral - protocol_feeExample Liquidation
Underwater Position:
Borrower:
Collateral: 1 BTC @ $50,000 (LT = 74%)
Debt: $38,000 USDC
Health Factor: (50000 × 0.74) / 38000 = 0.974 (liquidatable)Liquidator Action:
Close factor: 50% (HF > 0.95)
Max repay: $38,000 × 50% = $19,000 USDC
Liquidation bonus: 5%
Bonus value: $19,000 × 0.05 = $950
Total seized value: $19,000 + $950 = $19,950
Seized BTC: $19,950 / $50,000 = 0.399 BTC
Protocol fee (2%): 0.399 × 0.02 = 0.008 BTC
Liquidator receives: 0.399 - 0.008 = 0.391 BTCResult:
Borrower after liquidation:
Collateral: 1 - 0.399 = 0.601 BTC
Debt: $38,000 - $19,000 = $19,000 USDC
New HF: (0.601 × 50000 × 0.74) / 19000 = 1.17 ✓ Safe
Liquidator profit:
Paid: $19,000 USDC
Received: 0.391 BTC = $19,550
Profit: $550 (2.9%)
Protocol:
Earned: 0.008 BTC = $400 (treasury shares)Liquidation Flow
- The liquidator calls
scan_at_risk_positionsto find eligible positions. - The liquidator submits
liquidateorliquidate_with_slippagewith aLiquidationRequest. - The Lending Canister validates the position's Health Factor and calculates the close factor, seized collateral, liquidation bonus, and protocol fee.
- The protocol atomically updates the borrower's debt and collateral shares and records the liquidation.
- The debt asset is collected from the liquidator and the seized collateral is sent to the requested receiver principal.
Atomic State Updates
Liquidations update state atomically before any async operations:
- Burn borrower's debt shares - Reduces their debt
- Burn borrower's collateral shares - Seizes collateral
- Mint treasury shares - Protocol fee captured
- Record liquidation event - Audit trail
The actual asset transfers (debt repayment, collateral delivery) happen asynchronously via the WAL system.
Learn more about Write Ahead Logging here.
Finding Liquidatable Positions
The production Lending Canister is:
hyk4r-jqaaa-aaaar-qb4ca-caiUse the cursor-based query to find eligible positions:
scan_at_risk_positions(
cursor: opt principal,
scan_limit: nat64,
max_results: nat64
) -> ScanResultResults include the borrower principal, Health Factor, weighted liquidation threshold, pool positions, and total debt.
The legacy offset-based query remains available:
get_at_risk_positions(
offset: nat64,
limit: nat64
) -> vec LiquidatableUserLiquidator Requirements
To execute a liquidation, the liquidator must:
- Have sufficient debt asset to repay the borrowed amount
- Call the Lending Canister using their IC principal
- Specify the borrower, debt pool, collateral pool, and debt amount
- Provide the principal that should receive the collateral
Liquidations are publicly callable in production. You do not need to register or have your principal added to an allowlist before submitting a liquidation.
The available execution methods are:
liquidate(request: LiquidationRequest)
liquidate_with_slippage(
request: LiquidationRequest,
min_collateral_amount: nat
)liquidate_with_slippage protects against receiving less than the specified minimum gross collateral amount.
Liquidations are competitive. Successful liquidators typically run automated bots that monitor positions and execute quickly when opportunities arise.
Liquidation execution is separate from the Liquidium SDK. The SDK does not currently provide a liquidation-execution helper.
Economic Security
The liquidation mechanism provides several security guarantees:
Feature | Purpose |
|---|---|
Overcollateralization | Positions start with buffer above liquidation threshold |
Liquidation bonus | Incentivizes quick liquidation before bad debt |
Protocol fee | Builds treasury for unexpected losses |
Close factor | Allows partial recovery for borrowers |
Price oracles | Accurate valuations for fair liquidations |