Isolated by default

The vault is the maker on every parlay. Under isolated accounting the book is charged the sum of per-parlay maker collateral, and the relayer’s quoting capacity check is simply:
locked + newCollateral <= NAV * maxUtilizationBps   (default 80% of NAV)
Simple and safe, but capital-inefficient: collateral is a claim on a specific outcome, and outcomes conflict. If parlay A backs “Argentina champion” and parlay B backs “France champion”, no world pays both. The true exposure is max(A, B), not A + B.

Cross-margin secured credit

In cross mode (an admin-toggled relayer setting) the engine computes the book’s true worst case and extends the difference back as quoting capacity:
  1. Conflict graph. Two parlays conflict iff they can never both win: opposite sides of the same market, or YES on two different markets in the same HL question group. Only structural impossibility counts; no correlation estimate, however high, creates credit.
  2. Worst-case liability = the max-weight set of parlays that can co-win (max-weight independent set, weight = collateral). Solved exactly per conflict component up to 22 nodes; larger components fall back to the conservative sum.
  3. Secured credit = (isolated - worstCase) * (1 - haircut). Default haircut 20% (creditHaircutBps = 2000).
  4. Effective locked = isolated - securedCredit, which is what the utilization check charges:
cross: effectiveLocked(book + incoming) <= NAV * maxUtilizationBps
The invariant, kept by construction: no leverage beyond the worst case. A book that nets nothing gets nothing. And physical locks are unchanged: on-chain, escrow still locks full collateral per parlay, so even a wrong margin engine leaves every open parlay fully paid for. Cross-margin only governs how much of the utilization cap the book consumes when quoting.

The margin block in a quote

Every QuoteResponse carries a margin field:
  • null under isolated accounting (the default) or when no NAV-relative cap is active.
  • Under cross mode, a transparency object showing how capacity was charged for this quote:
"margin": {
  "mode": "cross",
  "isolatedAfter": "18500000000",
  "effectiveAfter": "14200000000",
  "securedCredit": "4300000000",
  "exact": true
}
isolatedAfter
string
Post-trade book charge under isolated accounting (raw USDC).
effectiveAfter
string
Post-trade charge actually applied under cross accounting.
securedCredit
string
Netting benefit extended back as capacity, after the haircut.
exact
boolean
Whether the worst case was solved exactly (false = a large conflict component fell back to the conservative sum).
If the margin engine fails mid-quote, the block degrades to {"mode": "cross", "degraded": true} and isolated accounting stays in force; capacity tightens, never loosens.

GET /margin

The public transparency endpoint returns both accounting modes side by side, whichever one is live. The client wraps it as client.margin(detail?), typed as MarginState:
const m = await taker.margin();
// m.mode                       "isolated" | "cross"  (what /quote actually charges)
// m.vault.capacity             NAV * utilization cap, raw USDC string
// m.book.isolatedLocked        sum of per-parlay collateral
// m.book.worstCaseLocked       max co-winnable collateral
// m.book.relief                isolated - worstCase
// m.book.securedCredit         relief * (1 - haircut)
// m.book.effectiveLocked       isolated - securedCredit
// m.headroom.isolated / cross  remaining quoting capacity under each mode

const detailed = await taker.margin(true);
// adds per-position book (id, makerCollateral, legs) + netting clusters
Render it as a read-only card (the reference app’s Model page does exactly this) so LPs and takers can verify how much capacity the book consumes under each mode. Full JSON example in the relayer reference.