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:
| SDK | Purpose | Installation |
|---|---|---|
| Centrifugo Client SDK | WebSocket connection & protocol | See below |
| Cadenza Client SDK | Type-safe RPC params/results | See 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:
| Prefix | Purpose | Example |
|---|---|---|
query.* | Read data | query.instrument.list |
command.* | Execute actions | command.trade_order.submit |
Subscription Channels
Real-time data is delivered via pub/sub channels:
| Channel Pattern | Data 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).