Skip to main content

General API Information

Connection URL

wss://cadenza-ws.algo724.com/connection/websocket

For testing and development, see UAT Environment.

Protocol

The WebSocket API is built on Centrifugo, providing:

  • Bidirectional communication - Send and receive messages
  • RPC (Request/Response) - Call methods and get results
  • Pub/Sub channels - Subscribe to real-time data streams
  • Automatic reconnection - Built-in connection recovery

SDK Requirements

To use the WebSocket API, you need two SDKs:

SDKPurposeInstallation
Centrifugo Client SDKWebSocket connection & protocolSee below
Cadenza Client SDKType-safe RPC params/resultsSee below

Python

pip install centrifuge-python cadenza-client

TypeScript/JavaScript

npm install centrifuge @anthropic-ai/cadenza-client

Go

go get github.com/centrifugal/centrifuge-go
go get github.com/anthropic-ai/cadenza-client-go

Message Format

All messages use JSON encoding.

RPC Request

{
"method": "query.instrument.list",
"params": {
"venue": "BINANCE",
"limit": 50
}
}

RPC Response (Success)

{
"data": [
{"instrumentId": "BINANCE:BTC/USDT", ...}
]
}

RPC Response (Error)

{
"error": {
"code": 22016,
"message": "Not found"
}
}

RPC Methods

RPC methods follow a naming convention:

PrefixPurposeExample
query.*Read dataquery.instrument.list
command.*Execute actionscommand.trade_order.submit

Subscription Channels

Real-time data is delivered via pub/sub channels:

Channel PatternData Type
market:orderBook:{instrumentId}Order book updates
market:trade:{instrumentId}Trade updates
tradingAccount:{accountId}Order and portfolio updates

Connection Lifecycle

┌─────────────┐
│ Disconnected│
└──────┬──────┘
│ connect()

┌─────────────┐
│ Connecting │
└──────┬──────┘
│ authenticated

┌─────────────┐
│ Connected │◀──────┐
└──────┬──────┘ │
│ network │ reconnect
│ error │
▼ │
┌─────────────┐ │
│Disconnected │───────┘
└─────────────┘

Timestamps

All timestamps are in milliseconds since Unix epoch (January 1, 1970 UTC).