Strade WebSocket API 1.0.0

Real-time market data and account updates over WebSocket.

Endpoint: wss://api.strade.io/ws

All messages are JSON text frames. The connection supports both public and private streams — no separate endpoints.


Message envelope

Client → Server:

{ "method": "<method>", "args": [{ ... }], "id": "req-1" }
Field Type Required Description
method string One of: auth, subscribe, unsubscribe, ping
args array for auth, subscribe, unsubscribe Array with one or more argument objects
id string Client-assigned request ID, echoed verbatim in the response

Server → Client (response):

{ "id": "req-1", "result": { ... } }
{ "id": "req-1", "error": { "code": "...", "message": "..." } }

Server → Client (push):

{ "channel": "trades", "data": { ... } }
{ "channel": "orders", "data": { ... }, "sub_id": "my-sub" }

sub_id is included only when it was provided at subscribe time.


Connection limits

Parameter Value
Max subscriptions per connection 50
Idle timeout (no pong) 60 seconds
Max inbound message size 8 KB
Max connections per user 10

The server sends WebSocket-level ping frames every ~54 seconds. If no pong is received within 60 seconds the connection is closed.


Authentication

Required once per connection before subscribing to private streams. Public streams (orderbook, trades, ticker, candles) are available immediately after connection without authentication.

Signature:

payload = timestamp + "GET" + "/api/v1/ws"
sign    = HMAC-SHA256(api_secret, payload).hexdigest

timestamp is current Unix time in milliseconds as a string.

Authentication persists for the lifetime of the connection. Re-authentication on the same connection is allowed. If the per-user connection limit (10) is reached, auth returns rate_limited and the connection stays unauthenticated.


Error codes

Returned in the error field of a response.

Code Description
invalid_json Message is not valid JSON
unknown_method Unknown method name
invalid_args Missing or malformed args
invalid_channel Unknown channel, missing required params, or auth required for private channel
auth_failed API key invalid or signature mismatch
rate_limited Per-user connection limit (10) or per-connection subscription limit (50) exceeded

Servers

  • wss://api.strade.io/wswssproduction

    Production WebSocket endpoint

Operations

  • PUB auth

    Authenticate the connection using an HMAC-signed API key. Must be called before subscribing to private streams. Authentication persists for the lifetime of the connection.

    Send auth request

    Operation IDsendAuth

    Available only on servers:

    Accepts the following message:

    Authenticate Connection
    object

    Examples

  • SUB auth

    Authenticate the connection using an HMAC-signed API key. Must be called before subscribing to private streams. Authentication persists for the lifetime of the connection.

    Receive auth response

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Auth Response
    oneOf

    Examples

  • PUB ping

    Application-level ping. The server also sends WebSocket-level ping frames every ~54 seconds; standard WebSocket clients respond automatically.

    Send ping

    Operation IDsendPing

    Available only on servers:

    Accepts the following message:

    Ping
    object

    Examples

  • SUB ping

    Application-level ping. The server also sends WebSocket-level ping frames every ~54 seconds; standard WebSocket clients respond automatically.

    Receive pong

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Pong Response
    object

    Examples

  • PUB subscribe

    Subscribe to one or more channels in a single request. Processing stops at the first error — channels before the failing one are still subscribed. Re-subscribing to an already-subscribed channel is idempotent.

    Subscribe to channels

    Operation IDsendSubscribe

    Available only on servers:

    Accepts the following message:

    Subscribe to Channels
    object

    Examples

  • SUB subscribe

    Subscribe to one or more channels in a single request. Processing stops at the first error — channels before the failing one are still subscribed. Re-subscribing to an already-subscribed channel is idempotent.

    Subscription confirmation

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Subscribe Response
    oneOf

    Examples

  • PUB unsubscribe

    Unsubscribe from one or more channels.

    Unsubscribe from channels

    Operation IDsendUnsubscribe

    Available only on servers:

    Accepts the following message:

    Unsubscribe from Channels
    object

    Examples

  • SUB unsubscribe

    Unsubscribe from one or more channels.

    Unsubscription confirmation

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Unsubscribe Response
    oneOf

    Examples

  • PUB orderbook

    Full order book snapshot pushed on every change. Bids are sorted by price descending; asks by price ascending. Each precision value is a separate subscription slot.

    Subscribe to order book

    Operation IDpublish

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Subscribe to Order Book
    object

    Examples

  • SUB orderbook

    Full order book snapshot pushed on every change. Bids are sorted by price descending; asks by price ascending. Each precision value is a separate subscription slot.

    Receive order book snapshots

    Operation IDsubscribe

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Order Book Push
    object

    Examples

  • PUB trades

    Individual trades pushed as they occur.

    Subscribe to trades

    Operation IDpublish

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Subscribe to Trades
    object

    Examples

  • SUB trades

    Individual trades pushed as they occur.

    Receive trade events

    Operation IDsubscribe

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Trades Push
    object

    Examples

  • PUB ticker

    Rolling 24-hour statistics.

    Subscribe to ticker

    Operation IDpublish

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Subscribe to Ticker
    object

    Examples

  • SUB ticker

    Rolling 24-hour statistics.

    Receive ticker updates

    Operation IDsubscribe

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    Accepts the following message:

    Ticker Push
    object

    Examples

  • PUB candles

    Candlestick (OHLCV) data. Each resolution value is a separate subscription slot. Both named strings and integer seconds are accepted at subscribe time ("1h" and 3600 are equivalent); push payloads always use the named string form.

    Subscribe to candles

    Operation IDpublish

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    string
    required

    Candle resolution — "1m" (60 s), "1h" (3600 s), or "1d" (86400 s)

    Accepts the following message:

    Subscribe to Candles
    object

    Examples

  • SUB candles

    Candlestick (OHLCV) data. Each resolution value is a separate subscription slot. Both named strings and integer seconds are accepted at subscribe time ("1h" and 3600 are equivalent); push payloads always use the named string form.

    Receive candle updates

    Operation IDsubscribe

    Available only on servers:

    object
    symbolstring
    required

    Market symbol, e.g. BTC_USDT

    string
    required

    Candle resolution — "1m" (60 s), "1h" (3600 s), or "1d" (86400 s)

    Accepts the following message:

    Candles Push
    object

    Examples

  • PUB orders

    Order status updates for the authenticated user. No parameters. Requires authentication before subscribing.

    Subscribe to orders

    Operation IDpublish

    Available only on servers:

    Accepts the following message:

    Subscribe to Orders
    object

    Examples

  • SUB orders

    Order status updates for the authenticated user. No parameters. Requires authentication before subscribing.

    Receive order updates

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Orders Push
    object

    Examples

  • PUB balances

    Balance updates for all assets of the authenticated user. No parameters. Requires authentication before subscribing.

    Subscribe to balances

    Operation IDpublish

    Available only on servers:

    Accepts the following message:

    Subscribe to Balances
    object

    Examples

  • SUB balances

    Balance updates for all assets of the authenticated user. No parameters. Requires authentication before subscribing.

    Receive balance updates

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Balances Push
    object

    Examples

  • PUB deposits

    Deposit events for the authenticated user. No parameters. Requires authentication before subscribing. payment.type values on this channel: deposit, internal_deposit.

    Subscribe to deposits

    Operation IDpublish

    Available only on servers:

    Accepts the following message:

    Subscribe to Deposits
    object

    Examples

  • SUB deposits

    Deposit events for the authenticated user. No parameters. Requires authentication before subscribing. payment.type values on this channel: deposit, internal_deposit.

    Receive deposit events

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Deposits Push
    object

    Examples

  • PUB withdrawals

    Withdrawal events for the authenticated user. No parameters. Requires authentication before subscribing. payment.type values on this channel: withdrawal, internal_withdrawal.

    Subscribe to withdrawals

    Operation IDpublish

    Available only on servers:

    Accepts the following message:

    Subscribe to Withdrawals
    object

    Examples

  • SUB withdrawals

    Withdrawal events for the authenticated user. No parameters. Requires authentication before subscribing. payment.type values on this channel: withdrawal, internal_withdrawal.

    Receive withdrawal events

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Withdrawals Push
    object

    Examples

  • PUB transfers

    Internal transfer events for the authenticated user. No parameters. Requires authentication before subscribing.

    Subscribe to transfers

    Operation IDpublish

    Available only on servers:

    Accepts the following message:

    Subscribe to Transfers
    object

    Examples

  • SUB transfers

    Internal transfer events for the authenticated user. No parameters. Requires authentication before subscribing.

    Receive transfer events

    Operation IDsubscribe

    Available only on servers:

    Accepts the following message:

    Transfers Push
    object

    Examples

Messages

  • #1Authenticate Connection
    Message IDAuthRequest
    object
  • #2Ping
    Message IDPingRequest
    object
  • #3Subscribe to Channels
    Message IDSubscribeRequest
    object
  • #4Unsubscribe from Channels
    Message IDUnsubscribeRequest
    object
  • #5Subscribe to Order Book
    Message IDSubscribeOrderbook
    object
  • #6Subscribe to Trades
    Message IDSubscribeTrades
    object
  • #7Subscribe to Ticker
    Message IDSubscribeTicker
    object
  • #8Subscribe to Candles
    Message IDSubscribeCandles
    object
  • #9Subscribe to Orders
    Message IDSubscribeOrders
    object
  • #10Subscribe to Balances
    Message IDSubscribeBalances
    object
  • #11Subscribe to Deposits
    Message IDSubscribeDeposits
    object
  • #12Subscribe to Withdrawals
    Message IDSubscribeWithdrawals
    object
  • #13Subscribe to Transfers
    Message IDSubscribeTransfers
    object
  • #14Auth Response
    Message IDAuthResponse
    oneOf
  • #15Pong Response
    Message IDPingResponse
    object
  • #16Subscribe Response
    Message IDSubscribeResponse
    oneOf
  • #17Unsubscribe Response
    Message IDUnsubscribeResponse
    oneOf
  • #18Error Response
    Message IDErrorResponse
    object
  • #19Order Book Push
    Message IDOrderbookPush
    object
  • #20Trades Push
    Message IDTradesPush
    object
  • #21Ticker Push
    Message IDTickerPush
    object
  • #22Candles Push
    Message IDCandlesPush
    object
  • #23Orders Push
    Message IDOrdersPush
    object
  • #24Balances Push
    Message IDBalancesPush
    object
  • #25Deposits Push
    Message IDDepositsPush
    object
  • #26Withdrawals Push
    Message IDWithdrawalsPush
    object
  • #27Transfers Push
    Message IDTransfersPush
    object

Schemas

  • object
  • object
  • object
  • object
  • object