Messages

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]
  }
}
methodPurposeparams
subscribeStart receiving a channelchannel, optional market_ids, makers
unsubscribeStop receiving a channelchannel
authAuthenticate before subscribing to private channelsSee Authentication
pingKeep-alivenone

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 error

A params key 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 unknown method get 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:

typeDescription
snapshotFull current state, sent once at subscription time
updateAn 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"

type records which request you sent, not whether it worked. Read status, never type, 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

FieldPresent onDescription
methodevery replyEchoes the request method; pong in reply to ping
typechannel data, sub repliessnapshot, update, subscribed, unsubscribed
statusreplies to your requestssuccess or error
messagereplies to your requestsHuman-readable detail; on error this is the reason
channelchannel data, sub repliesChannel name
datamost messagesPayload — 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.