{
"type": "subscribed",
"channel": "firehose"
}{
"type": "orderbook_snapshot_batch",
"venue": "polymarket",
"part": 12,
"parts": 480,
"snapshots": [
{
"type": "orderbook_snapshot",
"outcomeId": "vmo_1",
"seq": 1710000001,
"checksum": 2918476531,
"bids": [
[
0.55,
800,
{
"polymarket": 800
}
]
],
"asks": [
[
0.56,
600,
{
"polymarket": 600
}
]
],
"venueOrderbooks": {
"polymarket": {
"bids": [
[
0.55,
800
]
],
"asks": [
[
0.56,
600
]
]
}
},
"venues": {
"polymarket": {
"bestBid": 0.55,
"bestAsk": 0.56
}
},
"midpoint": 0.555,
"spread": 0.01,
"timestamp": 1710000000000
}
]
}{
"type": "firehose_ready",
"venue": "polymarket"
}{
"type": "orderbook_delta_batch",
"deltas": [
{
"type": "orderbook_delta",
"outcomeId": "vmo_1",
"seq": 1710000002,
"checksum": 3847261950,
"bidChanges": [
[
0.55,
900,
{
"polymarket": 900
}
]
],
"askChanges": [],
"venueDeltaBooks": {
"polymarket": {
"bidChanges": [
[
0.55,
900
]
],
"askChanges": []
}
},
"venues": {
"polymarket": {
"bestBid": 0.55,
"bestAsk": 0.56
}
},
"midpoint": 0.555,
"spread": 0.01,
"timestamp": 1710000001000
}
]
}{
"type": "orderbook_delta",
"outcomeId": "clv2abc123def456",
"channel": "orderbook",
"seq": 1710000001,
"checksum": 2918476531,
"bidChanges": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"askChanges": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"venueDeltaBooks": {},
"venues": {},
"midpoint": 0.55,
"spread": 0.01,
"tick": 0,
"markSource": "local",
"timestamp": 1710000000000
}{
"type": "orderbook_snapshot",
"outcomeId": "clv2abc123def456",
"channel": "orderbook",
"seq": 1710000001,
"checksum": 2918476531,
"bids": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"asks": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"venueOrderbooks": {},
"venues": {},
"midpoint": 0.55,
"spread": 0.01,
"timestamp": 1710000000000,
"tick": 0,
"markSource": "local"
}{
"type": "error",
"code": "firehose_not_enabled"
}{
"action": "subscribe",
"channel": "firehose",
"venues": [
"polymarket"
],
"latency": "realtime",
"batchMs": 10
}Firehose
Every non-empty book for the venues you name, then the live changes. Server-only, on the orderbook socket. Off until Snag enables it for your app (email support@agg.market with your app id), and the handshake requires a valid x-app-api-key; otherwise subscribe is refused with firehose_not_enabled.
Flow per venue: subscribed, one or more orderbook_snapshot_batch slices, firehose_ready, then orderbook_delta_batch (or single orderbook_delta frames for realtime batchMs: 0). A book that first gets levels arrives as a single orderbook_snapshot. Batch entries are the same snapshot and delta objects as the orderbook channel.
Falling behind: over 64 MB of backlog or 30 seconds behind sends firehose_resync, followed by a fresh snapshot. Three in five minutes closes with 4008. A full server refuses subscribe with too_many_connections; reconnect with backoff. See Orderbook firehose.
{
"type": "subscribed",
"channel": "firehose"
}{
"type": "orderbook_snapshot_batch",
"venue": "polymarket",
"part": 12,
"parts": 480,
"snapshots": [
{
"type": "orderbook_snapshot",
"outcomeId": "vmo_1",
"seq": 1710000001,
"checksum": 2918476531,
"bids": [
[
0.55,
800,
{
"polymarket": 800
}
]
],
"asks": [
[
0.56,
600,
{
"polymarket": 600
}
]
],
"venueOrderbooks": {
"polymarket": {
"bids": [
[
0.55,
800
]
],
"asks": [
[
0.56,
600
]
]
}
},
"venues": {
"polymarket": {
"bestBid": 0.55,
"bestAsk": 0.56
}
},
"midpoint": 0.555,
"spread": 0.01,
"timestamp": 1710000000000
}
]
}{
"type": "firehose_ready",
"venue": "polymarket"
}{
"type": "orderbook_delta_batch",
"deltas": [
{
"type": "orderbook_delta",
"outcomeId": "vmo_1",
"seq": 1710000002,
"checksum": 3847261950,
"bidChanges": [
[
0.55,
900,
{
"polymarket": 900
}
]
],
"askChanges": [],
"venueDeltaBooks": {
"polymarket": {
"bidChanges": [
[
0.55,
900
]
],
"askChanges": []
}
},
"venues": {
"polymarket": {
"bestBid": 0.55,
"bestAsk": 0.56
}
},
"midpoint": 0.555,
"spread": 0.01,
"timestamp": 1710000001000
}
]
}{
"type": "orderbook_delta",
"outcomeId": "clv2abc123def456",
"channel": "orderbook",
"seq": 1710000001,
"checksum": 2918476531,
"bidChanges": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"askChanges": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"venueDeltaBooks": {},
"venues": {},
"midpoint": 0.55,
"spread": 0.01,
"tick": 0,
"markSource": "local",
"timestamp": 1710000000000
}{
"type": "orderbook_snapshot",
"outcomeId": "clv2abc123def456",
"channel": "orderbook",
"seq": 1710000001,
"checksum": 2918476531,
"bids": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"asks": [
{
"price": 0.55,
"totalSize": 1500,
"venues": {}
}
],
"venueOrderbooks": {},
"venues": {},
"midpoint": 0.55,
"spread": 0.01,
"timestamp": 1710000000000,
"tick": 0,
"markSource": "local"
}{
"type": "error",
"code": "firehose_not_enabled"
}{
"action": "subscribe",
"channel": "firehose",
"venues": [
"polymarket"
],
"latency": "realtime",
"batchMs": 10
}App-level auth: pass appId as a query parameter on connect. Required for all connections. Browsers are admitted by an Origin on the app's allowed origins; servers by the apiKey scheme instead.
Optional server-to-server auth on the handshake; any supplied key must be valid and replaces the Origin check. Without a key, an allowed Origin is required even when the app has requireApiKey for REST. WebSocket key enforcement is currently deferred. Needed for the app-events channel and for the firehose channel on the orderbook socket. Never send from a browser.
User-level auth: send { action: 'authenticate', token } after connected (a token query param still works but is deprecated). Required for user-specific events (orders, balances). Same JWT as the REST API.
Ignore fields you do not use.
One slice of a venue snapshot: complete orderbook_snapshot objects.
That venue's snapshot has been sent. Live deltas for the venue follow.
Complete orderbook_delta objects. Each names its outcomeId.
Incremental update — only changed levels. size=0 means level removed.
Full aggregated orderbook state with venue attribution
Branch on code, not on message.
Stream every non-empty book for the named venues. Requires an app API key.