Components
Tplus’ offchain components run inside Intel TDX TEEs, connected over an encrypted overlay network where every connection is bound to a hardware attestation quote. The offchain components split into two tiers:- Hot tier - OMS (order management system), orderbooks, interest engine. Fast, minimally replicated, and can only propose state changes.
- Cold tier - the clearing engine network. Distributed system that re-validates every proposal, threshold-signs state changes, and authorizes movements of funds.
Offchain Architecture
Offchain components
Attested services running over the encrypted overlay network. The clearing engine is the only authoritative component; everything else proposes or serves data.Onchain components
Smart contracts custody all funds and define the protocol’s trust root (both authorized component images and state checkpoints). Contract addresses are defined in the Registry. Full reference: Contracts.Order lifecycle
- The client sends an order to the OMS over an authenticated session (a bearer token obtained by signing a login nonce). Each order also carries its own Ed25519 signature; the OMS checks that the authenticated user matches the signer, and the clearing engine verifies the signature itself before finalization (step 5).
- The OMS checks rate limits, signer identity, order ID rules, reduce-only constraints, and runs a margin pre-flight.
- The orderbook matches in price-time priority (FIFO within a price level). Trades execute at the maker’s price; price improvement goes to the taker. The OMS returns the order-created or order-filled acknowledgment once the orderbook accepts the order.
- Matched fills are forwarded to the clearing engine as proposals.
- The clearing engine verifies each order’s signature, then checks cumulative fill quantities (no overfill), order parameters, protocol caps, reduce-only constraints, and post-trade IM for every counterparty, at both oracle and mark price. Valid fills commit atomically; invalid ones roll back.
- WebSocket trade-event streams carry pending, confirmed, and rolled-back states; REST trade history returns confirmed trades only.
- Rollbacks are per-party: if a maker is rolled back for failing margin, its quantity is removed from the book and the taker’s restored quantity is re-matched against remaining liquidity. Rollback reasons are disclosed only to the at-fault party; counterparties see
CounterpartyAtFault. - Fill-or-kill is atomic across the whole batch: if any maker leg fails clearing, the entire batch rolls back.
- Fills that reach clearing more than 5 minutes after matching are rolled back as a stale match.
Market-maker order lifecycle
Market-maker accounts are a designated account type. They run the standard order lifecycle, with these differences:- Dedicated colocated OMS. Market makers are typically provisioned a dedicated OMS colocated with the orderbooks, that accepts only posts and cancels. The standard shared OMS serves the full REST/WebSocket API and sits behind a longer network path. This creates an implicit taker speed bump.
- Post-only orders skip the OMS margin pre-flight check (step 2); other order types still run it. Clearing still checks post-trade IM on every fill, so a fill that would leave the maker below IM still rolls back.
- Exempt from auto-reduce: negative trading capacity never auto-cancels a maker’s resting orders.
- Synchronous making. On market-maker-only sync orderbooks, an order bundles a delegated settlement request. The OMS checks that request’s signature and expiry before matching, and at fill the underlying is sourced from onchain liquidity in the same atomic step - so the maker can quote an asset it holds no inventory in. Sync books are spot-only and limited to the spot sub-accounts.
Deposit lifecycle
- Deposit onchain. Call
deposit(...)on the chain’s vault contract. Funds stay in the vault throughout. - Ingest. Blockchain clients pick up the
Depositedevent, confirmed by majority agreement across independent RPC providers. - Credit. Once the chain’s confirmation policy is met, the balance is credited and normalized to 18 decimals.
Withdrawal lifecycle
- Request. Submit a signed request specifying asset, amount (18-decimal), and destination.
- Lock and margin check. The withdrawal amount is locked. Solvency is checked against the amount plus any dynamic rebalancing fee; a request that would leave the account under-margined is rejected with nothing locked.
- Delay queue. The request waits a delay derived from the user’s recent withdrawal-capacity usage for that asset, mapped through configured delay tiers and clamped to onchain minimum and maximum bounds.
- Fill. After the delay, it is filled from vault liquidity, FIFO per asset.
- Approve and execute. At the next checkpoint, the protocol issues a quorum-signed, nonce-bound, expiring approval. The user calls
withdraw(...)and the vault verifies the quorum, nonce, and expiry.
withdraw(...) executes. Approvals are single-use, nonce-bound, and expire at validUntil. If an approval lapses before the user executes it - the protocol first confirms onchain that the withdrawal was never executed, then unlocks the locked funds, so a withdrawal can never be both executed and refunded. Fees, partial-fill rules, cancellation, and the escape hatch: Withdrawals.
Settlement lifecycle
- Request and margin check. Submit a signed request specifying
asset_out/asset_in, amounts, sub-account, and settler. The clearing engine runs an initial-margin check at both oracle and mark price; the settlement must not decrease the IM surplus, though accounts with no borrows always pass. - Lock. The outgoing amount moves into a settlement lock keyed by chain and nonce.
- Approve. The protocol signs a time-bound approval and delivers it to the settler, encrypted to the settler’s key.
- Execute. The settler calls
executeAtomicSettlement(...)within the 10-second validity window; the vault verifies signature, nonce, and expiry. - Confirm or expire. A confirmed event credits
asset_in. If execution does not land in time or reverts, the lock expires and the outgoing funds are restored.
asset_in is credited or the lock expires and the outgoing funds are restored - never a partial state. Once validUntil passes or the nonce is consumed, the vault rejects late or replayed execution. Lock mechanics, nonce scoping, and approval encryption: Settlement. Cross-margining: Funds. Synchronous making: Composability.