Skip to main content

WebSocket

The WebSocket feed provides near real-time, event-driven updates for public market data. No authentication is required.


WebSocket URL (main domain)

Public WebSocket uses the main host — the same hostname as the Figure Markets web app — over WSS at /service-hft-exchange-websocket/ws/v1. Use the full URL for your environment (same hosts as Public API (REST) — Base path, wss instead of https, path /service-hft-exchange-websocket/ws/v1 instead of /service-hft-exchange/api/v1).

  • UAT: wss://www.figuremarkets.dev/service-hft-exchange-websocket/ws/v1
  • Production: wss://www.figuremarkets.com/service-hft-exchange-websocket/ws/v1

Connect your WebSocket client to one of these URLs. No authentication.


Connection details

DetailDescription
FormatMessages are sent and received in JSON.
KeepalivePING the server at least every 30 seconds to keep the session open.
Session lengthSessions are closed automatically after a maximum of 30 minutes.
SubscriptionsEach connection is limited to a maximum of 50 channel subscriptions.

Subscribing to channels

Send a SUBSCRIBE action with a unique channelUuid, the channel name, and the symbol:

{
"action": "SUBSCRIBE",
"channelUuid": "your-unique-uuid",
"channel": "CHANNEL_NAME",
"symbol": "SYMBOL"
}

Updates for that channel will start streaming. An initial snapshot may be sent on subscription depending on the channel.


Getting market symbols

The symbol you send in SUBSCRIBE messages (e.g. "ETH-USD") is the market id from the Public API. To discover which symbols are available, use the REST API: Getting market symbols. Full request/response shapes are in the Public API — Markets section of the OpenAPI spec.


How public channels work

  1. Connect to the public WebSocket URL for your environment.
  2. Subscribe by sending a SUBSCRIBE message with a unique channelUuid, the channel name (e.g. "MARKET", "TRADES"), and the market symbol (e.g. "ETH-USD"). Some channels accept extra parameters (e.g. interval for CANDLES, tickSize for ORDER_BOOK) — see Market, Order book, Candles, Trades.
  3. Receive data:
    • Snapshot + updates: MARKET and ORDER_BOOK send a full snapshot immediately, then send updates whenever the data changes.
    • Updates only: CANDLES and TRADES do not send a snapshot; they stream messages as new candles complete or new trades happen.
  4. Unsubscribe when you no longer need the stream by sending UNSUBSCRIBE with the same channelUuid.

Each channel page below describes the exact request shape, response fields, and whether you get a snapshot or only live updates.


Public channels

ChannelDescriptionDoc
MARKETBest bid/ask, 24h movement, volume. Snapshot then updates.Market
ORDER_BOOKAsks/bids by price. Snapshot then updates.Order book
CANDLESOHLCV at a chosen interval. Streaming only.Candles
TRADESIndividual trades as they occur. Streaming only.Trades

Unsubscribing

{
"action": "UNSUBSCRIBE",
"channelUuid": "uuid-from-subscribe"
}

Listing subscriptions

{ "action": "LIST_SUBSCRIPTIONS" }

The response is a list of subscribed channels (channel name, channelUuid, symbol).


Errors

Failed actions return a message and code:

CodeMeaning
0Internal server error
1Invalid request
2Duplicate channel UUID
3Invalid symbol
4Already subscribed to channel
5Not subscribed to any channel with given ID
6Too many channel subscriptions

For full request/response shapes and error handling, see the OpenAPI specs and the channel pages: Market, Order book, Candles, Trades.