This is an old revision of the document!
T4 WebSocket API (V2)
A single, streaming WebSocket connection for real-time market data, account/position updates and order routing. Messages are encoded with Google Protocol Buffers for compact, low-latency binary messaging.
Proto Files: the .proto files define every message and field. This wiki explains the connection model and the common flows. For message field details, see the proto files and the Message Catalog.
Key Capabilities
| Capability | Description |
|---|---|
| Real-time Quotes | Live bid/ask updates for any instrument. |
| Top of Book (L1) | Best bid and best offer. |
| Market Depth (L2) | Full depth of market, aggregated by price. |
| Market by Order (MBO) | Individual resting orders, with queue position. |
| Trade Feed (Ticker) | Real-time stream of executions. |
| Order Routing | Submit, revise, pull, and batch orders. |
| Pre-trade Margin | Preview margin impact before placing an order. |
| Account & Positions | Real-time balances, positions, P&L and margin. |
| Instrument Metadata | Contract specs, tick size, point value, margin. |
| Spread / Multi-leg | Trade and define user-defined strategies (UDS). |
| Fractional Volumes | Decimal order quantities (e.g. Kalshi). |
| Efficient Binary Encoding | Protobuf for low-bandwidth, high-speed messaging. |
| Secure Authentication | API-key authentication over WSS (TLS). |
| Robust Reconnection | Reconnect and re-subscribe after a disconnect. |
Why Use This API?
- Fast — built for high-frequency updates and low-latency order execution.
- Compact — Protobuf keeps messages small and quick to parse.
- Complete — L1, L2 and Market-by-Order data, plus trading, positions and risk in one connection.
- Built for futures — instrument metadata, spread trading and margin data included.
- Secure — WSS (TLS) transport with API-key authentication.
Message Model
All messages travel inside a transport envelope, one Protobuf message per WebSocket binary frame:
ClientMessage— everything you send to the server.ServerMessage— everything the server sends to you.
Each envelope is a oneof: exactly one payload is set. Read the payload case to know what you received.
message ClientMessage {
oneof payload {
Heartbeat heartbeat = 1;
auth.LoginRequest login_request = 2;
market.MarketSubscribe market_subscribe = 100;
account.AccountSubscribe account_subscribe = 200;
orderrouting.OrderSubmit order_submit = 300;
// ...
}
}
message ServerMessage {
oneof payload {
Heartbeat heartbeat = 1;
auth.LoginResponse login_response = 2;
market.MarketSnapshot market_snapshot = 108;
account.AccountSnapshot account_snapshot = 205;
orderrouting.OrderUpdate order_update = 300;
// ...
}
}
The full envelope is in proto/t4/v2/service.proto. See the Message Catalog for the complete list.
Endpoints
| Environment | URL |
|---|---|
| Simulator | wss:wss-sim.t4login.com/v2 |
| Admin (Simulator) | wss:wssadmin-sim.t4login.com/v2 |
All connections are WSS (TLS) on port 443. Develop and certify against the Simulator. See Connecting & Authenticating.
Versions
- V2 (
/v2) — current. These pages.
Developer Guides
| Section | Description |
|---|---|
| Connecting & Authenticating | Establish a connection, log in, heartbeat and reconnect. |
| Market Data | Subscribe to depth (MBP) and order-by-order (MBO) feeds. |
| Account Feed | Account, position and P&L updates. |
| Order Routing | Submit, revise, pull and batch orders; handle updates and fills. |
| Prices, Volumes & Data Types | How prices and volumes are represented on the wire. |
| Message Catalog | Every message, with links to the proto. |
| Migrating from V1 | What changed from V1. |
| Certification | Checklist and going live. |
| FAQ | Common questions. |