Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
developers:websocket [2025/03/14 02:56] – chad | developers:websocket [2025/03/14 17:56] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Getting Started ====== | + | ===== WebSocket API Introduction |
- | To begin integrating, visit the [[getting_started|Getting Started]] guide for **connection details, authentication steps, | + | The WebSocket API provides a high-performance, low-latency communication channel |
- | For a detailed breakdown of all available messages, see the [[message_reference|Message Reference]]. | + | ==== WebSockets ==== |
+ | WebSockets establish | ||
- | ---- | + | **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` | + | ==== 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 | ||
+ | **Why Protobuf?** | ||
+ | * **Compact Encoding:** Reduces message size for faster transmission | ||
+ | * **High Performance: | ||
+ | * **Schema Evolution: | ||
+ | |||
+ | ==== 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, | ||
+ | |||
+ | ==== 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: | ||
- | ===== Next Steps ===== | ||
- | * Connect and Authenticate to **market data streams** ([[api: | ||