Components
Tplus’ offchain components run inside Intel TDX TEEs, connected over an encrypted overlay network where every connection is bound to a TDX quote. The offchain components split into two kinds of service:- Hot services - OMS (Order Management System), orderbooks, interest engine. Fast, minimally replicated, and can only propose state changes.
- Cold services - the clearing engines. A replicated system that re-validates every proposal and approves movements of funds; a node quorum signs each withdrawal approval.
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 hold all funds and define the protocol’s root of trust (the authorized component images). 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, client order id rules, reduce-only constraints, and runs the preflight margin check.
- 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. An accepted REST create returns HTTP 200 with status
Received. - 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, risk controls, reduce-only constraints, and post-trade IM for every counterparty, at both oracle and mark price. Valid fills commit atomically; invalid ones are reverted.
- WebSocket trade-event streams carry the
Confirmed,FinalizedandRollbacked(reverted) statuses; authenticated REST trade history can also include confirmed and reverted trades. - Match reverts are per-party: if a maker is reverted for failing margin, its quantity is removed from the book and the taker’s restored quantity is re-matched against remaining liquidity. Revert reasons are disclosed only to the at-fault party; counterparties see
CounterpartyAtFault. - Fill-or-kill is atomic across the whole batch: if the clearing engine refuses any maker leg, the entire batch is reverted.
- Fills that reach the clearing engine more than 5 minutes after matching are reverted as a stale match.
Designated market maker order lifecycle
Designated market makers (DMMs) are approved accounts. They run the standard order lifecycle, with these differences:- Dedicated OMS. DMMs are typically provisioned a dedicated OMS that runs beside the orderbooks and 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 part of the OMS preflight (step 2). On a market whose base asset is a native asset they skip the spot balance check, the margin check and the quantity budget of attached child orders, and run the others, including the open interest checks and the limit on the number of child orders. On a token market the full preflight runs, as it does for every other order type except sync quotes, which skip it. The clearing engine still checks post-trade IM on every fill, so a fill that would leave the maker below IM is still reverted.
- Exempt from auto-reduce: negative trading capacity and a short spot balance never auto-cancel a maker’s post-only orders on a native market. Its other orders, and the account-type, reduce-only, withdrawal suspension, open interest and price state cuts, are handled as for any account.
- Synchronous making. DMMs quote in their own sync books. A sync taker is a spot limit order from a cross-margin account, routed across the sync book that would fill the most of it and the orderbook, walked together by price (the orderbook wins ties, so sync liquidity is not necessarily taken first); the clearing engine derives an onchain settlement from the sync fill, with the maker as settler, and the maker’s executor sources the underlying from onchain liquidity in the same atomic step - so the maker can quote an asset it holds no inventory in. Sync takers are spot-only, and one sent from an isolated-margin account is refused.
Deposit lifecycle
- Deposit onchain. Call
deposit(...)on the chain’s deposit contract. Funds stay in the deposit contract 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 tokens are credited to the Funding account as a token balance, normalized to 18 decimals.
Withdrawal lifecycle
- Move funds to the Funding account. A chain withdrawal spends tokens held in the Funding account. A native balance in a trading account is first moved there with a Funding account transfer, which passes a margin check, pays any rebalancing fee, and can wait in the Funding transfer queue for its redemption delay and for representation liquidity.
- Request. Submit a signed request specifying token, amount (18-decimal), and destination.
- Lock. The tokens are locked in the Funding account. This chain leg has no margin check, delay, partial fill, or fee.
- Approve and execute. At the next checkpoint, the clearing engines issue a quorum-signed, nonce-bound, expiring approval. The user calls
withdraw(...)and the deposit contract 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 clearing engine first confirms onchain that the withdrawal was never executed, then unlocks the locked tokens, so a withdrawal can never be both executed and refunded. Redemption delay, partial fills, and cancelling a queued transfer: 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 OMS returns the signed approval in the settlement response. Pass it to the settler for execution.
- Execute. The settler calls
executeAtomicSettlement(...)by the approval’svalidUntil; the validity window is configured per chain. The deposit contract 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 deposit contract rejects late or replayed execution. Lock mechanics, nonce scoping, and approval encryption: Settlement. Cross-venue margin: Funds. Synchronous making: Composability.