ClearingEngineClient is the authenticated client for the T+ clearing engine. Rather than exposing a flat list of methods, it organises functionality into focused sub-clients, each accessible as a property. You use client.deposits to move funds in, client.withdrawals to move funds out, client.settlements to process settlement flows, client.vaults and client.assets to inspect the on-chain registry, and client.decimals to look up asset precision.
Initialization
ClearingEngineClient requires a User (for signing requests) and the base URL of your clearing engine instance. Use it as an async context manager.
Sub-Client Properties
ClearingEngineClient exposes functionality through the following cached properties. Each property returns a dedicated sub-client scoped to that domain.
client.deposits
Initiate and track asset deposits from on-chain wallets into the T+ system. See
examples/deposit.py for a runnable end-to-end flow.client.withdrawals
Request withdrawals from the T+ system back to on-chain addresses. See
examples/ for examples.client.settlements
Submit and manage settlement requests, typically used to finalise trades between counterparties. See
examples/settlement.py.client.vaults
Read vault addresses and configuration from the T+ registry.
client.vaults.get() returns list[ChainAddress].client.assets
Query registered assets. Use
AssetAddress for tradable tokens and ChainAddress for vault/registry addresses.client.decimals
Look up the decimal precision for any registered asset — essential before scaling quantities to or from integer form.
client.admin
Administrative operations. Only available to authorised users with the admin role.
Typical Workflow: Checking Asset Info and Decimals
A common task before any deposit or trade is confirming the registered asset details and its decimal precision, so you can correctly scale amounts.Use
AssetAddress.from_evm_address(address, chain_id=...) to build identifiers for EVM tokens. The chain_id parameter takes the raw EVM chain ID (e.g. 11155111 for Sepolia) — the helper encodes the T+ 9-byte chain-ID format for you. Never hand-write the @<chain> suffix.When to Use ClearingEngineClient vs. OrderBookClient
ClearingEngineClient and OrderBookClient connect to different backend services and serve distinct purposes.
| Task | Use |
|---|---|
| Place, cancel, or replace orders | OrderBookClient |
| Stream live order/trade events | OrderBookClient |
| Query user inventory, margin, positions | OrderBookClient |
| Deposit funds into T+ | ClearingEngineClient (.deposits) |
| Withdraw funds from T+ | ClearingEngineClient (.withdrawals) |
| Submit or query settlements | ClearingEngineClient (.settlements) |
| Look up registered assets or vaults | ClearingEngineClient (.assets, .vaults) |
| Get asset decimal precision | ClearingEngineClient (.decimals) |
| Market data (snapshots, klines, tickers) | MarketDataClient |
Error Handling
ClearingEngineClient raises the same typed exceptions as the rest of the T+ SDK. Import them from tplus: