FABRKNT
すべてのコース
コース · 自作 Perp
エキスパート440 分870 XP

Step 5. Liquidation:レバレッジ環境における非単調性の発見と清算エンジンの構築

永久先物(Perpetual Futures)の清算エンジン中核をEnd-to-Endで実装する、DIY Perpシリーズ第5弾。 アカウントの4フェーズ分類(pure compute)、保険基金(Insurance Fund)のステートマシン、そしてマルチアカウント・スキャナーを1つのオーケストレーション・ループへ結合する。さらに、レバレッジ環境特有の「非単調性」を proptest で炙り出す手法や、debug_assert! による契約検証まで網羅する。Liquidation三部作に対応する全13レッスンを通じ、バイト単位(Byte-for-byte)で一致する堅牢な実装を構築する。

ソースが第一のテキスト

このコースの進め方

このコースは記事の寄せ集めではなく、手を動かして進める実践型です。レッスンは順に積み上がる構成なので前から進めれば、ソースで得た理解がそのまま実際のコードに活きます。

コースを始める →14 レッスン · ネイティブプレイヤー
難易度
エキスパート
学習量
440 分
報酬
870 XP
Orientation
  1. 01レッスン0 — OpenHL Liquidation を作る(永久先物ポジション liquidation エンジン)15 分 · 50 XP
  1. 01レッスン1 — MARGIN_SCALE + LiquidationParams — リスクエンジンのダイヤル30 分 · 60 XP
  2. 02レッスン2 — MarginRatio + MarginHealth — エンジンが返す分類型25 分 · 50 XP
  3. 03レッスン3 — AccountSnapshot + CloseOrderSpec — エンジンの入出力型25 分 · 50 XP
純粋な compute
  1. 01レッスン4 — notional_value + unrealized_pnl — signed-multiplication のトリック45 分 · 80 XP
  2. 02レッスン5 — account_equity + margin_ratio — そして最初のメンタルモデルを壊す proptest60 分 · 100 XP
  3. 03レッスン6 — margin_health — 分類カスケードと境界セマンティクス30 分 · 60 XP
  4. 04レッスン7 — close_order_spec — 純粋な compute の最後の関数20 分 · 40 XP
保険基金
  1. 01レッスン8 — InsuranceFund — クレートが純粋でなくなる地点25 分 · 50 XP
  2. 02レッスン9 — withdraw_shortfall — Layer 2 → Layer 3 境界をコードで表現する30 分 · 60 XP
  3. 03レッスン10 — liquidation_fee + close-outcome decomposition — compute と insurance をつなぐ橋35 分 · 70 XP
Scanner & capstone
  1. 01レッスン11 — Scanner 型の語彙 — CloseOutcomeKind / LiquidationRecord / ScanReport / LiquidationScanner25 分 · 50 XP
  2. 02レッスン12 — scan — safety cascade のオーケストレーションの心臓35 分 · 70 XP
  3. 03レッスン13 — Scanner capstone — 6 個の nuanced unit test + 4 個の invariant proptest + Liquidation三部作の振り返り40 分 · 80 XP