FOREVER MARKETS
Architecture
How execution, clearing, custody, oracle and liquidity contracts fit together.
Trade flow
The router owns price-time-priority book storage and logical order escrow. Physical USDG remains classified inside the clearing engine, preventing six-decimal rounding loss across many partial fills.
Wallet
↓ deposit / authorization
Deterministic smart account
↓ scoped order
Hybrid execution router ── CLOB + LP curve
↓ atomic settlement
Bounded market clearing engine
↙ oracle ↘ shared LP sleeveCore modules
| Module | Responsibility |
|---|---|
| Market clearing engine | Positions, margin, PnL, funding, reserves and solvency |
| Execution router | CLOB, PMM routing, TIF and partial fills |
| Smart accounts | Per-user collateral custody and scoped execution |
| Shared LP vault | Global shares, conservative NAV, sleeves and withdrawals |
| Complete-set market | Fully collateralized complementary spot claims |
| Oracle | Conservative NVIDIA / AMD dominance bounds |
| Risk lens | Read-only leverage and liquidation previews |
Upgradeability and authority
The market, router, shared vault, complete-set market and risk lens are UUPS proxies. User smart accounts share an upgradeable beacon implementation. The current protocol admin wallet controls upgrades and risk configuration.
Upgradeability speeds capped-beta fixes but creates admin-key risk. There is currently no multisig or timelock. Users should treat that as a material protocol risk.