developers:apiv2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
developers:apiv2 [2026/09/07 13:13] – created chaddevelopers:apiv2 [2026/09/07 13:43] (current) chad
Line 1: Line 1:
-====== T4 WebSocket API (V2) ======+====== Plus500 Futures Technologies WebSocket API (V2) ======
  
 A single, streaming WebSocket connection for real-time market data, account/position updates and order routing. Messages are encoded with [[https://protobuf.dev/|Google Protocol Buffers]]. A single, streaming WebSocket connection for real-time market data, account/position updates and order routing. Messages are encoded with [[https://protobuf.dev/|Google Protocol Buffers]].
  
-**Source of truth:** the ''.proto'' files define every message and field. This wiki explains the connection model and the common flows; it does **not** repeat every field. When in doubtread the proto — see the [[developers:websocket:reference|Message Catalog]].+**Proto Files:** the ''.proto'' files define every message and field. This wiki explains the connection model and the common flows. For message field detailssee the proto files and the [[developers:apiv2:reference|Message Catalog]].
  
-===== The message model =====+===== Key Capabilities =====
  
-Everything travels inside one of two envelopesone Protobuf message per WebSocket **binary** frame:+^ Feature ^ Included ^ Description ^ 
 +| **Real-time Quotes** | ✅ | Stream live bid/ask price updates for any instrument. | 
 +| **Level 1 Data** | ✅ | Access top-of-book best bid and offer (BBO). | 
 +| **Level 2 (Market Depth)** | ✅ | View **up to 10 levels** of bid/ask depth. | 
 +| **Market by Order (MBO)** | ✅ | See individual resting orders in the order book. | 
 +| **Trade Feed (Ticker)** | ✅ | Get a **real-time execution stream** of all trades. | 
 +| **Order Management** | ✅ | Submitmodify, and cancel orders programmatically. | 
 +| **Position & Account Monitoring** | ✅ | Track open positions, P&L, and margin usage. | 
 +| **Instrument Metadata** | ✅ | Retrieve contract specs, tick sizes, and margin requirements. | 
 +| **Spread Trading** | ✅ | Execute spread orders with **complex multi-leg strategies**. | 
 +| **Risk & Margin Data** | ✅ | Get real-time margin requirements and risk exposure. | 
 +| **Historical Data Requests** | ✅ | Fetch recent trade history and market activity. | 
 +| **Efficient Binary Encoding** | ✅ | Uses Protobuf for **low-bandwidth, high-speed** messaging. | 
 +| **Secure Authentication** | ✅ | Ensures safe access with API key-based authentication. | 
 +**Robust Reconnection** | ✅ | Auto-reconnect and resume subscriptions on disconnection. |
  
-  * ''ClientMessage''  — everything you send to the server. +===== Why Use This API? =====
-  * ''ServerMessage''  — everything the server sends to you.+
  
-Each envelope is a ''oneof'': exactly one payload is setRead the ''payload'' case to know what you received.+  * **Fast & Reliable** – Designed for **high-frequency updates and real-time execution**. 
 +  * **Compact & Efficient** – Protobuf minimizes bandwidth, ensuring **fast message processing**. 
 +  * **Comprehensive Market Data** – Access **Level 1, Level 2, and Market by Order** data. 
 +  * **Built for Futures Trading** – Includes **contract metadata, spread trading, and risk monitoring**. 
 +  * **Scalable & Industry-Proven** – Handles **thousands of concurrent connections**. 
 +  * **Secure & Encrypted** – Uses **WSS (WebSocket Secure) over SSL/TLS** to protect data. 
 +  * **Event-Driven & Easy to Integrate** – A simple subscription model delivers the data you need.
  
-<code> +===== Developer Guides =====
-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 { +**Section**                                        **Description**  
-  oneof payload { +| **[[developers:apiv2:connecting|Connecting and Authenticating]]** | Instructions on establishing a connection and handling authentication. | 
-    Heartbeat            heartbeat              = 1; +**[[developers:apiv2:markets|Market Data & Definitions]]** | How to retrieve market lists, subscribe to quotes, and understand market definition messages| 
-    auth.LoginResponse   login_response         = 2; +| **[[developers:apiv2:accounts|Account Feed]]** | Receiving account, position, and order updates in real time| 
-    market.MarketSnapshot         market_snapshot          = 108; +| **[[developers:apiv2:orders|Order Routing]]** | Submitting orderssupported order types, and handling updates| 
-    account.AccountSnapshot       account_snapshot         = 205; +| **[[developers:apiv2:pricing|Pricing and Data Types]]** | Understanding price formatting and how decimal values are represented. | 
-    orderrouting.OrderUpdate      order_update             = 300; +| **[[developers:apiv2:reference|Message Catalog]]** | Every message, mapped to its proto definition| 
-    // ... +| **[[developers:apiv2:migrating|Migrating from V1]]** | What changed from V1 and how to upgrade| 
-  } +| **[[developers:apiv2:certification|Certification and Testing]]** | Development checklist and pre/post-certification requirements| 
-+| **[[developers:apiv2:faq|FAQ]]** | Answers to common questions about the API. |
-</code> +
- +
-The full envelope is in ''proto/t4/v2/service.proto''. See the [[developers:websocket:reference|Message Catalog]] for the complete list. +
- +
-===== Endpoints ===== +
- +
-Environment URL +
-Simulator | ''wss://wss-sim.t4login.com/v2''+
-| Live | ''wss://wss.t4login.com/v2''+
-| Admin (Simulator) | ''wss://wssadmin-sim.t4login.com/v2''+
-| Admin (Live) | ''wss://wssadmin.t4login.com/v2''+
- +
-All connections are WSS (TLS) on port 443. **Develop and certify against the Simulator.** See [[developers:websocket:connecting|Connecting Authenticating]]+
- +
-===== Versions ===== +
- +
-  * **V2** (''/v2'') — current. These pages. +
-  * **V1** (''/v1'') — [[developers:websocket_v1|legacy]], retained for existing integrationsSee [[developers:websocket:migrating|Migrating from V1]]. +
- +
-===== Contents ===== +
- +
-  * [[developers:websocket:connecting|Connecting & Authenticating]] — endpoints, login, heartbeat, reconnect. +
-  * [[developers:websocket:markets|Market Data]] — subscribe to depth (MBP) and order-by-order (MBO) feeds+
-  * [[developers:websocket:accounts|Account Feed]] — subscribe to accountspositions and P&L+
-  * [[developers:websocket:orders|Order Routing]] — submit, revise, pullbatch; order updates and fills+
-  * [[developers:websocket:pricing|Prices, Volumes & Data Types]] — how numbers are represented on the wire+
-  * [[developers:websocket:reference|Message Catalog]] — every message, with links to the proto. +
-  * [[developers:websocket:migrating|Migrating from V1]] — what changed and why+
-  * [[developers:websocket:certification|Certification]] — going live+
-  * [[developers:websocket:faq|FAQ]]+
  
  • developers/apiv2.1788786836.txt.gz
  • Last modified: 2026/09/07 13:13
  • by chad