Global Model
Fix a family of markets k, accounts a, and per-account-per-market positions. The engine is the transition system S′=fe(S,u) where e ranges over a finite alphabet of engine events — deposit and withdrawal, order submission with matching, cancel/expiry, funding accrual, funding settlement, and the liquidation cascade — and u=(Poracle,k,tlast,k)k is an exogenous input: a trusted price and its timestamp per market, handed to the engine as given. From u and its own trade window Wk the engine derives the mark mk=wPoracle,k+(1−w)Ptrade(Wk) ((O.8), (O.7)); every event map below is a function of (S,u) through mk alone. The orbit of the Exchange is the trajectory of S under an interleaving of these maps: fills build entry prices ((T.1)), marks revalue them ((T.2)), funding transfers value between the sides ((F.4)), and the cascade repossesses positions whose equity has fallen to the maintenance floor ((L.4)).
The coupling quantity that organizes the whole engine is equity, E=C+Π ((M.5)): affine in the mark, additive over positions, and read by every guard that matters. Admission compares equity headroom against initial margin ((M.13), (M.14)); the liquidation trigger compares it against maintenance margin ((L.4)); withdrawal deliberately ignores it and moves only realized collateral ((M.16)). Because maintenance is strictly inside initial (rm<ri, (M.4) vs (M.2)), the state space is stratified into a healthy region, a buffer, and the liquidation region — and the engine's dynamics are precisely the story of how event maps move accounts between these strata while conserving value at every step.
The state space
The state set. A state is the tuple
S=((Ca,Mresv,a,nresv,a)a, (sa,k,Pe,a,k)a,k, (Bk,Ak,Tk,Wk,Φk,Σabs,k,Σrec,k)k, Cpool, Cfee)
with components, per account, realized collateral, reserved margin, and the open-reservation count; per position, a signed size s (direction σ=sign(s), magnitude q=∣s∣) and a volume-weighted entry price Pe; per market, the resting-order multiset Bk (each order carrying side, limit price, and remaining quantity q−qf), the funding accumulator pair (Ak,Tk), the five-trade window Wk, and the insurance fund balance Φk with its lifetime ledgers; and two system accounts, the funding pool Cpool and the Exchange fee account Cfee. The input uk=(Poracle,k,tlast,k) and its guard bookkeeping Ωk (ten-print history, pending re-anchor block) are input-process state, exogenous to the engine but declared here because Part II's map writes them.
The per-position funding accumulator is not a coordinate. The corpus fixes the convention φa,k≡0: funding accrual touches only the market pair (Ak,Tk) ((F.2)), and settlement computes each payment fresh from (A,T) and resets atomically — no event map ever writes a nonzero value into a per-position accumulator, so carrying one would be writer-less state, not well-defined dynamics. Consequently the funding-integral term of (M.8) reads identically zero at every observable state, and live equity is Epf=C+∑isi(mi−Pe,i): the funding channel into equity is the collateral debit at settlement, nothing else.
The admissible region A is cut out by: strictly positive stored position sizes qa,k>0 with ∣s∣ on the lot lattice ℓZ ((B.1)); positive entry prices; resting limit prices strictly positive on the tick lattice δZ ((B.2)) with the book uncrossed, Pb<Pa; strictly positive remaining quantity on every resting order; Mresv≥0 and nresv≥0; market parameters with 0≤rm<ri (validated at parse, the ordering behind (M.4) ≤ (M.2)); Φk≥0 with Φ=Σrec−Σabs; Tk≥0; and Ca unrestricted in sign — collateral can be driven negative by unguarded engine-internal debits, and the model keeps that honesty rather than assuming Ca≥0.
The event alphabet and totality. The engine and input alphabets are
ΣE={deposit_withdrawal, order_submission_fill, order_cancel_expiry,funding_accrual, funding_settlement, liquidation_cascade},ΣO={oracle_print}.
Every map is well-defined on A because each carries explicit domain guards: withdrawal is gated by the flat-and-unreserved predicate ((M.16)); admission by alignment, collar, and headroom guards evaluated before any mutation; the funding rate is total via its explicit T=0 branch ((F.3)); accrual accepts only strictly advancing time and positive anchor ((F.2)); every min/max in the cascade and the fund ((I.1), (I.9)) is total and sign-safe; tick alignment clamps to one tick rather than producing non-positive prices ((L.9)); and the reduce-only guard ((L.13)) rejects the one known oversized-close regime before the book is touched.
State coordinates
Ca
account_collateral
account
Realized USDX collateral of account a: the only coordinate deposits and withdrawals touch, the cash leg of realized PnL, fees, funding, and liquidation settlement. Sign-unrestricted — engine-internal debits (funding settlement, penalties) are unguarded.
USDX
Mresv
reserved_margin
account
USDX
sa,k
signed_position_size
position
Signed position size of account a in market k: σ=sign(s), $$q =
s
Pe,a,k
entry_price
position
Volume-weighted entry price maintained exclusively by (T.1): same-side fills blend, reductions leave it untouched, flips re-seed it at the fill price. The anchor of every PnL and bankruptcy computation.
USDX per base unit
Bk
order_book
market
Resting-order multiset of market k — per order: side, limit price on the tick lattice, remaining quantity q−qf>0 — with its id index in exact agreement. Uncrossed (Pb<Pa) in every reachable state; mutated by matching, resting, cancel/expiry, and self-trade prevention (B.8).
multiset of orders
Ak
accumulated_premium
market
Time-weighted premium accumulator of the current funding interval, written only by (F.2) and reset to zero atomically at settlement.
dimensionless-seconds
Tk
interval_clock
market
Elapsed accumulated time of the current funding interval; T≥0 always (saturating subtraction), reset with Ak at settlement; the T=0 branch of (F.3) keeps the rate total.
seconds
Wk
trade_window
market
The last five executed fills (P⋆,q⋆) of market k, written by the fill map (including liquidation close fills) and read by the volume-weighted median (O.7) — the engine-owned leg of the mark blend and the channel by which the engine feeds back into its own input.
five (price, size) pairs
Φk
insurance_fund_balance
system
USDX
Cpool
funding_pool
system
The funding pool book through which every funding transfer routes ((S.6)): positive payments flow account-to-pool, negative pool-to-account. Across the matched open interest of one settlement it nets to zero exactly.
USDX
Cfee
exchange_fee_account
system
USDX
Poracle,k
oracle_anchor
market
The trusted anchor price of market k — the engine's input uk. Input-process state: moved only by the guarded accept and re-anchor promotion branches of the oracle map, never by any engine event.
USDX per unit of asset
tlast,k
anchor_timestamp
market
Timestamp of the last trusted anchor update, read by the staleness predicate (O.4); frozen together with the anchor while a re-anchor is pending.
milliseconds
Event dynamics
The engine is event-driven: the state sits still between events, and each event is a deterministic map S′=f(S,u) with the oracle price u given.
Deposit / Withdrawal
Fires when an account moves external USDX in or out. A deposit is unguarded: any positive amount credits Ca and touches nothing else. A withdrawal is guarded by the flat-and-unreserved predicate (M.16): it debits at most Ca, and only when npos=0 and nresv=0 — equity and available margin never enter the withdrawal path, so unrealized PnL can never leave the venue before a close realizes it into collateral. The guard's nresv=0 arm is what the cancel/expiry map (below) makes reachable. Touches: Ca only.
Order submission, matching, and fill
Fires on order submission. Admission guards run first, mutating nothing on rejection: lot and tick/positivity alignment ((B.1), (B.2)), the mark collar ((B.3)), FOK availability ((B.5)), and margin headroom — the isolated path (M.13) at the effective rate (M.1), the cross path (M.14) charging only added exposure ((M.11), (M.12)) against equity net of all outstanding reservations. Admission writes Mresv atomically with the check. The matching loop then walks price-time priority: each fill exchanges q⋆=min(qt,qm) at the maker's price ((B.6), (B.7)), bounded for market orders by the running-VWAP slippage band ((B.9), (B.10)). Self-trade prevention fires inside this loop: (B.8) decrements both same-account orders' quantities with no virtual fill, handing the fully-reduced side to the cancel map. Each fill updates positions — same-side blend (T.1), reduce (T.3) realizing (T.4) into Ca at the fill price, flip (T.5) — debits the taker fee and credits the maker rebate between Ca and Cfee ((S.2), (S.3), closure (S.5)), and appends (P⋆,q⋆) to the trade window Wk — the coordinate Part III's mark blend reads. Touches: B,Mresv,s,Pe,Ca,Cfee,W.
Order cancel / expiry
Fires on user cancellation, IOC/FOK/market-remainder expiry, post-only rejection of a crossing order, slippage-cap cancellation ((B.10)), the reduce-only rejection of an oversized liquidation close ((L.13)), and self-trade prevention's cancel-of-the-fully-reduced-side ((B.8)) — this map is where the STP path lands at the composition level. It removes the order from Bk and its id index together (the book/index agreement is preserved by the shared removal helpers), decrements nresv, and releases the order's reserved margin from Mresv. This release is load-bearing: (M.16) guards on nresv=0 and (M.14) reads Mresv, and both are consistent only because cancellation returns the reservation. The book-side removal is fully witnessed; the corpus contains no expression for the per-order release amount μ(o), so the collateral-side arithmetic of this map is a named gap (cancel_release_arithmetic_unwitnessed) — nothing is cited for it. Touches: B,Mresv,nresv.
Funding accrual
Fires on each premium sample with strictly advancing time and a strictly positive anchor; otherwise the state passes through unchanged. It computes the premium of the mark over the given input u ((F.1)) and adds its time-weighted contribution to the interval accumulator ((F.2)). This map touches exactly two coordinates — (Ak,Tk) — and no account, position, book, or fund coordinate. In particular it writes nothing into any per-position accumulator: this is the φ≡0 convention made operational, and it is why the funding accumulator is not a state coordinate of this model.
Funding settlement
Fires at the end of each funding interval. The rate is the clamped time-weighted average premium with the total T=0 branch ((F.3)); each open position's payment is Πf=σqmkf ((F.4)), computed fresh from (A,T) — settle-and-reset, never read from accrued per-position state. Each payment routes through the funding pool as a transfer of magnitude ∣Πf∣ with sign-selected direction ((S.6)): the account leg debits or credits Ca, the pool leg mirrors it in Cpool. The collateral debit is unguarded — no margin check precedes it, so settlement can push an account through its maintenance floor with no input motion (one of the three engine-internal channels scoped into the margin-monotonicity invariant). The interval pair resets atomically: (A′,T′)=(0,0). Touches: Ca for every account with an open position, Cpool, (Ak,Tk).
Liquidation cascade
Fires when an account's fresh-mark equity falls to its maintenance floor: the inclusive trigger E≤∑iMi ((L.4)) over (L.1), (L.2), (L.3). Collateral is apportioned — cross accounts split the shared pool loss-proportionally with the remainder fold conserving it exactly ((L.6), (L.7)); isolated positions use their stamped cushion ((L.5)). Close orders are sized ((L.11), (L.12)), guarded reduce-only ((L.13) — a negative share yields an oversized order that is rejected each scan, a stall not a flip), priced from the bankruptcy price ((L.8)) tick-aligned toward executability ((L.9), (L.10)), and executed through the same matching map as any order — their fills enter Wk. Settlement per market: Xi=si+Πfill,i+Πres,i−gi with realized fill PnL (L.15), mark-valued residual (L.16), and spread profit (L.14); bad debt is Di=max(0,−Xi) ((L.17)). The liquidated account's collateral is defined explicitly: Ca′=∑i(max(Xi,0)−Λi), where the penalty Λi is the owed amount (S.4) capped at the retained collateral ((I.9)) — a debit whose fund-side destination is witnessed: (I.10) and (I.11) credit the same Λ to Φ in one atomic no-mint pair (v0.0.9 expressions closing the formerly-open liquidation_penalty_sink finding). Fund sequencing is credit-before-absorb for BOTH credits (settled, code-verified 2026-07-12: apply_liquidation_penalty precedes fill accounting in execute_liquidation, per_market.rs:552-574, and the spread credit precedes absorb_bad_debt): Φ1=Φ+Λ+g ((I.10), (I.7)), then absorption min(D,Φ1) ((I.1), (I.2)) with lockstep ledgers ((I.3), (I.8)). ADL arms through two nested predicates: the settle amount Dadl=max(D−Φ1,0)>0 ((I.4)) and, after absorption, the threshold Φ′≤κ ((I.5)). Settle-amount firing implies threshold firing (Dadl>0 forces Φ′=0≤κ); the divergence is one-sided — e.g. Φ1=12,D=5,κ=10 gives Dadl=0 yet Φ′=7≤κ: armed with nothing to settle. Whether ADL executes in that regime is the open finding adl_arming_condition_ambiguity. Counterparties rank by ρ=πL ((L.18), (I.6)); the counterparty settlement map itself is unmodeled — a named gap (adl_settlement_unmodeled). One further seam is named rather than hidden: on a partial fill the settle map counts Πres as cash in X while the surviving remainder retains entry Pe ((T.1) is untouched by reductions) — no expression re-marks the residual's entry, so the partial-fill case double-carries that PnL across layers (residual_entry_remark_unwitnessed). Touches: s,Pe,B,W,Ca,Φ,Σabs,Σrec,Cfee. The fee treatment of liquidation close fills (whether the liquidatee is charged taker fees, and resting counterparties earn rebates, on cascade fills) is unwitnessed by any component expression; Cfee is therefore excluded from this map's write set and the question is a named gap (liquidation_fill_fee_treatment).
Invariants of the engine
Aggregate funding zero-sum across matched open interest
Within each market, a funding settlement transfers value between the sides but creates none: the payments (F.4) sum to zero over all accounts because open interest is matched (∑asa,k=0), so the pool's net position across the settlement's transfers ((S.6)) is exactly zero.
Why it holds: Position coordinates are written only by fill maps, and every fill adjusts taker and maker by the same q⋆ with opposite signs ((B.6), with reduces and flips per (T.3) and (T.5)) — so ∑asa,k=0 inductively from the empty market; deposits, withdrawals, cancels, and accrual never touch s, and liquidation closes execute through the same fill map. The payment is linear in signed size with the common factor fmk ((F.4)), so the account legs cancel exactly in decimal arithmetic, and each pool transfer carries exactly the account leg's magnitude with mirrored direction ((S.6)).
Collateral conservation through the liquidation cascade
Through a fully-filled cascade, equity is apportioned and transferred, never created: the cross pool splits into shares that sum back to it exactly ((L.6), (L.7)); every unit of bad debt (L.17) is covered exactly once, split between fund absorption (I.1) and the ADL settle amount (I.4) at the post-spread-credit balance Φ1; and the penalty is a no-mint transfer — the account debit and the fund credit are the same capped Λ ((I.9), (I.10)). Honest scope: stated for fully-filled liquidations (Qf=q, Πres=0); the partial-fill case is unreconciled by the residual entry-remark gap named in the composition, and the ADL leg conserves only up to the unmodeled counterparty settlement.
Why it holds: The remainder fold adds C−∑jsj to exactly one share, restoring ∑isi=C identically regardless of rounding. The min/max pair is a complementary split of D at Φ1, and credit-before-absorb makes Φ1=Φ+g the balance absorption actually reads ((I.7) commits before (I.2)). The penalty legs are one atomic mutation carrying a single Λ capped at available collateral, so neither side can exceed the other. Fund closure Φ=Σrec−Σabs holds because every fund update moves the balance and exactly one ledger by the same amount.
Margin monotonicity (maintenance strictly inside initial)
For every admissible parameter set, maintenance margin is strictly below initial margin position-wise and in the portfolio sums ((M.4) vs (M.2), (M.10) vs (M.9)), so the liquidation region (L.4) is strictly contained in the admission-blocked region and a just-admitted order sits strictly above its maintenance floor at the admission mark. Honest behavioral scope: this is a geometric buffer, not a temporal guarantee — three engine-internal channels can close the gap with no input motion: the unguarded funding-settlement collateral debit ((F.4)), the taker-fee debit that admission headroom does not charge ((S.2) vs (M.14)), and trade-leg mark motion from the engine's own fills entering the blend (findings: unguarded funding debit, admission fee gap, trade-leg self-influence).
Why it holds: Both requirements are the product q⋅P⋅r differing only in the rate, and rm<ri is validated at parameter parse, so the per-position inequality is strict and survives summation over the identical position set. The effective rate only widens the gap (reff≥ri, (M.1)). No engine map weakens the inclusion — the three gap-closing channels move E, not the region ordering — so the invariant is preserved by every event while the behavioral contract is scoped to the cited channels.
Bounded funding transfer per interval
No funding settlement can move more than the cap fraction of a position's mark notional in one interval: the rate is clamped to [−c,+c] on both of its branches ((F.3)), and the payment is linear in the rate ((F.4)), so each account's per-position debit or credit is bounded by cqmk and the pool's gross throughput by cmk∑aqa.
Why it holds: The rate map has exactly two return paths: T=0 returns zero, and T>0 applies the clamp directly, so ∣f∣≤c in every reachable state. The payment map multiplies f by σqmk with no other rate dependence, and the settlement transfer carries exactly ∣Πf∣ ((S.6)) — no map between the clamp and the ledger can amplify the amount.
Fee closure across the fill path
Across any batch of fills, the fee flows between accounts and the Exchange fee account close exactly: every taker fee debited from an account is either paid out as a maker rebate or retained as revenue ((S.2), (S.3), (S.5)), the closure is preserved linearly under batch merge ((S.7)), and liquidation penalties never contaminate it — they route to the fund, never to Cfee ((S.4)).
Why it holds: Both accumulators are built fill-by-fill from the identical truncated amounts placed into the transfer ledger, and revenue is computed once as their difference — there is no independent revenue path to drift. The account-side legs are the same Ft and Fm the fill map applies to Ca, so the system-wide fee sum telescopes to zero. Merge only adds accumulators and concatenates transfers, so closure survives batching; the penalty push site targets the insurance fund and never enters F, R, or V.
Structure of the flow
Geometry of the healthy region. For a fixed position set, equity is affine in each mark with slope the net signed size, ∂E/∂mk=∑isi,k ((M.8)), while total maintenance is piecewise-linear with slope ∑iqi,krm,k ((M.10)) — so the healthy region {S:E>∑iMi} is, in the mark coordinate of a single-market account, a half-line whose boundary is exactly the displayed liquidation price ((T.8)), with the bankruptcy price ((T.9)) strictly beyond it for any under-collateralized position. Margin requirements scale linearly in size ((M.2)), the effective rate never undercuts the market rate ((M.1)), added exposure is non-negative so admission never pre-credits a reduce ((M.11)), and the slippage cap is monotone in its band ((B.10)).
Fixed points under constant input. Hold u constant with an empty or agreeing trade window (so mk=Poracle,k) and suppress user events. Then the premium vanishes ((F.1)), accrual adds 0⋅Δt to A while only the clock T advances, settlement computes f=0 and emits no transfer ((F.3), (S.6)), and the trigger stays silent on every healthy account: all economic coordinates (Ca,s,Pe,B,Φ,Cpool,Cfee) are fixed, and the funding pair (A,T) cycles through zero-amount settlements. Healthy states at an agreeing mark are thus equilibria of the autonomous engine. The interesting non-equilibria are one-sided: once E≤∑Mi, the cascade fires and the account's position coordinates contract monotonically toward flat; and because the trigger is inclusive ((L.4)), the boundary itself belongs to the liquidation region, not the healthy one.
Appendix — the complete formal system
This appendix is rendered mechanically from the state-space classification (models/state-space.json) — derived, not written. Its completeness claim is checked: the closure gate (ci/closure.py) verifies on every run that every corpus expression is classified, every state coordinate is written by an event and read somewhere, and every event map cites only defined coordinates. The state space factors into 16 coordinates (global fund and cash books; per-market book, trade window, premium accumulator, oracle anchor and re-anchor pending block; per-account collateral and reserved margin; per-position size/entry/direction and funding accumulator), 9 inputs, 20 parameters, and 54 derived observables, with all 133 corpus variables and 84 expressions classified totally across 10 events. Alphabet completion added adl_execution, oracle_reanchor_step, oracle_reanchor_commit — including adl_execution emitted with empty writes so the closure gate keeps flagging the unmodeled ADL counterparty settlement map. Deliberately uncited update maps (deposit/withdrawal transfer, cancel removal and reservation release, anchor assignments, trade-window push, funding resets) remain named gaps rather than inventions.
A.1 The state vector
global
funding_pool
Cpool
USDX
settlement
The funding pool book through which every funding transfer routes; nets to zero exactly across the matched open interest of one settlement. No component variable persists it — declared by the global composition; its only witnessed update is the transfer-magnitude map.
exchange_fee_account
Cfee
USDX
settlement
The Exchange fee account, carried with its settlement-record accumulators (total fees F, total rebates R, net revenue V = F - R, and their batch-merge operands): credited taker fees, debited maker rebates; liquidation penalties never enter it.
per-market
order_book
Bk
multiset of orders (side, limit price, remaining quantity, fill progress)
order-book
Resting-order multiset of the market with its id index in exact agreement; per-order fill progress (filled_qty) lives inside this composite; uncrossed (P_b < P_a) in every reachable state.
accumulated_premium
Ak
dimensionless-seconds
funding-rate
Time-weighted premium accumulator of the current funding interval, written only by the sample-contribution map and reset to zero atomically at settlement.
interval_clock
Tk
seconds
funding-rate
Elapsed accumulated time of the current funding interval, advanced with each sample and reset with A_k at settlement; the T = 0 branch of the rate keeps the map total. (The component text calls it derived; the composed system persists it as the interval's clock.)
trade_window
Wk
five (price, size) pairs
oracle
The last five executed fills of the market, written by the fill map (including liquidation close fills) and read by the volume-weighted median trade reference — the engine-owned leg of the mark blend.
insurance_fund_balance
Φk
USDX
insurance-fund
Per-market insurance fund balance: credited by spread profit and penalties, debited by bad-debt absorption; Phi >= 0 with exact depletion, and Phi = Sigma_rec - Sigma_abs against its lifetime ledgers.
insurance_fund_total_absorbed
Σabs
USDX
insurance-fund
Lifetime bad-debt absorption ledger of the fund; monotonically non-decreasing, incremented in lockstep with each absorption.
insurance_fund_total_received
Σrec
USDX
insurance-fund
Lifetime receipts ledger of the fund (initial balance plus spread profits and penalty credits); monotonically non-decreasing, moving in lockstep with balance credits. The initial-balance credit has no event in the alphabet (initialization, not dynamics).
oracle_anchor
Poracle,k
USDX per unit of asset
oracle
The trusted anchor price of the market — the engine's exogenous input process state; moved only by the guarded fresh-accept and re-anchor-commit branches of the oracle map, never by any engine event.
anchor_timestamp
tlast,k
milliseconds
oracle
Timestamp of the last trusted anchor update, read by the staleness predicate; frozen together with the anchor while a re-anchor is pending.
oracle_guard_state
Ωk
prints and milliseconds
oracle
The input process's defense bookkeeping: the ten-print history (whose oldest element the path check reads) and the pending re-anchor block (candidate price, pending print count, confirmation counter, opening timestamp); touched only by the oracle map.
per-account
account_collateral
Ca
USDX
margin-math
Realized USDX collateral of an account: the cash leg of deposits/withdrawals, realized PnL, fees, funding, and liquidation settlement; sign-unrestricted because engine-internal debits are unguarded.
reserved_margin
Mresv
USDX
margin-math
Initial margin reserved by resting/in-flight orders, carried with the open-reservation count n_{resv}; written at admission, released on fill or cancel, read by the cross admission gate and the withdrawal guard.
per-position
signed_position_size
sa,k
base units, signed
position-tracker
Signed position size (sigma = sign(s), q = |s| > 0 for a stored position, |s| a lot multiple); written only by the fill map (open, increase, reduce, flip) and the cascade's close fills.
entry_price
Pe,a,k
USDX per base unit
position-tracker
Volume-weighted entry price maintained exclusively by the VWAP blend: same-side fills blend, reductions leave it untouched, flips re-seed it at the fill price.
A.2 Inputs and parameters
Inputs are exogenous — they arrive from outside the state; parameters are constants of market or system configuration.
Inputs
oracle_print_price
Pnew
USDX per unit of asset
An incoming external oracle print being validated against the anchor or the pending re-anchor candidate.
wall_clock_time
tnow
milliseconds
Feed-supplied timestamp of the incoming print or staleness evaluation, in Unix milliseconds.
time_delta
Δt
seconds
Exogenous elapsed time since the previous funding premium sample; non-advancing samples are ignored.
order_quantity
q
base units
Quantity of an arriving order; must be a lot multiple to pass admission.
order_limit_price
Plim
USDX per base unit
Limit price of an arriving limit order; must be strictly positive, tick-aligned, and inside the mark collar.
order_signed_size
o
base units, signed
Signed size of an arriving order (buy positive, sell negative), read by the added-exposure computation.
max_slippage_bps
β
basis points
Taker-supplied per-order slippage cap on a market order; absent means no cap.
preview_requested_qty
qreq
base units
Quantity requested by a hypothetical market order in the read-only VWAP preview; undefined for non-positive requests.
external_transfer_amount
x
USDX
External USDX amount of a deposit or withdrawal; not a corpus variable — carried by the composition's deposit/withdrawal event.
Parameters
funding_rate_cap
c
fraction per funding interval
per-market
Symmetric cap on the funding rate; specified at 0.5% per settlement window.
adl_threshold
κ
USDX
per-market
ADL trigger threshold on the fund balance; default zero arms ADL only at full depletion.
maintenance_margin_rate
rm
dimensionless ratio
per-market
Market maintenance margin rate; strictly less than the initial margin rate.
initial_margin_rate
ri
dimensionless ratio
per-market
Market initial margin rate, equal to one over the market's maximum leverage.
account_leverage
L
multiplier
per-account
Account-selected leverage per market (integer >= 1, validated before storage); user configuration with no state-mutating expression in the corpus, hence a parameter, not a coordinate.
tick_size
δ
USDX per base unit
per-market
Minimum price increment; non-positive tick disables alignment.
lot_size
ℓ
base units
per-market
Market lot size; order and position sizes are integer multiples of it; zero disables the alignment check.
taker_fee_bps
bt
basis points
per-market
Taker fee rate charged on fill notional.
maker_rebate_bps
bm
basis points
per-market
Maker rebate rate, stored negative by convention; applied by absolute value.
liquidation_penalty_bps
bliq
basis points
per-market
Penalty rate applied to the notional of liquidation fills and routed to the insurance fund.
price_band_bps
bband
basis points
per-market
Maximum admissible relative deviation of a limit price from the mark (the admission collar).
oracle_deviation_threshold
θ
dimensionless fraction
per-market
Single-step deviation threshold for accepting an oracle print against the anchor.
oracle_history_size
Nh
prints
global
Fixed size of the rolling price-update window used by the path-manipulation check (HISTORY_SIZE = 10).
oracle_staleness_seconds
τs
seconds
per-market
Staleness threshold: the anchor is stale strictly beyond this many seconds since the last trusted update.
reanchor_max_deviation
θr
dimensionless fraction
per-market
Per-step consistency bound for re-anchor confirmations against the running candidate.
escalation_max_deviation
θe
dimensionless fraction
per-market
Widened per-step bound applied once the escalation trigger has fired.
required_confirmations
k
prints
per-market
Consecutive mutually-consistent prints required to promote a re-anchor; floored at 2 effectively.
escalation_prints
Ne
prints
per-market
Print-count arm of the re-anchor escalation trigger.
escalation_seconds
τe
seconds
per-market
Wall-clock arm of the re-anchor escalation trigger, measured from the opening of the pending sequence.
oracle_mark_weight
w
dimensionless fraction
per-market
Oracle weight in the mark blend; unit-interval, default 0.95 (oracle-dominant).
A.3 Derived observables
Pure functions of state, inputs, and parameters — recomputed, never persisted.
mark_price
mk
USDX per base unit
Convex blend of the trusted anchor and the volume-weighted trade reference; equals the anchor when no trade reference exists. Recomputed on demand, never persisted.
trade_ref
Ptrade
USDX per base unit
Volume-weighted median price of the five-trade window; falls back to the last trade price when the window is short.
premium_index
p
dimensionless
Fractional deviation of the mark from the anchor at a sample; skipped when the anchor is non-positive.
funding_rate
f
fraction per interval
Clamped time-weighted average premium, recomputed fresh from (A, T) at settlement with the T = 0 branch returning zero.
funding_payment
Πf
USDX
Signed per-position funding payment sigma q m f; simultaneously the settlement event's collateral update delta.
unrealized_pnl
uPnL
USDX
Per-position mark-to-market PnL; the account total is its sum over open positions (coherence-merged with liquidation-engine.fresh_unrealized_pnl).
account_equity
E
USDX
Collateral plus mark-to-market PnL (net of funding integrals in the portfolio form); coherence-merged across margin-math.equity, margin-math.portfolio_equity, and liquidation-engine.account_equity.
maintenance_margin
Mm
USDX
Maintenance margin at the mark; coherence-merged with the portfolio and liquidation-engine instances.
initial_margin
Mi
USDX
Initial margin at the mark (stamped allocated margin where set); coherence-merged with the portfolio instance.
available_margin
Mavail
USDX
Equity minus total initial margin held; can be negative; gates order admission, not withdrawal.
added_exposure
Δq
base units
Magnitude of newly-opened exposure an order adds: growth on increase, zero on reduce/close, the whole new side on a flip.
admission_added_margin
Madd
USDX
Initial margin charged on added exposure at the mark and effective rate; also the amount written into the reservation at admission.
isolated_margin_cushion
Ciso
USDX
Collateral backing an isolated position: the margin allocated at fill time if recorded, otherwise the open-time initial margin at market rate; the trigger ((L.4)) and the liquidation pricing both use this single value.
bankruptcy_price
pb
USDX per base unit
Price at which the position's backing collateral is exactly exhausted; coherence-merged with position-tracker.bankruptcy_price; may be zero or negative before alignment.
aligned_bankruptcy_price
p~b
USDX per base unit
Tick-aligned close-order limit: floor for sells (liquidation-engine.aligned_price_sell), ceil for buys (liquidation-engine.aligned_price_buy), clamped to one tick.
liquidation_price
pliq
USDX per base unit
Analytically-solved mark at which equity meets the maintenance requirement; display/analysis, neither moves state nor gates events.
cross_collateral_share
si
USDX
Loss-proportional share of the shared cross pool per market, with the remainder folded into the largest-loss position's share.
collateral_share_sum
S
USDX
``
Sum of the proportional shares before the remainder fold; prose-defined only — no corpus expression id (read by the remainder fold).
position_loss
ℓi
USDX
``
max(0, -uPnL_i) per market with entry-price fallback; defined only in variable prose, no corpus expression id.
total_loss
L
USDX
``
Sum of position losses across the positions liquidated together; prose-defined only.
safe_size
qsafe
base units
Largest lot-multiple size whose 1.5x-padded initial margin the collateral share covers.
liquidation_qty
qliq
base units
Close-order quantity: full size in Full mode or degenerate cases, else reduction to safe size.
fill_quantity
q⋆
base units
Quantity of a single fill: min of taker and front-maker remainders; coherence-merged with settlement.size and position-tracker.fill_quantity.
fill_price
P⋆
USDX per base unit
Price of a single fill — always the maker's limit price; coherence-merged with settlement.price and position-tracker/liquidation-engine fill prices.
closed_quantity
qc
base units
Portion of an opposing fill that closes existing size: min(size, fill quantity).
total_filled
Qf
base units
``
Sum of the liquidation close order's fill quantities; within-event accumulation, prose-defined only.
spread_profit
g
USDX
Positive part of fills' price improvement over the aligned bankruptcy price, summed over fills; credited to the fund.
realized_fill_pnl
Πfill
USDX
Signed realized PnL of liquidation fills, each at its own fill price; a component of the cascade's per-market settlement X_i.
residual_unfilled_pnl
Πres
USDX
Mark-valued PnL of the unfilled remainder of the close order; zero on complete fill.
bad_debt
D
USDX
Non-negative shortfall after fills-aware settlement against the collateral share; drawn from the fund, then ADL.
absorbed_amount
Dabs
USDX
min(bad debt, fund balance): the delta by which the fund and its absorption ledger move.
adl_settle_amount
Dadl
USDX
Shortfall handed to ADL after the fund is drained; an instruction is emitted only when strictly positive.
adl_priority_score
ρ
dimensionless
ADL ranking score pi * L, descending with deterministic account-id tie-break; coherence-merged with the insurance-fund instance.
adl_pnl_percent
π
fraction
``
ADL candidate's unrealized PnL as a fraction of position value; no corpus expression defines it — a gap for the closure gate.
liquidation_penalty_owed
Λowed
USDX
Penalty owed on filled liquidation notional at the market's penalty rate.
penalty_charged
Λ
USDX
Penalty actually debited/credited: the owed amount capped at available collateral, so the pair cannot mint USDX.
net_exchange_revenue
V
USDX
Settlement-record closure: total taker fees minus total maker rebates.
margin_ratio
ρM
dimensionless
Equity over total notional; undefined at zero notional; diagnostic — gates nothing in the corpus.
max_position_size
qmax
base units
Largest lot-aligned position openable with given collateral at the market rate; sizing/display analysis.
withdrawable_collateral
Wmax
USDX
Full realized collateral for a flat, unreserved account, zero otherwise; the withdrawal guard's cap.
best_bid
Pb
USDX per base unit
``
Highest resting bid — a structural readout of the order_book coordinate; no corpus expression id.
best_ask
Pa
USDX per base unit
``
Lowest resting ask — a structural readout of the order_book coordinate; no corpus expression id.
mid_price
Pmid
USDX per base unit
Midpoint of best bid and ask, snapshotted once at market-order submission for the slippage cap; undefined when either side is empty.
slippage_span
Δslip
USDX per base unit
Half-width of the admissible VWAP band anchored at the mid-price snapshot.
available_qty
Qavail
base units
``
Pre-match opposing liquidity at prices satisfying the taker's limit; within-event readout of the book, prose-defined only.
taker_remaining
qt
base units
``
Taker's unfilled remainder during the matching walk; within-event intermediate, prose-defined only.
running_notional
Vk
USDX
``
Cumulative notional of fills accepted so far in a market-order walk; within-event accumulator, prose-defined only.
running_filled
Qk
base units
``
Cumulative quantity of fills accepted so far in a market-order walk; within-event accumulator, prose-defined only.
walk_notional
V
USDX
``
Total notional of a hypothetical price-time-priority walk for the VWAP preview; prose-defined only.
vwap_estimate
P
USDX per base unit
Read-only market-order VWAP preview; undefined when liquidity cannot cover the request.
funding_integral
φ
USDX
``
Per-position accumulated funding read by portfolio equity; identically zero under the composed settle-and-reset convention (phi = 0) — no accrual map exists in the corpus, by design.
total_notional
N
USDX
``
Sum of size times mark over open positions; prose-defined only, the margin ratio's denominator.
open_positions
npos
count
``
Count of the account's open positions — a structural readout of the position coordinates; no corpus expression id.
A.4 The transition matrix
Guards
deposit_withdrawal
deposit: x > 0 unguarded; withdrawal: 0 < x \le W_{max} = C_a , \mathbb{1}[n_{pos} = 0 \wedge n_{resv} = 0] (margin-math.withdrawable_collateral)
account_collateral, withdrawable_collateral, open_positions, reserved_margin
order_submission_fill
admission conjunction, nothing mutated on rejection: lot residue = 0 (order-book.lot_alignment) \wedge tick residue = 0 \wedge P_{lim} > 0 (order-book.tick_alignment) \wedge band deviation \le b_{band} (order-book.price_band) \wedge FOK availability (order-book.fok_availability) \wedge margin headroom \ge 0 (isolated: margin-math.order_margin_headroom; cross: margin-math.cross_admission_headroom); each market-order fill additionally gated by the running-VWAP band (order-book.running_vwap)
account_collateral, reserved_margin, signed_position_size, entry_price, order_book, trade_window, exchange_fee_account, mark_price, account_equity, available_margin, initial_margin, added_exposure, admission_added_margin, best_bid, best_ask, mid_price, slippage_span, available_qty, taker_remaining, running_notional, running_filled, fill_quantity, fill_price, closed_quantity
order_cancel_expiry
user cancel \vee IOC/FOK/market-remainder expiry \vee post-only cross rejection \vee slippage-cap breach (order-book.running_vwap strict breach) \vee reduce-only rejection q_{liq} > q (liquidation-engine.reduce_only_guard fails) \vee STP full reduction (order-book.stp_decrement)
order_book, reserved_margin, mid_price, slippage_span, liquidation_qty
funding_accrual
\Delta t > 0 \wedge u_k > 0 (non-advancing or non-positive-anchor samples pass state through unchanged)
accumulated_premium, interval_clock, oracle_anchor, mark_price, premium_index, trade_window
funding_settlement
funding interval boundary reached (schedule is configuration; the corpus contributes the T = 0 totality branch of funding-rate.funding_rate)
accumulated_premium, interval_clock, funding_rate, funding_payment, mark_price, signed_position_size, account_collateral, funding_pool
liquidation_cascade
E \le \sum_i M_i at the fresh mark, inclusive (liquidation-engine.liquidation_trigger)
account_collateral, signed_position_size, entry_price, order_book, trade_window, insurance_fund_balance, insurance_fund_total_absorbed, insurance_fund_total_received, exchange_fee_account, mark_price, unrealized_pnl, account_equity, maintenance_margin, position_loss, total_loss, cross_collateral_share, collateral_share_sum, bankruptcy_price, aligned_bankruptcy_price, safe_size, liquidation_qty, fill_price, fill_quantity, total_filled, spread_profit, realized_fill_pnl, residual_unfilled_pnl, bad_debt, absorbed_amount, liquidation_penalty_owed, penalty_charged, adl_settle_amount
adl_execution
D_{adl} = \max(D - \Phi_1, 0) > 0 (insurance-fund.adl_settle_amount) nested with \Phi' \le \kappa (insurance-fund.adl_trigger); the one-sided divergence (armed with nothing to settle) is the open finding adl_arming_condition_ambiguity
adl_settle_amount, insurance_fund_balance, adl_priority_score, adl_pnl_percent, signed_position_size, entry_price, account_collateral
oracle_print_accept
\neg stale (oracle.is_stale = 0) \wedge \Delta_{step} \le \theta (oracle.single_step_deviation) \wedge (|H| = N_h \Rightarrow \Delta_{path} \le \theta\sqrt{N_h}) (oracle.path_deviation vs oracle.path_threshold)
oracle_anchor, anchor_timestamp, oracle_guard_state
oracle_reanchor_step
stale (oracle.is_stale = 1) \wedge print arrives \wedge confirmations after this step < \max(k, 2); active per-step bound is \theta_r, widened to \theta_e once the escalation trigger fires (oracle.reanchor_step_deviation, oracle.escalation_trigger)
oracle_guard_state, oracle_anchor, anchor_timestamp
oracle_reanchor_commit
stale \wedge consecutive mutually-consistent confirmations \ge \max(k, 2) (oracle.reanchor_step_deviation within the active bound on the promoting print)
oracle_guard_state, anchor_timestamp
Writes — rows are state coordinates, columns are events; a cell cites the component equation defining that update; · means provably untouched.

