hybrid-perps-spec

Liquidation Scenarios


SC-LQ-001: Isolated INTERNAL Position Liquidation

Preconditions:

Liquidation Price Calculation:

Liq Price = 80,000 × (1 - 800/8,000 + 0.004) = 80,000 × 0.904 = $72,320

Steps:

  1. HL mark price drops to $72,300 (below liq price $72,320)
  2. Platform liquidation engine detects trigger (target: < 1s)
  3. Settle internally at HL mark price $72,300

Expected Results:


SC-LQ-002: Isolated HYPERLIQUID Position Liquidation

Preconditions:

Liquidation Price Calculation:

Liq Price = 4,000 × (1 + 4,000/20,000 - 0.005) = 4,000 × 1.195 = $4,780

Steps:

  1. HL mark price rises to $4,790 (above liq price)
  2. Platform liquidation engine detects trigger
  3. Send market close instruction to HL (size=5 ETH)
  4. Await HL fill receipt (close_price)

Expected Results:


SC-LQ-003: Cross Margin — Account-Level Liquidation Trigger

Preconditions:

Calculation:

Account Equity = $5,000 + (-$4,000) + (-$500) = $500
Cross Maintenance Req = $10,000×0.4% + $8,000×0.5% = $40 + $40 = $80

Equity $500 > $80 → Not triggered yet (price continues moving...)
Equity drops to $80 → Liquidation triggered

Expected Results:


SC-LQ-004: Cross Margin — Sequential Close Until Account Zeroed

Preconditions:

Steps:

  1. Close most-losing position → recalculate equity
  2. Equity still ≤ maintenance req → close second position
  3. Equity still ≤ maintenance req → close third position
  4. All positions closed, account zeroed

Expected Results:


SC-LQ-005: Mixed Mode — Isolated Liquidation Does Not Affect Cross

Preconditions:

Steps:

  1. BTC price drops; isolated BTC position hits liquidation
  2. BTC INTERNAL position settled at mark price internally

Expected Results:


SC-LQ-006: Funding Rate Erosion Raises Liquidation Price

Preconditions:

Liquidation Price Comparison:

Without funding erosion:
  Liq Price = 80,000 × (1 - 800/8,000 + 0.004) = $72,320

With funding erosion:
  Liq Price = 80,000 × (1 - (800-200)/8,000 + 0.004) = $74,320

Expected Results: