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.
Proto Files: the .proto files define every message and field. This wiki explains the connection model and the common flows. For message field details, please see the proto files. Message Catalog.
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.
Contents
- Connecting & Authenticating — endpoints, login, heartbeat, reconnect.
- Market Data — subscribe to depth (MBP) and order-by-order (MBO) feeds.
- Account Feed — subscribe to accounts, positions and P&L.
- Order Routing — submit, revise, pull, batch; order updates and fills.
- Prices, Volumes & Data Types — how numbers are represented on the wire.
- Message Catalog — every message, with links to the proto.
- Migrating from V1 — what changed and why.
- Certification — going live.