Skip to content

WebSocket Stream

Overview

The platform WebSocket stream is used for real-time client updates.

It delivers:

  • quotes
  • balance updates
  • trade updates
  • price alert triggers

The client does not need a separate subscription for account-specific events such as balance, trade, or price alerts. Those events are pushed automatically to active WebSocket sessions of the authenticated user.

Endpoint

wss://{broker_domain}:{ws_port}

Authentication

After connection, the client must send a message with the JWT token:

{
  "authorization": "<JWT_TOKEN>"
}

The token is decoded on the server side and linked to the current WebSocket session.

Channel Subscription

Market quote streams use channel subscription.

Subscribe

{
  "event": "subscribe",
  "data": ["eurusd", "btcusd"]
}

Unsubscribe

{
  "event": "unsubscribe",
  "data": ["eurusd"]
}

Quote channels are symbol-based. The exact symbol naming must match the server symbol name used by the client terminal.

Ping / Pong

The server accepts a plain text heartbeat:

ping

Response:

pong

Payload Format

Most outgoing events are sent as compact JSON arrays.

The first element is the event marker:

  • "t" — quote update
  • "b" — balance update
  • "o" — trade update
  • "a" — price alert event
  • "n" — notification

This compact format is used to reduce payload size and parsing overhead.

Event Delivery Model

Quotes

Quotes are broadcast to all sessions subscribed to the symbol channel.

Balance

Balance updates are sent directly to all active WebSocket sessions of the account login.

Trade

Trade updates are sent directly to all active WebSocket sessions of the account login.

Price Alert

Price alert trigger events are sent directly to all active WebSocket sessions of the account login.

Ordering Notes

Within a single session, the server preserves per-session send order.

However, different event types may arrive close together:

  • quote update
  • trade update
  • balance update
  • price alert trigger

Clients should treat WebSocket events as incremental real-time updates and reconcile with REST state if strict snapshot consistency is required.