FABRKNT
← All courses
Training Mission · DIY Perp
DIY PerpEXPERT440 min870 XP

Build OpenHL Liquidation — perpetual position liquidation engine

Build openhl liquidation: margin model with four states, scanner emitting close orders, insurance fund absorbing deficit. Pinned to byte-for-byte answer keys.

Course as operating doctrine · Source as primary text

Mission brief

This course is structured as a working assignment, not a content feed. Move through the lessons in order, accumulate the vocabulary, then carry the pattern back into the rest of the stack.

Start the course →14 lessons · native player
Difficulty
EXPERT
Workload
440 minutes
Reward
870 XP
Orientation
  1. 01Build OpenHL Liquidation — perpetual position liquidation engine15 min · 50 XP
Types
  1. 01Lesson 1 — MARGIN_SCALE + LiquidationParams — the dials on the risk engine30 min · 60 XP
  2. 02Lesson 2 — MarginRatio + MarginHealth — the classification types the engine returns25 min · 50 XP
  3. 03Lesson 3 — AccountSnapshot + CloseOrderSpec — the engine's input and output types25 min · 50 XP
Pure compute
  1. 01Lesson 4 — notional_value + unrealized_pnl — the signed-multiplication trick45 min · 80 XP
  2. 02Lesson 5 — account_equity + margin_ratio — and the proptest that breaks your first mental model60 min · 100 XP
  3. 03Lesson 6 — margin_health — the classification cascade and boundary semantics30 min · 60 XP
  4. 04Lesson 7 — close_order_spec — Stage 10a's last function20 min · 40 XP
Insurance fund
  1. 01Lesson 8 — InsuranceFund — where the crate stops being pure25 min · 50 XP
  2. 02Lesson 9 — withdraw_shortfall — the Layer 2 → Layer 3 boundary as code30 min · 60 XP
  3. 03Lesson 10 — liquidation_fee + close-outcome decomposition — the bridge between compute and insurance35 min · 70 XP
Scanner & capstone
  1. 01Lesson 11 — Scanner type vocabulary — CloseOutcomeKind, LiquidationRecord, ScanReport, LiquidationScanner25 min · 50 XP
  2. 02Lesson 12 — scan — the orchestration heart of the safety cascade35 min · 70 XP
  3. 03Lesson 13 — Scanner capstone — 6 nuanced unit tests + 4 invariant proptests + the Stage 10 retrospective40 min · 80 XP