Liquidium LogoLiquidium
TechnicalCore Concepts

Liquidations

How liquidations protect the protocol and its users

Liquidation Eligibility

A position becomes liquidatable when:

health_factor < 1.0

This means the risk-adjusted collateral value no longer covers the debt.

Close Factor

The close factor determines how much of a position can be liquidated in a single transaction:

Health FactorClose FactorMeaning
0.95 - 1.050%Partial liquidation
< 0.95100%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:

AssetLiquidation Bonus
BTC10%
ETH10%
Stablecoins5%

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_price

Protocol Fee

The protocol takes a small fee from liquidations:

protocol_fee = seized_collateral × protocol_liquidation_fee (e.g., 2%)
liquidator_receives = seized_collateral - protocol_fee

Example Liquidation

Underwater Position:

Borrower:
  Collateral: 1 BTC @ $50,000 (LT = 80%)
  Debt: $41,000 USDC
  
Health Factor: (50000 × 0.80) / 41000 = 0.976 (liquidatable)

Liquidator Action:

Close factor: 50% (HF > 0.95)
Max repay: $41,000 × 50% = $20,500 USDC

Liquidation bonus: 10%
Bonus value: $20,500 × 0.10 = $2,050

Total seized value: $20,500 + $2,050 = $22,550
Seized BTC: $22,550 / $50,000 = 0.451 BTC

Protocol fee (2%): 0.451 × 0.02 = 0.009 BTC
Liquidator receives: 0.451 - 0.009 = 0.442 BTC

Result:

Borrower after liquidation:
  Collateral: 1 - 0.451 = 0.549 BTC
  Debt: $41,000 - $20,500 = $20,500 USDC
  New HF: (0.549 × 50000 × 0.80) / 20500 = 1.07 ✓ Safe

Liquidator profit:
  Paid: $20,500 USDC
  Received: 0.442 BTC = $22,100
  Profit: $1,600 (7.8%)

Protocol:
  Earned: 0.009 BTC = $450 (treasury shares)

Liquidation Flow

Atomic State Updates

Liquidations update state atomically before any async operations:

  1. Burn borrower's debt shares - Reduces their debt
  2. Burn borrower's collateral shares - Seizes collateral
  3. Mint treasury shares - Protocol fee captured
  4. 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

Liquidators can query for underwater positions:

get_liquidatable_users(offset: u64, limit: u64) -> Vec<LiquidatableUser>

Returns positions where health_factor < 1.0, including:

  • User principal
  • Current health factor
  • Collateral positions
  • Debt positions
  • Maximum liquidatable amount

Liquidator Requirements

To execute a liquidation, the liquidator must:

  1. Have sufficient debt asset to repay the borrowed amount
  2. Sign the transaction with their wallet
  3. Specify collateral pool to receive seized assets
  4. Provide receiving address for the collateral

Liquidations are competitive. Successful liquidators typically run automated bots that monitor positions and execute quickly when opportunities arise.

Economic Security

The liquidation mechanism provides several security guarantees:

FeaturePurpose
OvercollateralizationPositions start with buffer above liquidation threshold
Liquidation bonusIncentivizes quick liquidation before bad debt
Protocol feeBuilds treasury for unexpected losses
Close factorAllows partial recovery for borrowers
Price oraclesAccurate valuations for fair liquidations