Docs / How it actually works
Architecture overview
Nine components, with deliberately narrow responsibilities. The boundaries matter more than the internals: they are what stops settlement cash and user margin ever touching.
Components
| Component | Responsibility |
|---|---|
| Market Registry | Unique market identity, token source references, committed risk policy, activation and lifecycle |
| Price Oracle Router | Pool discovery, observation aggregation, deviation checks, quoted-asset conversion, pause and settlement snapshots |
| Risk Engine | Directional OI, account margin, leverage tiers, payout caps, stress and oracle-cost constraints |
| Position Engine | Synthetic long/short entries, exits and liquidations; explicit fee and haircut computation |
| Collateral Ledger | Deposits and withdrawals, open-margin isolation, no phantom balances |
| Global Settlement | Settlement cash, side bucket, FIFO debt queue, harvest and the revenue waterfall |
| Rewards Controller | Deferred, capped settled-loss rewards, kept separate from settlement cash |
| SDK + App | OpenLaunch embed, standalone market pages, mobile-first wallet flow |
| Indexer & Dashboard | Public solvency, claims, market states and position feed with reorg resilience |
The boundaries that matter
- Collateral Ledger ≠ Global Settlement. Posted margin is a liability to the trader. Settlement cash is the pool. No code path moves one into the other.
- Rewards Controller ≠ Global Settlement. Token rewards can never be counted as settlement liquidity, and cannot pay a USDC claim.
- Oracle Router ≠ Position Engine. The same snapshot and policy are used for voluntary closes, liquidations and risk-limit updates — there is no second, more convenient price.
- Market Registry ≠ Risk Engine. Registering a market is free and open; activating one is a policy decision with published reasons.
Operational guarantees
- Invariants fuzz-tested for every ordering of opens, closes, liquidations and harvests: segregated margin cannot be spent, claims cannot be duplicated.
- Oracle adversarial simulation: single-pool flash volume, TWAP nudging, liquidity removal, sandwiching, multi-wallet coordinated settlements, stale cross-pool routes.
- Referee test: one snapshot and policy applied consistently across closes, liquidation and limit updates; deterministic shutdown and expiry.
- Liquidation liveness under high gas, sequencer delays, missing keepers, reorganizations and token freezes.
- Queue recovery stress testing with persistent net shorts, correlated crashes and no future loss inflow at all.
- External review and published security limitations before real collateral is accepted. Demo and testnet stay labelled until then.
Public reconciliation
Contracts expose aggregate and per-market open interest, queue, margin and fees so that solvency can be reconstructed by a third party from chain state. The dashboard is a convenience, not the source of truth.
Last updated: 2026-10-28