No examples found{
"id": 1,
"cmd": "subscribe",
"params": {
"channels": [
"orderbook_delta"
],
"market_ticker": "CPI-22DEC-TN0.1"
}
}{
"id": 124,
"cmd": "unsubscribe",
"params": {
"sids": [
1,
2
]
}
}{
"id": 3,
"cmd": "list_subscriptions"
}{
"id": 124,
"cmd": "update_subscription",
"params": {
"sids": [
456
],
"market_tickers": [
"NEW-MARKET-1",
"NEW-MARKET-2"
],
"action": "add_markets"
}
}{
"id": 125,
"cmd": "update_subscription",
"params": {
"sids": [
456
],
"market_tickers": [
"MARKET-TO-REMOVE-1",
"MARKET-TO-REMOVE-2"
],
"action": "delete_markets"
}
}{
"id": 126,
"cmd": "update_subscription",
"params": {
"sid": 456,
"market_tickers": [
"NEW-MARKET-3",
"NEW-MARKET-4"
],
"action": "add_markets"
}
}{
"id": 2,
"cmd": "update_subscription",
"params": {
"sid": 1,
"action": "indexlist"
}
}{
"id": 2,
"cmd": "update_subscription",
"params": {
"sid": 1,
"action": "underlying_list"
}
}{
"id": 1,
"type": "subscribed",
"sending_ts_ms": 1669149841234,
"msg": {
"channel": "orderbook_delta",
"sid": 1
}
}{
"id": 102,
"sid": 2,
"seq": 7,
"type": "unsubscribed",
"sending_ts_ms": 1669149841234
}{
"id": 123,
"sid": 456,
"seq": 222,
"type": "ok",
"sending_ts_ms": 1669149841234,
"msg": {
"market_tickers": [
"MARKET-1",
"MARKET-2",
"MARKET-3"
]
}
}No examples foundNo examples foundNo examples found{
"id": 3,
"type": "ok",
"sending_ts_ms": 1669149841234,
"msg": [
{
"channel": "orderbook_delta",
"sid": 1
},
{
"channel": "ticker",
"sid": 2
},
{
"channel": "fill",
"sid": 3
}
]
}{
"id": 123,
"type": "error",
"sending_ts_ms": 1669149841234,
"msg": {
"code": 7,
"msg": "Unknown subscription ID"
}
}WebSocket Connection
Main WebSocket connection endpoint. All communication happens through this single connection. Authentication is required to establish the connection; include API key headers during the WebSocket handshake. Some channels carry only public market data, but the connection itself still requires authentication. Use the subscribe command to subscribe to specific data channels. For more information, see the Getting Started guide.
Handshake errors: a rejected handshake returns an HTTP error instead of upgrading. 429 Too Many Requests with code
too_many_requests has two causes: you have reached your tier’s concurrent connection limit,
or you are opening connections too quickly. The HTTP status and error code are the same for both, so reconnect with
exponential backoff rather than in a tight loop, and close connections you no longer use.
One subscription per channel: a connection holds at most one subscription to each channel. A subscribe naming a channel
you are already subscribed to does not create a second subscription or return subscribed. It is applied to the existing sid:
on channels with a market filter it adds the listed markets and returns ok, or returns an error. To change other parameters,
unsubscribe, wait for unsubscribed, then subscribe again.
No examples found{
"id": 1,
"cmd": "subscribe",
"params": {
"channels": [
"orderbook_delta"
],
"market_ticker": "CPI-22DEC-TN0.1"
}
}{
"id": 124,
"cmd": "unsubscribe",
"params": {
"sids": [
1,
2
]
}
}{
"id": 3,
"cmd": "list_subscriptions"
}{
"id": 124,
"cmd": "update_subscription",
"params": {
"sids": [
456
],
"market_tickers": [
"NEW-MARKET-1",
"NEW-MARKET-2"
],
"action": "add_markets"
}
}{
"id": 125,
"cmd": "update_subscription",
"params": {
"sids": [
456
],
"market_tickers": [
"MARKET-TO-REMOVE-1",
"MARKET-TO-REMOVE-2"
],
"action": "delete_markets"
}
}{
"id": 126,
"cmd": "update_subscription",
"params": {
"sid": 456,
"market_tickers": [
"NEW-MARKET-3",
"NEW-MARKET-4"
],
"action": "add_markets"
}
}{
"id": 2,
"cmd": "update_subscription",
"params": {
"sid": 1,
"action": "indexlist"
}
}{
"id": 2,
"cmd": "update_subscription",
"params": {
"sid": 1,
"action": "underlying_list"
}
}{
"id": 1,
"type": "subscribed",
"sending_ts_ms": 1669149841234,
"msg": {
"channel": "orderbook_delta",
"sid": 1
}
}{
"id": 102,
"sid": 2,
"seq": 7,
"type": "unsubscribed",
"sending_ts_ms": 1669149841234
}{
"id": 123,
"sid": 456,
"seq": 222,
"type": "ok",
"sending_ts_ms": 1669149841234,
"msg": {
"market_tickers": [
"MARKET-1",
"MARKET-2",
"MARKET-3"
]
}
}No examples foundNo examples foundNo examples found{
"id": 3,
"type": "ok",
"sending_ts_ms": 1669149841234,
"msg": [
{
"channel": "orderbook_delta",
"sid": 1
},
{
"channel": "ticker",
"sid": 2
},
{
"channel": "fill",
"sid": 3
}
]
}{
"id": 123,
"type": "error",
"sending_ts_ms": 1669149841234,
"msg": {
"code": 7,
"msg": "Unknown subscription ID"
}
}API key authentication required for WebSocket connections. The API key should be provided during the WebSocket handshake.
GET
Subscribe to one or more channels
Cancel one or more subscriptions
List all active subscriptions
Add markets to an existing subscription
Remove markets from an existing subscription
Update subscription using sid parameter instead of sids array
Add or remove tracked index IDs, or list available indices, on a cfbenchmarks_value or cfbenchmarks_value_5hz subscription
Add or remove underlying tickers, or list available underlyings, on a pyth_value subscription
Confirmation that subscription was successful
Confirmation that unsubscription was successful
Successful update operation response
Current Pyth underlying ticker filter after an update; all-mode is ["all"]
Current CF Benchmarks index filter after an update; all-mode is ["all"]
Current eBattle match filter after an update; all-mode is ["all"]
Response containing all active subscriptions
Error response for failed operations