developers:apiv2

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:apiv2 [2026/09/07 13:27] 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]] for compact, low-latency binary messaging.+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]].
  
 **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 [[developers:apiv2: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 details, see the proto files and the [[developers:apiv2:reference|Message Catalog]].
Line 7: Line 7:
 ===== Key Capabilities ===== ===== Key Capabilities =====
  
-Capability ^ Description ^ +Feature ^ Included ^ Description ^ 
-| **Real-time Quotes** | Live bid/ask updates for any instrument. | +| **Real-time Quotes** | ✅ | Stream live bid/ask price updates for any instrument. | 
-| **Top of Book (L1)** | Best bid and best offer. | +| **Level 1 Data** | ✅ | Access top-of-book best bid and offer (BBO). | 
-| **Market Depth (L2)** | Full depth of market, aggregated by price. | +| **Level 2 (Market Depth)** | ✅ | View **up to 10 levels** of bid/ask depth. | 
-| **Market by Order (MBO)** | Individual resting orders, with queue position. | +| **Market by Order (MBO)** | ✅ | See individual resting orders in the order book. | 
-| **Trade Feed (Ticker)** | Real-time stream of executions. | +| **Trade Feed (Ticker)** | ✅ | Get a **real-time execution stream** of all trades. | 
-| **Order Routing** | Submit, revise, pull, and batch orders. | +| **Order Management** | ✅ | Submit, modify, and cancel orders programmatically. | 
-| **Pre-trade Margin** | Preview margin impact before placing an order. | +| **Position & Account Monitoring** | ✅ | Track open positions, P&Land margin usage. | 
-| **Account & Positions** | Real-time balances, positions, P&L and margin. | +| **Instrument Metadata** | ✅ | Retrieve contract specs, tick sizesand margin requirements. | 
-| **Instrument Metadata** | Contract specs, tick size, point value, margin. | +| **Spread Trading** | ✅ | Execute spread orders with **complex multi-leg strategies**| 
-| **Spread / Multi-leg** | Trade and define user-defined strategies (UDS). | +| **Risk & Margin Data** | ✅ | Get real-time margin requirements and risk exposure. | 
-| **Fractional Volumes** | Decimal order quantities (e.g. Kalshi). | +| **Historical Data Requests** | ✅ | Fetch recent trade history and market activity. | 
-| **Efficient Binary Encoding** | Protobuf for low-bandwidth, high-speed messaging. | +| **Efficient Binary Encoding** | ✅ | Uses Protobuf for **low-bandwidth, high-speed** messaging. | 
-| **Secure Authentication** | API-key authentication over WSS (TLS). | +| **Secure Authentication** | ✅ | Ensures safe access with API key-based authentication. | 
-| **Robust Reconnection** | Reconnect and re-subscribe after a disconnect. |+| **Robust Reconnection** | ✅ | Auto-reconnect and resume subscriptions on disconnection. |
  
 ===== Why Use This API? ===== ===== Why Use This API? =====
  
-  * **Fast** — built for high-frequency updates and low-latency order execution. +  * **Fast & Reliable** – Designed for **high-frequency updates and real-time execution**
-  * **Compact** — Protobuf keeps messages small and quick to parse+  * **Compact & Efficient** – Protobuf minimizes bandwidth, ensuring **fast message processing**
-  * **Complete** — L1L2 and Market-by-Order data, plus trading, positions and risk in one connection+  * **Comprehensive Market Data** – Access **Level 1, Level 2, and Market by Order** data. 
-  * **Built for futures** — instrument metadata, spread trading and margin data included+  * **Built for Futures Trading** – Includes **contract metadata, spread tradingand risk monitoring**
-  * **Secure** — WSS (TLS) transport with API-key authentication. +  * **Scalable & Industry-Proven** – Handles **thousands of concurrent connections**. 
- +  * **Secure Encrypted** – Uses **WSS (WebSocket Secure) over SSL/TLS** to protect data
-===== Message Model ===== +  * **Event-Driven & Easy to Integrate** – A simple subscription model delivers the data you need.
- +
-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. +
- +
-<code> +
-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; +
-    // ... +
-  } +
-+
-</code> +
- +
-The full envelope is in ''proto/t4/v2/service.proto''. See the [[developers:apiv2: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:apiv2:connecting|Connecting Authenticating]]. +
- +
-===== Versions ===== +
- +
-  * **V2** (''/v2'') — current. These pages+
-  * **V1** (''/v1'') — [[developers:api|v1 (legacy)]], retained for existing integrations. See [[developers:apiv2:migrating|Migrating from V1]].+
  
 ===== Developer Guides ===== ===== Developer Guides =====
  
-^ Section ^ Description ^ +**Section**                                        **Description**  
-| [[developers:apiv2:connecting|Connecting Authenticating]] | Establish a connection, log in, heartbeat and reconnect. | +**[[developers:apiv2:connecting|Connecting and Authenticating]]** Instructions on establishing a connection and handling authentication. | 
-| [[developers:apiv2:markets|Market Data]] | Subscribe to depth (MBP) and order-by-order (MBO) feeds. | +**[[developers:apiv2:markets|Market Data & Definitions]]** How to retrieve market lists, subscribe to quotes, and understand market definition messages. | 
-| [[developers:apiv2:accounts|Account Feed]] | Account, position and P&updates. | +**[[developers:apiv2:accounts|Account Feed]]** Receiving account, positionand order updates in real time. | 
-| [[developers:apiv2:orders|Order Routing]] | Submitrevisepull and batch orders; handle updates and fills. | +**[[developers:apiv2:orders|Order Routing]]** Submitting orderssupported order types, and handling updates. | 
-| [[developers:apiv2:pricing|Prices, Volumes & Data Types]] | How prices and volumes are represented on the wire. | +**[[developers:apiv2:pricing|Pricing and Data Types]]** Understanding price formatting and how decimal values are represented. | 
-| [[developers:apiv2:reference|Message Catalog]] | Every message, with links to the proto. | +**[[developers:apiv2:reference|Message Catalog]]** | Every message, mapped to its proto definition. | 
-| [[developers:apiv2:migrating|Migrating from V1]] | What changed from V1. | +**[[developers:apiv2:migrating|Migrating from V1]]** | What changed from V1 and how to upgrade. | 
-| [[developers:apiv2:certification|Certification]] | Checklist and going live. | +**[[developers:apiv2:certification|Certification and Testing]]** Development checklist and pre/post-certification requirements. | 
-| [[developers:apiv2:faq|FAQ]] | Common questions. |+**[[developers:apiv2:faq|FAQ]]** Answers to common questions about the API. |
  
  • developers/apiv2.1788787638.txt.gz
  • Last modified: 2026/09/07 13:27
  • by chad