developers:apiv2:reference

This is an old revision of the document!


Message Catalog

◀ WebSocket API (V2)

The .proto files define every message and field. This page maps each envelope payload to its message and the proto file that describes it.

All messages travel inside a transport envelope, one Protobuf message per WebSocket binary frame:

  • ClientMessage — Client → Server messages
  • ServerMessage — Server → Client messages

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.

Proto Files in the T4 GitHub Repository

File Contents
proto/t4/v2/service.proto ClientMessage / ServerMessage envelopes, Heartbeat.
https://github.com/CTS-Futures/t4-api-tools/blob/main/proto/t4/v2/auth/auth.proto Login and authentication tokens.
proto/t4/v2/market/market.proto Market-data subscribe and feed messages.
proto/t4/v2/account/account.proto Account subscribe, snapshot and updates.
proto/t4/v2/orderrouting/orderrouting.proto Order submit/revise/pull/batch and updates.
proto/t4/v2/common/enums.proto All enums.
proto/t4/v2/common/price.proto Price and Decimal wrappers.
Field Payload Purpose Docs
1 Heartbeat Keepalive. Connecting
2 LoginRequest Authenticate. Connecting
3 AuthenticationTokenRequest Request a token. Connecting
100 MarketSubscribe Subscribe/unsubscribe a market (quotes level + ticker). Market Data
200 AccountSubscribe Subscribe account(s). Account Feed
300 OrderSubmit Place order(s). Order Routing
301 OrderRevise Revise order(s). Order Routing
302 OrderPull Cancel order(s). Order Routing
303 OrderBatch All-or-nothing batch. Order Routing
340 CreateUDS Define a strategy. Order Routing
Field Payload Purpose Docs
1 Heartbeat Keepalive. Connecting
2 LoginResponse Login result, identity, entitlements. Connecting
3 AuthenticationToken Token + expiry. Connecting
100 MarketSubscribeReject Subscribe refused (check mode). Market Data
102 MarketDetails Instrument definition. Market Data
103 MarketDepth Depth update (top-of-book / full book). Market Data
104 MarketTrade Trade print (ticker). Market Data
105 MarketHighLow Session high/low/open. Market Data
106 MarketPriceLimits Price limits. Market Data
107 MarketSettlement Settlement, OI, VWAP. Market Data
108 MarketSnapshot Full state on subscribe (price feed). Market Data
109 MarketByOrderSnapshot Full book on subscribe (MBO). Market Data
110 MarketByOrderUpdate Per-order changes (MBO). Market Data
200 AccountSubscribeResponse Subscribe result. Account Feed
201 AccountCurrency Currency rates. Account Feed
202 AccountPosition Position. Account Feed
203 AccountUpdate Balances / margin. Account Feed
204 AccountDetails Account configuration. Account Feed
205 AccountSnapshot Full state on subscribe. Account Feed
206 AccountProfit Account UPL / RPL. Account Feed
207 AccountPositionProfit Per-position UPL / RPL. Account Feed
300 OrderUpdate Unified order lifecycle event. Order Routing
301 OrderTrade Fill. Order Routing
302 MarginInquiryResponse Margin preview. Order Routing
310 OrderBatchAcknowledge Batch accepted. Order Routing
311 OrderBatchReject Batch rejected. Order Routing
340 CreateUDSResponse Strategy created. Order Routing
  • developers/apiv2/reference.1788793790.txt.gz
  • Last modified: 2026/09/07 15:09
  • by chad