Skip to main content

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.
Onchain contracts hold funds and release them only against signed, nonce-bound, expiring approvals: a node quorum signs each withdrawal approval, and one attested clearing engine key signs each settlement approval. The full hierarchy, including external parties, is in the trust model.

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

  1. 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).
  2. The OMS checks rate limits, signer identity, client order id rules, reduce-only constraints, and runs the preflight margin check.
  3. 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.
  4. Matched fills are forwarded to the clearing engine as proposals.
  5. 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.
A fill is finalized only when the clearing engine finalizes it, not when the orderbook matches it. In practice, an orderbook match is a confirmed fill: because orders are validated and margin-checked before they reach the book, the clearing engine finalizes the vast majority of fills unchanged. You can act on a confirmed fill immediately for most purposes; wait for the finalized fill only before an irreversible action against it (for example, releasing value off-platform). The mechanics:
  • WebSocket trade-event streams carry the Confirmed, Finalized and Rollbacked (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

  1. Deposit onchain. Call deposit(...) on the chain’s deposit contract. Funds stay in the deposit contract throughout.
  2. Ingest. Blockchain clients pick up the Deposited event, confirmed by majority agreement across independent RPC providers.
  3. 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.
Chain finality. Each deposit is credited exactly once, tracked by a per-user, per-chain deposit nonce. A check after the confirmations drops events on orphaned blocks and re-ingests from the chain’s surviving fork, so a reorg can delay a credit but never double-credits or loses one. Confirmation policy and waits per chain, decimals, admission caps, and native assets: Deposits.

Withdrawal lifecycle

  1. 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.
  2. Request. Submit a signed request specifying token, amount (18-decimal), and destination.
  3. Lock. The tokens are locked in the Funding account. This chain leg has no margin check, delay, partial fill, or fee.
  4. 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.
Completion. The withdrawal is complete once the onchain 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

  1. 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.
  2. Lock. The outgoing amount moves into a settlement lock keyed by chain and nonce.
  3. Approve. The OMS returns the signed approval in the settlement response. Pass it to the settler for execution.
  4. Execute. The settler calls executeAtomicSettlement(...) by the approval’s validUntil; the validity window is configured per chain. The deposit contract verifies signature, nonce, and expiry.
  5. 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.
Atomicity. Settlement is atomic: either 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.