Arb-feed
Subscribe to the full arb-return broadcast feed. Send action: "subscribe", channel: "arb-feed" (no ids required). Receives batched arb_feed_batch messages for all markets whenever the engine publishes arb updates.
Connection
wss://ws.agg.market/ws
Production WebSocket server.
Connection: wss://ws.agg.market/ws?appId=xxx (required). Optionally pass &token=eyJ... for user-level auth on connect.
Reconnection: Reconnect with exponential backoff + jitter: delay = min(1s × 2^attempt + random(0–1s), 30s). On reconnect, re-subscribe to all channels.
Heartbeat: The service emits a JSON heartbeat message clients can observe directly.
Security schemes
appIduserPasswordApp-level auth: pass appId as a query parameter on connect. Required for all connections. The appId must belong to an active app with matching allowed origins.
jwtJWTUser-level auth: pass JWT as token query param on connect, or send { action: 'authenticate', token } mid-session. Required for user-specific events (orders, balances). Same JWT as the REST API.
Send
Subscribe to orderbook
Subscribe to aggregated orderbook updates for markets
action"subscribe"requiredchannel"orderbook" | "trades"requiredoutcomeIdsstring[]requiredOutcome IDs to subscribe to
{
"action": "subscribe",
"channel": "orderbook",
"outcomeIds": [
"clv2abc123def456",
"clv2xyz789ghi012"
]
}
Unsubscribe from orderbook
action"unsubscribe"requiredchannel"orderbook" | "trades"requiredoutcomeIdsstring[]requiredOutcome IDs to unsubscribe from
{
"action": "unsubscribe",
"channel": "orderbook",
"outcomeIds": [
"clv2abc123def456",
"clv2xyz789ghi012"
]
}
Receive
Batched arb-return feed update
Pushed to clients subscribed to { channel: "arb-feed" }. Contains arb updates for multiple markets in a single batch.
type"arb_feed_batch"requiredfeed"arb"requiredactiveVenuesOnlytruerequiredProducer assertion that globally inactive venues were excluded
entriesobject[]requiredflushTsnumberrequiredchunknumberrequiredchunkCountnumberrequired{
"type": "arb_feed_batch",
"feed": "arb",
"activeVenuesOnly": true,
"entries": [],
"flushTs": 1710000000000,
"chunk": 1,
"chunkCount": 1
}
Subscription confirmed
type"subscribed"requiredoutcomeIdsstring[]marketIdsstring[]channel"orderbook" | "trades" | "arb" | "arb-feed"required{
"type": "subscribed",
"outcomeIds": [
"clv2abc123def456",
"clv2xyz789ghi012"
],
"marketIds": [
"string"
],
"channel": "orderbook"
}
Unsubscription confirmed
type"unsubscribed"requiredoutcomeIdsstring[]marketIdsstring[]channel"orderbook" | "trades" | "arb" | "arb-feed"required{
"type": "unsubscribed",
"outcomeIds": [
"clv2abc123def456",
"clv2xyz789ghi012"
],
"marketIds": [
"string"
],
"channel": "orderbook"
}
Error
Sent on validation failures, auth errors, or malformed messages
type"error"requiredmessagestringrequired{
"type": "error",
"message": "Invalid request: outcomeIds must be a non-empty array"
}