Request and response envelopes for the RISEx WebSocket API.
The WebSocket feed encodes every message as JSON.
Request Format
Every request carries a method. Anything else belongs in params.
{
"method": "subscribe",
"params": {
"channel": "oracle",
"market_ids": [1]
}
}method | Purpose | params |
|---|---|---|
subscribe | Start receiving a channel | channel, optional market_ids, makers |
unsubscribe | Stop receiving a channel | channel |
auth | Authenticate before subscribing to private channels | See Authentication |
ping | Keep-alive | none |
Markets are always selected by numeric market_ids. No channel accepts a symbol or product name. GET /v1/markets maps each market_id to its config.name.
Unrecognised input is dropped without an errorA
paramskey the server does not know is ignored — send"product": "BTC"and the subscription is accepted as if you had sent no filter at all, giving you every market. Malformed JSON and an unknownmethodget no reply whatsoever. Nothing on the wire tells you the request was wrong, so read the reply's echoed filter (below) to confirm what the server actually applied.
Response Format
Responses come in four shapes.
1. Channel data
Carries a type field:
type | Description |
|---|---|
snapshot | Full current state, sent once at subscription time |
update | An incremental change |
Not every channel sends a snapshot — trades, oracle, funding and fills stream updates only.
2. Subscribe / unsubscribe reply
{
"type": "subscribed",
"method": "subscribe",
"status": "success",
"message": "Successfully subscribed to oracle for 1 market(s)",
"channel": "oracle",
"data": { "market_ids": [1] }
}data echoes the filter that was actually applied. This is the only reliable confirmation that your market_ids reached the server: if you asked for one market and see for all markets with an empty data, the filter was dropped.
A rejected subscribe still says"type": "subscribed"
typerecords which request you sent, not whether it worked. Readstatus, nevertype, to tell success from failure:{ "type": "subscribed", "method": "subscribe", "status": "error", "message": "Failed to subscribe to nosuchchannel: invalid channel: nosuchchannel", "channel": "nosuchchannel" }
3. Authentication reply
No type field — identified by method.
{
"method": "auth",
"status": "success",
"message": "Authentication successful",
"data": {
"account": "0x1234567890123456789012345678901234567890",
"signer": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd"
}
}On failure, status is "error", message explains why, and data is empty.
4. Pong
{ "method": "pong" }Field Reference
| Field | Present on | Description |
|---|---|---|
method | every reply | Echoes the request method; pong in reply to ping |
type | channel data, sub replies | snapshot, update, subscribed, unsubscribed |
status | replies to your requests | success or error |
message | replies to your requests | Human-readable detail; on error this is the reason |
channel | channel data, sub replies | Channel name |
data | most messages | Payload — shape depends on the channel |
Block and timestamp fields vary per channel; see the individual channel pages.
Health Checks
The server sends a WebSocket protocol ping frame every 30 seconds and closes any connection that goes 60 seconds without inbound traffic. Standard WebSocket libraries answer ping frames automatically, so a normal client needs no keep-alive logic of its own.
The JSON {"method":"ping"} request is separate and optional — a client-initiated check that returns {"method":"pong"}. Any inbound message, including this one, resets the 60-second timer.