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
| Detail | Description |
|---|---|
| Format | Messages are sent and received in JSON. |
| Keepalive | PING the server at least every 30 seconds to keep the session open. |
| Session length | Sessions are closed automatically after a maximum of 30 minutes. |
| Subscriptions | Each 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
- Connect to the public WebSocket URL for your environment.
- Subscribe by sending a
SUBSCRIBEmessage with a uniquechannelUuid, thechannelname (e.g."MARKET","TRADES"), and the marketsymbol(e.g."ETH-USD"). Some channels accept extra parameters (e.g.intervalfor CANDLES,tickSizefor ORDER_BOOK) — see Market, Order book, Candles, Trades. - 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.
- Unsubscribe when you no longer need the stream by sending
UNSUBSCRIBEwith the samechannelUuid.
Each channel page below describes the exact request shape, response fields, and whether you get a snapshot or only live updates.
Public channels
| Channel | Description | Doc |
|---|---|---|
| MARKET | Best bid/ask, 24h movement, volume. Snapshot then updates. | Market |
| ORDER_BOOK | Asks/bids by price. Snapshot then updates. | Order book |
| CANDLES | OHLCV at a chosen interval. Streaming only. | Candles |
| TRADES | Individual 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:
| Code | Meaning |
|---|---|
| 0 | Internal server error |
| 1 | Invalid request |
| 2 | Duplicate channel UUID |
| 3 | Invalid symbol |
| 4 | Already subscribed to channel |
| 5 | Not subscribed to any channel with given ID |
| 6 | Too many channel subscriptions |
For full request/response shapes and error handling, see the OpenAPI specs and the channel pages: Market, Order book, Candles, Trades.