Proof

Golden vectors, the withdrawal guard, and the stated limits. Every number in the table is recomputed from the engine at page load — a parity failure in lib/spanMath.ts fails the vitest suite, not the display.

Golden vectors — the exact test cases

VectorBookIsolated IM (what to post alone)Net IM (what to post netted)Collateral saved
GV-01$100,000 LP, $95,000 short (the demo book)$147,500$10,0009,322 bps, 93.22%
GV-02$100,000 LP, $80,000 short$140,000$13,7509,017 bps, 90.17%
GV-03$100,000 LP, unhedged$100,000$33,7506,625 bps, 66.25%
grid knobs: convexity γ 50%, cross-venue haircut 5% (500 bps), maintenance ratio 75%, isolated short α 50%, one-time fee 0.05% (5 bps) — “bps” is basis points, 1 bp = 0.01%

Withdrawal guard — v4 hook, beforeRemoveLiquidity

The owner of the GV-01 book withdraws $80,000 of LP notional. The engine evaluates the surviving book and the PoolManager call reverts on the unsafe branch:

span margin breachtx reverted, pool state unchanged
SpanMarginBreach(
  trader:      0x7fa3…c41d,
  postEquity:  $12,000,
  requiredIM:  $16,500,
)
Post-withdrawal equity$12,000
Required initial margin$16,500
Shortfall$4,500

The branch is the GV-04 vector: the unwind at δ = +2,000 bps would realize bad debt, so the withdrawal is refused before it can happen. The mark used for the valuation is the more conservative of spot and entry.

Live deployment — Base Sepolia (84532)

every address above is a real contract on testnet with the mined hook flag mask 0x240; the demo book, adapter binding, and keeper roles are wired exactly as the tests assert.

Sponsor proof points

1inch Aquaship 25,000e6, push 28,500e6, pull 33,800e6
Uniswap v4mined hook address, PoolManager call
Arkiv Rabdilive entity, 300 s ttl, runnable query

where each appears: the terminal ledger (ship, push, pull on a fork), the guard panel (hook revert), /arkiv (entity table and query string)

Stated limits

  • not audited — the contracts are tested, not audited; basis, venue, smart-contract, and oracle risk remain
  • demo hedge adapter — the short leg settles against a pre-funded demo reserve, not a live venue
  • downward shocks only — the atomic unwind executes for shocks in [−3,000, 0] bps; upward shocks are preview-only
  • router withdrawals — a withdrawal through a router is not identified by the guard; direct PoolManager calls only
  • single-asset scope — one WETH/USDC LP plus one WETH short; multi-asset correlation is out of scope
  • SPAN-style, simplified — a 16-scenario grid, not a production SPAN algorithm

volatility assumption in every vector: 150 bps (= 1.5%); recomputed at build time from lib/spanMath.ts