developers:websocket

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:websocket [2025/03/14 02:56] chaddevelopers:websocket [2025/03/14 17:56] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Getting Started ======+===== WebSocket API Introduction =====
  
-To begin integratingvisit the [[getting_started|Getting Started]] guide for **connection details, authentication steps, and demo projects**.+The WebSocket API provides a high-performancelow-latency communication channel for real-time trading data and order execution. This section introduces the key technologies used in the API: **WebSockets** and **Google Protocol Buffers (Protobuf)**.
  
-For detailed breakdown of all available messagessee the [[message_reference|Message Reference]].+==== WebSockets ==== 
 +WebSockets establish persistentfull-duplex connection between the client and server, allowing for continuous bi-directional message exchange. This ensures minimal latency, making it ideal for market data feeds and order updates.
  
-----+**Key Advantages:** 
 +  * Persistent connection reduces handshake overhead 
 +  * Low-latency, real-time data exchange 
 +  * Efficient bandwidth usage compared to REST APIs
  
-💡 **Tip:** Use WebSocket clients like `wscat` or our sample SDKs to test the API before building your integration.+==== Google Protocol Buffers (Protobuf) ==== 
 +The API utilizes Protobuf for efficient, compact, and high-speed message serialization. Unlike JSON or XML, Protobuf messages are smaller and faster to parse, making them well-suited for high-frequency trading applications.
  
 +**Why Protobuf?**
 +  * **Compact Encoding:** Reduces message size for faster transmission
 +  * **High Performance:** Faster serialization/deserialization than JSON
 +  * **Schema Evolution:** Backward-compatible changes allow for future expansion without breaking existing clients
 +
 +==== Communication Model ====
 +The API follows a structured messaging approach:
 +  * **Client Messages:** Requests sent from clients to the server (e.g., order submission, subscription requests)
 +  * **Server Messages:** Responses and real-time updates sent from the server (e.g., trade confirmations, market data)
 +
 +==== Message Structure Overview ====
 +All messages are wrapped within a top-level client or server message envelope. This structure ensures extensibility and consistency across different message types.
 +
 +**Example Envelope:**
 +```
 +message ClientMessage {
 +  oneof payload {
 +    SubscribeRequest subscribe = 1;
 +    OrderRequest order = 2;
 +  }
 +}
 +
 +message ServerMessage {
 +  oneof payload {
 +    MarketUpdate market_data = 1;
 +    OrderResponse order_response = 2;
 +  }
 +}
 +```
 +
 +This design enables efficient message parsing while maintaining flexibility.
 +
 +==== Next Steps ====
 +Continue to the **[Connecting and Authenticating](developers:websocket:connecting)** section to learn how to establish a WebSocket connection and authenticate your session.
  
-===== Next Steps ===== 
-  * Connect and Authenticate to **market data streams** ([[api:websocket:connecting|Connecting and Authenticating]]). 
  
  • developers/websocket.1741920969.txt.gz
  • Last modified: 2025/03/14 03:09
  • (external edit)