Skip to main content
WSS
Prefer the application-level ping message over WebSocket control frames when validating connectivity. Because it is handled as a normal data message, it confirms end-to-end reachability across the same path used by your subscriptions and requests. Control frames are processed separately by WebSocket infrastructure and can still succeed when application data is not flowing reliably.

Supported Streams

optionsAccountSummary is account-wide — any contract filter on the request is ignored for it. Note that emitOptionsAccountSummary returns the current snapshot and does not subscribe you: without an active optionsAccountSummary subscription its response never reaches you.

Subscribe / Unsubscribe Behavior

  • Streams can be requested at connect with the subscriptions query parameter, or added and removed afterwards with subscribe and unsubscribe
  • Subscriptions are scoped by product: only options streams can be subscribed on a product=options connection — a perpetuals stream name is rejected with wrong_product_subscriptions
  • Requests are all-or-nothing: a single unrecognized stream name rejects the whole request with invalid_subscriptions, and none of the listed streams are subscribed or unsubscribed
  • Subscriptions are tracked per stream and market: re-subscribing a stream for a market it is already active on, or unsubscribing it from a market it is not, is a no-op
  • Subscribing a stream to a second market adds to it — it does not replace the first; market: ALL supersedes every specific market for that stream
  • Other subscriptions remain unaffected
  • Changes apply immediately
  • Safe to call repeatedly (idempotent)
  • Does not affect other connections
  • Does not require reconnecting
market in a subscribe composes with expiration, strike, and type into a contract filter exactly as described in Contract Filter, and defaults to the connection’s own filter when all four are omitted.

Multiple Markets

market is always a single string, never an array — to follow a stream on several markets, send one subscribe per market:
The connection now receives quotes for both BTC-USDT and ETH-USDT contracts. Each request is confirmed with the same flat list:
activeSubscriptions and requestedSubscriptions are flat lists of stream names carrying no market information — a stream subscribed across several markets appears once. Track which markets each stream is active for client-side.
Subscribing a stream with market: ALL supersedes every specific market it was active on, dropping them. Afterwards, subscribing that stream to a specific market is a no-op — the wildcard already covers it.

Unsubscribe Market Selection

An unsubscribe removes the listed streams for one market or for every market they are active on — the composed contract filter must match the one the stream was subscribed with. market selects what is removed:
Omitting market on an unsubscribe, or sending ALL, removes the listed streams from every market they are active on — not from the connection’s own market. This is the opposite of subscribe, where omitting market falls back to the connection’s filter. To remove a stream from one market only, name that market explicitly.
On failure the resultType is subscribe / unsubscribe — not subscribed / unsubscribed, which confirm success only.

Connection Shutdown

A connection may receive an unprompted connectionShutdown message, carrying the deadline by which it must be re-established. Reconnect at any point before the deadline. The existing connection stays fully active and keeps delivering messages until it elapses, so opening the new connection first and dropping the old one once it is subscribed avoids any gap in coverage. Read forceCloseInMs from the message rather than assuming a fixed value. A connection still open when the deadline passes is closed with WebSocket close code 1012, and messages published between that point and your reconnect are missed. Supplying a sessionId recovers missed order events on the reconnect; see WebSocket Session.
market
type:string
required

A specific market (e.g. BTC-USDT) or ALL.

expiration
type:string
required

Contract expiration, e.g. 24JUN26. Requires market; omit to match every expiration.

strike
type:string
required

Strike price, e.g. 62000. Requires expiration; omit to match every strike.

type
type:string
required

C (call) or P (put). Requires strike; omit to match both.

Sec-WebSocket-Protocol
type:httpApiKey

Supply as authorization#<JWT> during the WebSocket handshake.

Ping
type:object
Subscribe
type:object

Add one or more streams to the current connection, for one or more markets.

Unsubscribe
type:object

Remove one or more streams from the current connection, for one market or all.

Pong
type:object
Subscribed
type:object

Success response to subscribe. Subscription lists are flat stream names; track markets client-side.

Subscribe — Error
type:object

Validation failure response to subscribe. Note resultType is subscribe on failure, not subscribed.

Unsubscribed
type:object

Success response to unsubscribe. Subscription lists are flat stream names; track markets client-side.

Unsubscribe — Error
type:object

Validation failure response to unsubscribe. Note resultType is unsubscribe on failure, not unsubscribed. The errors are the same as for subscribe.

Connection Shutdown
type:object

Pushed before the connection is closed, carrying the deadline by which it must be re-established.