WebSocket Reference

Websocket surface docs

Generated from the websocket endpoints and shared payload types for the public API-gateway surface. Every stream and logical channel below has a stable deep link for docs and support references.

Download public AsyncAPI JSONVisibility taxonomy: public, contributor-internal, service-internal

Public streams and channels

Public multiplexed stream

/ws/publicpublic

Single public socket for instrument and grouped market-data channels using Binance-style control messages.

Auth: No API auth · Source: encore/realtime/src/endpoints/streams/public-mux.ts

Client message schema

{
  "type": "object",
  "properties": {
    "method": {
      "type": "string",
      "enum": [
        "SUBSCRIBE",
        "UNSUBSCRIBE",
        "LIST_SUBSCRIPTIONS",
        "AUTH"
      ]
    },
    "params": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "id": {
      "type": "number"
    },
    "authorization": {
      "type": "string"
    },
    "primaryWalletAddress": {
      "type": "string"
    }
  },
  "required": [
    "method"
  ],
  "additionalProperties": false
}

Server payload schema

{
  "type": "object",
  "properties": {
    "result": {
      "oneOf": [
        {},
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        {
          "$ref": "#/components/schemas/AuthSuccessResult"
        }
      ]
    },
    "id": {
      "type": "number"
    },
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "number"
        },
        "msg": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "msg"
      ],
      "additionalProperties": false
    },
    "stream": {
      "type": "string"
    },
    "data": {}
  },
  "additionalProperties": false
}

Logical channels

Instrument depth channel

<symbol>@depth

Subscribe with `<symbol>@depth` for a single market orderbook.

Grouped depth channel

<underlying>@depth

Subscribe with `<underlying>@depth` for one envelope per matching symbol.

Instrument ticker channel

<symbol>@ticker

Subscribe with `<symbol>@ticker` for a single market ticker.

Grouped ticker channel

<underlying>@ticker

Subscribe with `<underlying>@ticker` for one envelope per matching symbol.

Instrument trade channel

<symbol>@trade

Subscribe with `<symbol>@trade` for a single market trade stream.

Grouped trade channel

<underlying>@trade

Subscribe with `<underlying>@trade` for one envelope per matching symbol.

RFQ broadcast proxy

/ws/rfq/streampublic

Unauthenticated API-gateway relay for live RFQ request broadcasts on the public testnet websocket host.

Auth: No API auth · Source: encore/realtime/src/endpoints/streams/rfq-proxy.ts

Server payload schema

{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "connected",
        "heartbeat",
        "rfq_request"
      ]
    },
    "timestamp": {
      "type": "number"
    },
    "fanoutAt": {
      "type": "number"
    },
    "createdAt": {
      "type": "number"
    },
    "requestId": {
      "type": "string"
    },
    "taker": {
      "type": "string"
    },
    "pairId": {
      "type": "string"
    },
    "strike": {
      "type": "string"
    },
    "expiry": {
      "type": "number"
    },
    "isCall": {
      "type": "boolean"
    },
    "size": {
      "type": "string"
    },
    "intent": {
      "type": "string",
      "enum": [
        "open",
        "close"
      ]
    },
    "deadline": {
      "type": "number"
    }
  },
  "required": [
    "type"
  ],
  "additionalProperties": false
}