> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agg.market/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# 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](/recipes/orderbook-firehose).



## AsyncAPI

````yaml openapi/asyncapi.json firehose
id: firehose
title: Firehose
description: >-
  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](/recipes/orderbook-firehose).
servers:
  - id: orderbook
    protocol: wss
    host: ob.agg.market
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_7
    id: subscribeFirehose
    title: Subscribe firehose
    description: Subscribe to every non-empty book for selected venues
    type: send
    messages:
      - &ref_15
        id: subscribe
        payload:
          - name: Subscribe to the orderbook firehose
            description: >-
              Stream every non-empty book for the named venues. Requires an app
              API key.
            type: object
            properties:
              - name: action
                type: string
                description: subscribe
                required: true
              - name: channel
                type: string
                description: firehose
                required: true
              - name: venues
                type: array
                description: >-
                  Venue slugs to stream. Only venues included when the firehose
                  was enabled for your app are served; an empty enablement list
                  means every venue your app is allowed to see.
                required: true
                properties:
                  - name: item
                    type: string
                    required: false
              - name: latency
                type: string
                description: >-
                  Orderbook socket only. Omit or send `conflated` for the
                  default tier: at most one delta per book per 100 ms, the net
                  change since the previous one. `realtime` delivers each
                  accepted change as it happens. Applies only to the outcomes in
                  this subscribe. `seq` is counted separately on each tier. The
                  shared socket at ws.agg.market does not offer this choice.
                required: false
              - name: batchMs
                type: integer
                description: >-
                  Realtime only. `0` (default) sends each change as an
                  `orderbook_delta`. Any other value groups changes into
                  `orderbook_delta_batch` over that many milliseconds. The
                  conflated tier ignores it and sends one
                  `orderbook_delta_batch` per 100 ms flush.
                required: false
              - name: id
                type: anyOf
                description: >-
                  Optional request id, echoed on the ack and on errors caused by
                  this frame
                required: false
        headers: []
        jsonPayloadSchema:
          title: FirehoseSubscribe
          type: object
          required:
            - action
            - channel
            - venues
          properties:
            action:
              const: subscribe
              type: string
              x-parser-schema-id: <anonymous-schema-489>
            channel:
              const: firehose
              type: string
              x-parser-schema-id: <anonymous-schema-490>
            venues:
              description: >-
                Venue slugs to stream. Only venues included when the firehose
                was enabled for your app are served; an empty enablement list
                means every venue your app is allowed to see.
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-492>
              x-parser-schema-id: <anonymous-schema-491>
            latency:
              description: >-
                Orderbook socket only. Omit or send `conflated` for the default
                tier: at most one delta per book per 100 ms, the net change
                since the previous one. `realtime` delivers each accepted change
                as it happens. Applies only to the outcomes in this subscribe.
                `seq` is counted separately on each tier. The shared socket at
                ws.agg.market does not offer this choice.
              anyOf:
                - const: conflated
                  type: string
                  x-parser-schema-id: <anonymous-schema-494>
                - const: realtime
                  type: string
                  x-parser-schema-id: <anonymous-schema-495>
              x-parser-schema-id: <anonymous-schema-493>
            batchMs:
              minimum: 0
              maximum: 60000
              description: >-
                Realtime only. `0` (default) sends each change as an
                `orderbook_delta`. Any other value groups changes into
                `orderbook_delta_batch` over that many milliseconds. The
                conflated tier ignores it and sends one `orderbook_delta_batch`
                per 100 ms flush.
              type: integer
              x-parser-schema-id: <anonymous-schema-496>
            id:
              description: >-
                Optional request id, echoed on the ack and on errors caused by
                this frame
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-498>
                - type: number
                  x-parser-schema-id: <anonymous-schema-499>
              x-parser-schema-id: <anonymous-schema-497>
          x-parser-schema-id: <anonymous-schema-488>
        title: Subscribe to the orderbook firehose
        description: >-
          Stream every non-empty book for the named venues. Requires an app API
          key.
        example: |-
          {
            "action": "subscribe",
            "channel": "firehose",
            "venues": [
              "polymarket"
            ],
            "latency": "realtime",
            "batchMs": 10
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: firehose
  - &ref_1
    id: receiveFirehoseSubscribed
    title: Receive firehose subscribed
    description: Firehose subscription confirmed
    type: receive
    messages:
      - &ref_8
        id: subscribed
        payload:
          - name: Firehose subscription confirmed
            description: Ignore fields you do not use.
            type: object
            properties:
              - name: type
                type: string
                description: subscribed
                required: true
              - name: channel
                type: string
                description: firehose
                required: true
              - name: venues
                type: array
                required: false
                properties:
                  - name: item
                    type: string
                    required: false
              - name: id
                type: anyOf
                required: false
        headers: []
        jsonPayloadSchema:
          title: FirehoseSubscribed
          type: object
          required:
            - type
            - channel
          properties:
            type:
              const: subscribed
              type: string
              x-parser-schema-id: <anonymous-schema-501>
            channel:
              const: firehose
              type: string
              x-parser-schema-id: <anonymous-schema-502>
            venues:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-504>
              x-parser-schema-id: <anonymous-schema-503>
            id:
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-506>
                - type: number
                  x-parser-schema-id: <anonymous-schema-507>
              x-parser-schema-id: <anonymous-schema-505>
          x-parser-schema-id: <anonymous-schema-500>
        title: Firehose subscription confirmed
        description: Ignore fields you do not use.
        example: |-
          {
            "type": "subscribed",
            "channel": "firehose"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
    bindings: []
    extensions: *ref_0
  - &ref_2
    id: receiveOrderbookSnapshotBatch
    title: Receive orderbook snapshot batch
    description: One slice of a venue snapshot
    type: receive
    messages:
      - &ref_9
        id: orderbookSnapshotBatch
        payload:
          - name: Orderbook snapshot batch
            description: >-
              One slice of a venue snapshot: complete orderbook_snapshot
              objects.
            type: object
            properties:
              - name: type
                type: string
                description: orderbook_snapshot_batch
                required: true
              - name: venue
                type: string
                description: Venue slug this slice of the venue snapshot belongs to
                required: true
              - name: part
                type: integer
                description: Slice number of this venue snapshot
                required: true
              - name: parts
                type: integer
                description: Total slices in this venue snapshot
                required: true
              - name: snapshots
                type: array
                description: >-
                  Complete `orderbook_snapshot` objects. Replace each book
                  whatever its `seq` is. Empty books are omitted.
                required: true
                properties:
                  - name: type
                    type: string
                    description: orderbook_snapshot
                    required: true
                  - name: outcomeId
                    type: string
                    description: Outcome ID
                    required: true
                  - name: channel
                    type: string
                    required: false
                  - name: seq
                    type: number
                    description: Sequence number for this outcome
                    required: true
                  - name: checksum
                    type: number
                    description: Checksum of the full book after this update
                    required: true
                  - name: bids
                    type: array
                    description: All bid levels, sorted desc by price
                    required: true
                    properties:
                      - name: price
                        type: number
                        description: Price level (0–1)
                        required: true
                      - name: totalSize
                        type: number
                        description: Total size across all venues
                        required: true
                      - name: venues
                        type: object
                        required: true
                  - name: asks
                    type: array
                    description: All ask levels, sorted asc by price
                    required: true
                    properties:
                      - name: price
                        type: number
                        description: Price level (0–1)
                        required: true
                      - name: totalSize
                        type: number
                        description: Total size across all venues
                        required: true
                      - name: venues
                        type: object
                        required: true
                  - name: venueOrderbooks
                    type: object
                    description: Per-venue orderbooks
                    required: true
                  - name: venues
                    type: object
                    description: Per-venue best bid/ask
                    required: true
                  - name: midpoint
                    type: number
                    required: true
                  - name: spread
                    type: number
                    required: true
                  - name: timestamp
                    type: number
                    required: true
                  - name: tick
                    type: number
                    required: false
                  - name: markSource
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          title: OrderbookSnapshotBatch
          type: object
          required:
            - type
            - venue
            - part
            - parts
            - snapshots
          properties:
            type:
              const: orderbook_snapshot_batch
              type: string
              x-parser-schema-id: <anonymous-schema-509>
            venue:
              description: Venue slug this slice of the venue snapshot belongs to
              type: string
              x-parser-schema-id: <anonymous-schema-510>
            part:
              description: Slice number of this venue snapshot
              type: integer
              x-parser-schema-id: <anonymous-schema-511>
            parts:
              description: Total slices in this venue snapshot
              type: integer
              x-parser-schema-id: <anonymous-schema-512>
            snapshots:
              description: >-
                Complete `orderbook_snapshot` objects. Replace each book
                whatever its `seq` is. Empty books are omitted.
              type: array
              items:
                type: object
                required:
                  - type
                  - outcomeId
                  - seq
                  - checksum
                  - bids
                  - asks
                  - venueOrderbooks
                  - venues
                  - midpoint
                  - spread
                  - timestamp
                properties:
                  type:
                    const: orderbook_snapshot
                    type: string
                    x-parser-schema-id: <anonymous-schema-515>
                  outcomeId:
                    description: Outcome ID
                    type: string
                    x-parser-schema-id: <anonymous-schema-516>
                  channel:
                    anyOf:
                      - const: orderbook
                        type: string
                        x-parser-schema-id: <anonymous-schema-518>
                      - const: trades
                        type: string
                        x-parser-schema-id: <anonymous-schema-519>
                    x-parser-schema-id: <anonymous-schema-517>
                  seq:
                    description: Sequence number for this outcome
                    type: number
                    x-parser-schema-id: <anonymous-schema-520>
                  checksum:
                    description: Checksum of the full book after this update
                    type: number
                    x-parser-schema-id: <anonymous-schema-521>
                  bids:
                    description: All bid levels, sorted desc by price
                    type: array
                    items:
                      description: |-
                        [price, totalSize, {venue: sizeAtPrice}]

                        Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                      type: object
                      additionalItems: false
                      properties:
                        price:
                          type: number
                          description: Price level (0–1)
                          x-parser-schema-id: <anonymous-schema-524>
                        totalSize:
                          type: number
                          description: Total size across all venues
                          x-parser-schema-id: <anonymous-schema-525>
                        venues:
                          type: object
                          patternProperties:
                            ^(.*)$:
                              type: number
                              x-parser-schema-id: <anonymous-schema-527>
                          x-parser-schema-id: <anonymous-schema-526>
                      required:
                        - price
                        - totalSize
                        - venues
                      x-parser-schema-id: <anonymous-schema-523>
                    x-parser-schema-id: <anonymous-schema-522>
                  asks:
                    description: All ask levels, sorted asc by price
                    type: array
                    items:
                      description: |-
                        [price, totalSize, {venue: sizeAtPrice}]

                        Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                      type: object
                      additionalItems: false
                      properties:
                        price:
                          type: number
                          description: Price level (0–1)
                          x-parser-schema-id: <anonymous-schema-530>
                        totalSize:
                          type: number
                          description: Total size across all venues
                          x-parser-schema-id: <anonymous-schema-531>
                        venues:
                          type: object
                          patternProperties:
                            ^(.*)$:
                              type: number
                              x-parser-schema-id: <anonymous-schema-533>
                          x-parser-schema-id: <anonymous-schema-532>
                      required:
                        - price
                        - totalSize
                        - venues
                      x-parser-schema-id: <anonymous-schema-529>
                    x-parser-schema-id: <anonymous-schema-528>
                  venueOrderbooks:
                    description: Per-venue orderbooks
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: object
                        required:
                          - bids
                          - asks
                        properties:
                          bids:
                            type: array
                            items:
                              description: |-
                                [price, size]

                                Wire format: `[price, size]`
                              type: object
                              additionalItems: false
                              properties:
                                price:
                                  type: number
                                  description: Price level (0–1)
                                  x-parser-schema-id: <anonymous-schema-538>
                                size:
                                  type: number
                                  description: Size at this price
                                  x-parser-schema-id: <anonymous-schema-539>
                              required:
                                - price
                                - size
                              x-parser-schema-id: <anonymous-schema-537>
                            x-parser-schema-id: <anonymous-schema-536>
                          asks:
                            type: array
                            items:
                              description: |-
                                [price, size]

                                Wire format: `[price, size]`
                              type: object
                              additionalItems: false
                              properties:
                                price:
                                  type: number
                                  description: Price level (0–1)
                                  x-parser-schema-id: <anonymous-schema-542>
                                size:
                                  type: number
                                  description: Size at this price
                                  x-parser-schema-id: <anonymous-schema-543>
                              required:
                                - price
                                - size
                              x-parser-schema-id: <anonymous-schema-541>
                            x-parser-schema-id: <anonymous-schema-540>
                        x-parser-schema-id: <anonymous-schema-535>
                    x-parser-schema-id: <anonymous-schema-534>
                  venues:
                    description: Per-venue best bid/ask
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: object
                        required:
                          - bestBid
                          - bestAsk
                        properties:
                          bestBid:
                            anyOf:
                              - type: number
                                x-parser-schema-id: <anonymous-schema-547>
                              - type: 'null'
                                x-parser-schema-id: <anonymous-schema-548>
                            x-parser-schema-id: <anonymous-schema-546>
                          bestAsk:
                            anyOf:
                              - type: number
                                x-parser-schema-id: <anonymous-schema-550>
                              - type: 'null'
                                x-parser-schema-id: <anonymous-schema-551>
                            x-parser-schema-id: <anonymous-schema-549>
                        x-parser-schema-id: <anonymous-schema-545>
                    x-parser-schema-id: <anonymous-schema-544>
                  midpoint:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-553>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-554>
                    x-parser-schema-id: <anonymous-schema-552>
                  spread:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-556>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-557>
                    x-parser-schema-id: <anonymous-schema-555>
                  timestamp:
                    type: number
                    x-parser-schema-id: <anonymous-schema-558>
                  tick:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-560>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-561>
                    x-parser-schema-id: <anonymous-schema-559>
                  markSource:
                    anyOf:
                      - const: local
                        type: string
                        x-parser-schema-id: <anonymous-schema-563>
                      - const: local_merged
                        type: string
                        x-parser-schema-id: <anonymous-schema-564>
                      - const: local_one_sided
                        type: string
                        x-parser-schema-id: <anonymous-schema-565>
                      - const: sibling
                        type: string
                        x-parser-schema-id: <anonymous-schema-566>
                      - const: local_boundary
                        type: string
                        x-parser-schema-id: <anonymous-schema-567>
                      - const: none
                        type: string
                        x-parser-schema-id: <anonymous-schema-568>
                    x-parser-schema-id: <anonymous-schema-562>
                x-parser-schema-id: <anonymous-schema-514>
              x-parser-schema-id: <anonymous-schema-513>
          x-parser-schema-id: <anonymous-schema-508>
        title: Orderbook snapshot batch
        description: 'One slice of a venue snapshot: complete orderbook_snapshot objects.'
        example: |-
          {
            "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
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderbookSnapshotBatch
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: receiveFirehoseReady
    title: Receive firehose ready
    description: A venue's snapshot has been sent; live deltas follow
    type: receive
    messages:
      - &ref_10
        id: firehoseReady
        payload:
          - name: Firehose venue ready
            description: >-
              That venue's snapshot has been sent. Live deltas for the venue
              follow.
            type: object
            properties:
              - name: type
                type: string
                description: firehose_ready
                required: true
              - name: venue
                type: string
                description: >-
                  The venue whose snapshot has been sent. Live deltas for it
                  follow.
                required: true
        headers: []
        jsonPayloadSchema:
          title: FirehoseReady
          type: object
          required:
            - type
            - venue
          properties:
            type:
              const: firehose_ready
              type: string
              x-parser-schema-id: <anonymous-schema-570>
            venue:
              description: >-
                The venue whose snapshot has been sent. Live deltas for it
                follow.
              type: string
              x-parser-schema-id: <anonymous-schema-571>
          x-parser-schema-id: <anonymous-schema-569>
        title: Firehose venue ready
        description: That venue's snapshot has been sent. Live deltas for the venue follow.
        example: |-
          {
            "type": "firehose_ready",
            "venue": "polymarket"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: firehoseReady
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: receiveOrderbookDeltaBatch
    title: Receive orderbook delta batch
    description: Live changes across the venues you stream
    type: receive
    messages:
      - &ref_11
        id: orderbookDeltaBatch
        payload:
          - name: Orderbook delta batch
            description: Complete orderbook_delta objects. Each names its outcomeId.
            type: object
            properties:
              - name: type
                type: string
                description: orderbook_delta_batch
                required: true
              - name: deltas
                type: array
                description: >-
                  Complete `orderbook_delta` objects, not split by venue. Drop a
                  delta whose `seq` is less than or equal to the book's current
                  `seq`.
                required: true
                properties:
                  - name: type
                    type: string
                    description: orderbook_delta
                    required: true
                  - name: outcomeId
                    type: string
                    description: Outcome ID
                    required: true
                  - name: channel
                    type: string
                    required: false
                  - name: seq
                    type: number
                    description: Sequence number for this outcome
                    required: true
                  - name: checksum
                    type: number
                    description: Checksum of the full book after applying this delta
                    required: true
                  - name: bidChanges
                    type: array
                    description: Changed bid levels (size=0 means removed)
                    required: true
                    properties:
                      - name: price
                        type: number
                        description: Price level (0–1)
                        required: true
                      - name: totalSize
                        type: number
                        description: Total size across all venues
                        required: true
                      - name: venues
                        type: object
                        required: true
                  - name: askChanges
                    type: array
                    description: Changed ask levels (size=0 means removed)
                    required: true
                    properties:
                      - name: price
                        type: number
                        description: Price level (0–1)
                        required: true
                      - name: totalSize
                        type: number
                        description: Total size across all venues
                        required: true
                      - name: venues
                        type: object
                        required: true
                  - name: venueDeltaBooks
                    type: object
                    description: Per-venue level changes
                    required: true
                  - name: venues
                    type: object
                    description: Per-venue best bid/ask
                    required: true
                  - name: midpoint
                    type: number
                    required: true
                  - name: spread
                    type: number
                    required: true
                  - name: tick
                    type: number
                    required: false
                  - name: markSource
                    type: string
                    required: false
                  - name: timestamp
                    type: number
                    required: true
        headers: []
        jsonPayloadSchema:
          title: OrderbookDeltaBatch
          type: object
          required:
            - type
            - deltas
          properties:
            type:
              const: orderbook_delta_batch
              type: string
              x-parser-schema-id: <anonymous-schema-573>
            deltas:
              description: >-
                Complete `orderbook_delta` objects, not split by venue. Drop a
                delta whose `seq` is less than or equal to the book's current
                `seq`.
              type: array
              items:
                type: object
                required:
                  - type
                  - outcomeId
                  - seq
                  - checksum
                  - bidChanges
                  - askChanges
                  - venueDeltaBooks
                  - venues
                  - midpoint
                  - spread
                  - timestamp
                properties:
                  type:
                    const: orderbook_delta
                    type: string
                    x-parser-schema-id: <anonymous-schema-576>
                  outcomeId:
                    description: Outcome ID
                    type: string
                    x-parser-schema-id: <anonymous-schema-577>
                  channel:
                    anyOf:
                      - const: orderbook
                        type: string
                        x-parser-schema-id: <anonymous-schema-579>
                      - const: trades
                        type: string
                        x-parser-schema-id: <anonymous-schema-580>
                    x-parser-schema-id: <anonymous-schema-578>
                  seq:
                    description: Sequence number for this outcome
                    type: number
                    x-parser-schema-id: <anonymous-schema-581>
                  checksum:
                    description: Checksum of the full book after applying this delta
                    type: number
                    x-parser-schema-id: <anonymous-schema-582>
                  bidChanges:
                    description: Changed bid levels (size=0 means removed)
                    type: array
                    items:
                      description: |-
                        [price, totalSize, {venue: sizeAtPrice}]

                        Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                      type: object
                      additionalItems: false
                      properties:
                        price:
                          type: number
                          description: Price level (0–1)
                          x-parser-schema-id: <anonymous-schema-585>
                        totalSize:
                          type: number
                          description: Total size across all venues
                          x-parser-schema-id: <anonymous-schema-586>
                        venues:
                          type: object
                          patternProperties:
                            ^(.*)$:
                              type: number
                              x-parser-schema-id: <anonymous-schema-588>
                          x-parser-schema-id: <anonymous-schema-587>
                      required:
                        - price
                        - totalSize
                        - venues
                      x-parser-schema-id: <anonymous-schema-584>
                    x-parser-schema-id: <anonymous-schema-583>
                  askChanges:
                    description: Changed ask levels (size=0 means removed)
                    type: array
                    items:
                      description: |-
                        [price, totalSize, {venue: sizeAtPrice}]

                        Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                      type: object
                      additionalItems: false
                      properties:
                        price:
                          type: number
                          description: Price level (0–1)
                          x-parser-schema-id: <anonymous-schema-591>
                        totalSize:
                          type: number
                          description: Total size across all venues
                          x-parser-schema-id: <anonymous-schema-592>
                        venues:
                          type: object
                          patternProperties:
                            ^(.*)$:
                              type: number
                              x-parser-schema-id: <anonymous-schema-594>
                          x-parser-schema-id: <anonymous-schema-593>
                      required:
                        - price
                        - totalSize
                        - venues
                      x-parser-schema-id: <anonymous-schema-590>
                    x-parser-schema-id: <anonymous-schema-589>
                  venueDeltaBooks:
                    description: Per-venue level changes
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: object
                        required:
                          - bidChanges
                          - askChanges
                        properties:
                          bidChanges:
                            type: array
                            items:
                              description: |-
                                [price, size]

                                Wire format: `[price, size]`
                              type: object
                              additionalItems: false
                              properties:
                                price:
                                  type: number
                                  description: Price level (0–1)
                                  x-parser-schema-id: <anonymous-schema-599>
                                size:
                                  type: number
                                  description: Size at this price
                                  x-parser-schema-id: <anonymous-schema-600>
                              required:
                                - price
                                - size
                              x-parser-schema-id: <anonymous-schema-598>
                            x-parser-schema-id: <anonymous-schema-597>
                          askChanges:
                            type: array
                            items:
                              description: |-
                                [price, size]

                                Wire format: `[price, size]`
                              type: object
                              additionalItems: false
                              properties:
                                price:
                                  type: number
                                  description: Price level (0–1)
                                  x-parser-schema-id: <anonymous-schema-603>
                                size:
                                  type: number
                                  description: Size at this price
                                  x-parser-schema-id: <anonymous-schema-604>
                              required:
                                - price
                                - size
                              x-parser-schema-id: <anonymous-schema-602>
                            x-parser-schema-id: <anonymous-schema-601>
                        x-parser-schema-id: <anonymous-schema-596>
                    x-parser-schema-id: <anonymous-schema-595>
                  venues:
                    description: Per-venue best bid/ask
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: object
                        required:
                          - bestBid
                          - bestAsk
                        properties:
                          bestBid:
                            anyOf:
                              - type: number
                                x-parser-schema-id: <anonymous-schema-608>
                              - type: 'null'
                                x-parser-schema-id: <anonymous-schema-609>
                            x-parser-schema-id: <anonymous-schema-607>
                          bestAsk:
                            anyOf:
                              - type: number
                                x-parser-schema-id: <anonymous-schema-611>
                              - type: 'null'
                                x-parser-schema-id: <anonymous-schema-612>
                            x-parser-schema-id: <anonymous-schema-610>
                        x-parser-schema-id: <anonymous-schema-606>
                    x-parser-schema-id: <anonymous-schema-605>
                  midpoint:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-614>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-615>
                    x-parser-schema-id: <anonymous-schema-613>
                  spread:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-617>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-618>
                    x-parser-schema-id: <anonymous-schema-616>
                  tick:
                    anyOf:
                      - type: number
                        x-parser-schema-id: <anonymous-schema-620>
                      - type: 'null'
                        x-parser-schema-id: <anonymous-schema-621>
                    x-parser-schema-id: <anonymous-schema-619>
                  markSource:
                    anyOf:
                      - const: local
                        type: string
                        x-parser-schema-id: <anonymous-schema-623>
                      - const: local_merged
                        type: string
                        x-parser-schema-id: <anonymous-schema-624>
                      - const: local_one_sided
                        type: string
                        x-parser-schema-id: <anonymous-schema-625>
                      - const: sibling
                        type: string
                        x-parser-schema-id: <anonymous-schema-626>
                      - const: local_boundary
                        type: string
                        x-parser-schema-id: <anonymous-schema-627>
                      - const: none
                        type: string
                        x-parser-schema-id: <anonymous-schema-628>
                    x-parser-schema-id: <anonymous-schema-622>
                  timestamp:
                    type: number
                    x-parser-schema-id: <anonymous-schema-629>
                x-parser-schema-id: <anonymous-schema-575>
              x-parser-schema-id: <anonymous-schema-574>
          x-parser-schema-id: <anonymous-schema-572>
        title: Orderbook delta batch
        description: Complete orderbook_delta objects. Each names its outcomeId.
        example: |-
          {
            "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
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderbookDeltaBatch
      - &ref_12
        id: orderbookDelta
        payload:
          - name: Orderbook delta
            description: >-
              Incremental update — only changed levels. size=0 means level
              removed.
            type: object
            properties:
              - name: type
                type: string
                description: orderbook_delta
                required: true
              - name: outcomeId
                type: string
                description: Outcome ID
                required: true
              - name: channel
                type: string
                required: false
              - name: seq
                type: number
                description: Sequence number for this outcome
                required: true
              - name: checksum
                type: number
                description: Checksum of the full book after applying this delta
                required: true
              - name: bidChanges
                type: array
                description: Changed bid levels (size=0 means removed)
                required: true
                properties:
                  - name: price
                    type: number
                    description: Price level (0–1)
                    required: true
                  - name: totalSize
                    type: number
                    description: Total size across all venues
                    required: true
                  - name: venues
                    type: object
                    required: true
              - name: askChanges
                type: array
                description: Changed ask levels (size=0 means removed)
                required: true
                properties:
                  - name: price
                    type: number
                    description: Price level (0–1)
                    required: true
                  - name: totalSize
                    type: number
                    description: Total size across all venues
                    required: true
                  - name: venues
                    type: object
                    required: true
              - name: venueDeltaBooks
                type: object
                description: Per-venue level changes
                required: true
              - name: venues
                type: object
                description: Per-venue best bid/ask
                required: true
              - name: midpoint
                type: number
                required: true
              - name: spread
                type: number
                required: true
              - name: tick
                type: number
                required: false
              - name: markSource
                type: string
                required: false
              - name: timestamp
                type: number
                required: true
        headers: []
        jsonPayloadSchema:
          title: OrderbookDelta
          type: object
          required:
            - type
            - outcomeId
            - seq
            - checksum
            - bidChanges
            - askChanges
            - venueDeltaBooks
            - venues
            - midpoint
            - spread
            - timestamp
          properties:
            type:
              const: orderbook_delta
              type: string
              x-parser-schema-id: <anonymous-schema-96>
            outcomeId:
              description: Outcome ID
              type: string
              x-parser-schema-id: <anonymous-schema-97>
            channel:
              anyOf:
                - const: orderbook
                  type: string
                  x-parser-schema-id: <anonymous-schema-99>
                - const: trades
                  type: string
                  x-parser-schema-id: <anonymous-schema-100>
              x-parser-schema-id: <anonymous-schema-98>
            seq:
              description: Sequence number for this outcome
              type: number
              x-parser-schema-id: <anonymous-schema-101>
            checksum:
              description: Checksum of the full book after applying this delta
              type: number
              x-parser-schema-id: <anonymous-schema-102>
            bidChanges:
              description: Changed bid levels (size=0 means removed)
              type: array
              items:
                description: |-
                  [price, totalSize, {venue: sizeAtPrice}]

                  Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                type: object
                additionalItems: false
                properties:
                  price:
                    type: number
                    description: Price level (0–1)
                    x-parser-schema-id: <anonymous-schema-105>
                  totalSize:
                    type: number
                    description: Total size across all venues
                    x-parser-schema-id: <anonymous-schema-106>
                  venues:
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: number
                        x-parser-schema-id: <anonymous-schema-108>
                    x-parser-schema-id: <anonymous-schema-107>
                required:
                  - price
                  - totalSize
                  - venues
                x-parser-schema-id: <anonymous-schema-104>
              x-parser-schema-id: <anonymous-schema-103>
            askChanges:
              description: Changed ask levels (size=0 means removed)
              type: array
              items:
                description: |-
                  [price, totalSize, {venue: sizeAtPrice}]

                  Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                type: object
                additionalItems: false
                properties:
                  price:
                    type: number
                    description: Price level (0–1)
                    x-parser-schema-id: <anonymous-schema-111>
                  totalSize:
                    type: number
                    description: Total size across all venues
                    x-parser-schema-id: <anonymous-schema-112>
                  venues:
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: number
                        x-parser-schema-id: <anonymous-schema-114>
                    x-parser-schema-id: <anonymous-schema-113>
                required:
                  - price
                  - totalSize
                  - venues
                x-parser-schema-id: <anonymous-schema-110>
              x-parser-schema-id: <anonymous-schema-109>
            venueDeltaBooks:
              description: Per-venue level changes
              type: object
              patternProperties:
                ^(.*)$:
                  type: object
                  required:
                    - bidChanges
                    - askChanges
                  properties:
                    bidChanges:
                      type: array
                      items:
                        description: |-
                          [price, size]

                          Wire format: `[price, size]`
                        type: object
                        additionalItems: false
                        properties:
                          price:
                            type: number
                            description: Price level (0–1)
                            x-parser-schema-id: <anonymous-schema-119>
                          size:
                            type: number
                            description: Size at this price
                            x-parser-schema-id: <anonymous-schema-120>
                        required:
                          - price
                          - size
                        x-parser-schema-id: <anonymous-schema-118>
                      x-parser-schema-id: <anonymous-schema-117>
                    askChanges:
                      type: array
                      items:
                        description: |-
                          [price, size]

                          Wire format: `[price, size]`
                        type: object
                        additionalItems: false
                        properties:
                          price:
                            type: number
                            description: Price level (0–1)
                            x-parser-schema-id: <anonymous-schema-123>
                          size:
                            type: number
                            description: Size at this price
                            x-parser-schema-id: <anonymous-schema-124>
                        required:
                          - price
                          - size
                        x-parser-schema-id: <anonymous-schema-122>
                      x-parser-schema-id: <anonymous-schema-121>
                  x-parser-schema-id: <anonymous-schema-116>
              x-parser-schema-id: <anonymous-schema-115>
            venues:
              description: Per-venue best bid/ask
              type: object
              patternProperties:
                ^(.*)$:
                  type: object
                  required:
                    - bestBid
                    - bestAsk
                  properties:
                    bestBid:
                      anyOf:
                        - type: number
                          x-parser-schema-id: <anonymous-schema-128>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-129>
                      x-parser-schema-id: <anonymous-schema-127>
                    bestAsk:
                      anyOf:
                        - type: number
                          x-parser-schema-id: <anonymous-schema-131>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-132>
                      x-parser-schema-id: <anonymous-schema-130>
                  x-parser-schema-id: <anonymous-schema-126>
              x-parser-schema-id: <anonymous-schema-125>
            midpoint:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-134>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-135>
              x-parser-schema-id: <anonymous-schema-133>
            spread:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-137>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-138>
              x-parser-schema-id: <anonymous-schema-136>
            tick:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-140>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-141>
              x-parser-schema-id: <anonymous-schema-139>
            markSource:
              anyOf:
                - const: local
                  type: string
                  x-parser-schema-id: <anonymous-schema-143>
                - const: local_merged
                  type: string
                  x-parser-schema-id: <anonymous-schema-144>
                - const: local_one_sided
                  type: string
                  x-parser-schema-id: <anonymous-schema-145>
                - const: sibling
                  type: string
                  x-parser-schema-id: <anonymous-schema-146>
                - const: local_boundary
                  type: string
                  x-parser-schema-id: <anonymous-schema-147>
                - const: none
                  type: string
                  x-parser-schema-id: <anonymous-schema-148>
              x-parser-schema-id: <anonymous-schema-142>
            timestamp:
              type: number
              x-parser-schema-id: <anonymous-schema-149>
          x-parser-schema-id: <anonymous-schema-95>
        title: Orderbook delta
        description: Incremental update — only changed levels. size=0 means level removed.
        example: |-
          {
            "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
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderbookDelta
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: receiveFirehoseSnapshot
    title: Receive firehose snapshot
    description: A single snapshot for a book that first gets levels
    type: receive
    messages:
      - &ref_13
        id: orderbookSnapshot
        payload:
          - name: Orderbook snapshot
            description: Full aggregated orderbook state with venue attribution
            type: object
            properties:
              - name: type
                type: string
                description: orderbook_snapshot
                required: true
              - name: outcomeId
                type: string
                description: Outcome ID
                required: true
              - name: channel
                type: string
                required: false
              - name: seq
                type: number
                description: Sequence number for this outcome
                required: true
              - name: checksum
                type: number
                description: Checksum of the full book after this update
                required: true
              - name: bids
                type: array
                description: All bid levels, sorted desc by price
                required: true
                properties:
                  - name: price
                    type: number
                    description: Price level (0–1)
                    required: true
                  - name: totalSize
                    type: number
                    description: Total size across all venues
                    required: true
                  - name: venues
                    type: object
                    required: true
              - name: asks
                type: array
                description: All ask levels, sorted asc by price
                required: true
                properties:
                  - name: price
                    type: number
                    description: Price level (0–1)
                    required: true
                  - name: totalSize
                    type: number
                    description: Total size across all venues
                    required: true
                  - name: venues
                    type: object
                    required: true
              - name: venueOrderbooks
                type: object
                description: Per-venue orderbooks
                required: true
              - name: venues
                type: object
                description: Per-venue best bid/ask
                required: true
              - name: midpoint
                type: number
                required: true
              - name: spread
                type: number
                required: true
              - name: timestamp
                type: number
                required: true
              - name: tick
                type: number
                required: false
              - name: markSource
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          title: OrderbookSnapshot
          type: object
          required:
            - type
            - outcomeId
            - seq
            - checksum
            - bids
            - asks
            - venueOrderbooks
            - venues
            - midpoint
            - spread
            - timestamp
          properties:
            type:
              const: orderbook_snapshot
              type: string
              x-parser-schema-id: <anonymous-schema-41>
            outcomeId:
              description: Outcome ID
              type: string
              x-parser-schema-id: <anonymous-schema-42>
            channel:
              anyOf:
                - const: orderbook
                  type: string
                  x-parser-schema-id: <anonymous-schema-44>
                - const: trades
                  type: string
                  x-parser-schema-id: <anonymous-schema-45>
              x-parser-schema-id: <anonymous-schema-43>
            seq:
              description: Sequence number for this outcome
              type: number
              x-parser-schema-id: <anonymous-schema-46>
            checksum:
              description: Checksum of the full book after this update
              type: number
              x-parser-schema-id: <anonymous-schema-47>
            bids:
              description: All bid levels, sorted desc by price
              type: array
              items:
                description: |-
                  [price, totalSize, {venue: sizeAtPrice}]

                  Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                type: object
                additionalItems: false
                properties:
                  price:
                    type: number
                    description: Price level (0–1)
                    x-parser-schema-id: <anonymous-schema-50>
                  totalSize:
                    type: number
                    description: Total size across all venues
                    x-parser-schema-id: <anonymous-schema-51>
                  venues:
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: number
                        x-parser-schema-id: <anonymous-schema-53>
                    x-parser-schema-id: <anonymous-schema-52>
                required:
                  - price
                  - totalSize
                  - venues
                x-parser-schema-id: <anonymous-schema-49>
              x-parser-schema-id: <anonymous-schema-48>
            asks:
              description: All ask levels, sorted asc by price
              type: array
              items:
                description: |-
                  [price, totalSize, {venue: sizeAtPrice}]

                  Wire format: `[price, totalSize, {venue: sizeAtPrice}]`
                type: object
                additionalItems: false
                properties:
                  price:
                    type: number
                    description: Price level (0–1)
                    x-parser-schema-id: <anonymous-schema-56>
                  totalSize:
                    type: number
                    description: Total size across all venues
                    x-parser-schema-id: <anonymous-schema-57>
                  venues:
                    type: object
                    patternProperties:
                      ^(.*)$:
                        type: number
                        x-parser-schema-id: <anonymous-schema-59>
                    x-parser-schema-id: <anonymous-schema-58>
                required:
                  - price
                  - totalSize
                  - venues
                x-parser-schema-id: <anonymous-schema-55>
              x-parser-schema-id: <anonymous-schema-54>
            venueOrderbooks:
              description: Per-venue orderbooks
              type: object
              patternProperties:
                ^(.*)$:
                  type: object
                  required:
                    - bids
                    - asks
                  properties:
                    bids:
                      type: array
                      items:
                        description: |-
                          [price, size]

                          Wire format: `[price, size]`
                        type: object
                        additionalItems: false
                        properties:
                          price:
                            type: number
                            description: Price level (0–1)
                            x-parser-schema-id: <anonymous-schema-64>
                          size:
                            type: number
                            description: Size at this price
                            x-parser-schema-id: <anonymous-schema-65>
                        required:
                          - price
                          - size
                        x-parser-schema-id: <anonymous-schema-63>
                      x-parser-schema-id: <anonymous-schema-62>
                    asks:
                      type: array
                      items:
                        description: |-
                          [price, size]

                          Wire format: `[price, size]`
                        type: object
                        additionalItems: false
                        properties:
                          price:
                            type: number
                            description: Price level (0–1)
                            x-parser-schema-id: <anonymous-schema-68>
                          size:
                            type: number
                            description: Size at this price
                            x-parser-schema-id: <anonymous-schema-69>
                        required:
                          - price
                          - size
                        x-parser-schema-id: <anonymous-schema-67>
                      x-parser-schema-id: <anonymous-schema-66>
                  x-parser-schema-id: <anonymous-schema-61>
              x-parser-schema-id: <anonymous-schema-60>
            venues:
              description: Per-venue best bid/ask
              type: object
              patternProperties:
                ^(.*)$:
                  type: object
                  required:
                    - bestBid
                    - bestAsk
                  properties:
                    bestBid:
                      anyOf:
                        - type: number
                          x-parser-schema-id: <anonymous-schema-73>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-74>
                      x-parser-schema-id: <anonymous-schema-72>
                    bestAsk:
                      anyOf:
                        - type: number
                          x-parser-schema-id: <anonymous-schema-76>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-77>
                      x-parser-schema-id: <anonymous-schema-75>
                  x-parser-schema-id: <anonymous-schema-71>
              x-parser-schema-id: <anonymous-schema-70>
            midpoint:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-79>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-80>
              x-parser-schema-id: <anonymous-schema-78>
            spread:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-82>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-83>
              x-parser-schema-id: <anonymous-schema-81>
            timestamp:
              type: number
              x-parser-schema-id: <anonymous-schema-84>
            tick:
              anyOf:
                - type: number
                  x-parser-schema-id: <anonymous-schema-86>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-87>
              x-parser-schema-id: <anonymous-schema-85>
            markSource:
              anyOf:
                - const: local
                  type: string
                  x-parser-schema-id: <anonymous-schema-89>
                - const: local_merged
                  type: string
                  x-parser-schema-id: <anonymous-schema-90>
                - const: local_one_sided
                  type: string
                  x-parser-schema-id: <anonymous-schema-91>
                - const: sibling
                  type: string
                  x-parser-schema-id: <anonymous-schema-92>
                - const: local_boundary
                  type: string
                  x-parser-schema-id: <anonymous-schema-93>
                - const: none
                  type: string
                  x-parser-schema-id: <anonymous-schema-94>
              x-parser-schema-id: <anonymous-schema-88>
          x-parser-schema-id: <anonymous-schema-40>
        title: Orderbook snapshot
        description: Full aggregated orderbook state with venue attribution
        example: |-
          {
            "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"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: orderbookSnapshot
    bindings: []
    extensions: *ref_0
  - &ref_6
    id: receiveFirehoseError
    title: Receive firehose error
    description: Firehose refusals and resyncs
    type: receive
    messages:
      - &ref_14
        id: error
        payload:
          - name: Firehose error
            description: Branch on code, not on message.
            type: object
            properties:
              - name: type
                type: string
                description: error
                required: true
              - name: code
                type: string
                description: Machine-readable error code. Branch on this, not on `message`.
                required: true
              - name: message
                type: string
                required: false
              - name: id
                type: anyOf
                required: false
        headers: []
        jsonPayloadSchema:
          title: FirehoseError
          type: object
          required:
            - type
            - code
          properties:
            type:
              const: error
              type: string
              x-parser-schema-id: <anonymous-schema-631>
            code:
              description: Machine-readable error code. Branch on this, not on `message`.
              anyOf:
                - const: firehose_not_enabled
                  type: string
                  x-parser-schema-id: <anonymous-schema-633>
                - const: too_many_connections
                  type: string
                  x-parser-schema-id: <anonymous-schema-634>
                - const: firehose_resync
                  type: string
                  x-parser-schema-id: <anonymous-schema-635>
              x-parser-schema-id: <anonymous-schema-632>
            message:
              type: string
              x-parser-schema-id: <anonymous-schema-636>
            id:
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-638>
                - type: number
                  x-parser-schema-id: <anonymous-schema-639>
              x-parser-schema-id: <anonymous-schema-637>
          x-parser-schema-id: <anonymous-schema-630>
        title: Firehose error
        description: Branch on code, not on message.
        example: |-
          {
            "type": "error",
            "code": "firehose_not_enabled"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
  - *ref_4
  - *ref_5
  - *ref_6
receiveOperations:
  - *ref_7
sendMessages:
  - *ref_8
  - *ref_9
  - *ref_10
  - *ref_11
  - *ref_12
  - *ref_13
  - *ref_14
receiveMessages:
  - *ref_15
extensions:
  - id: x-parser-unique-object-id
    value: firehose
securitySchemes:
  - id: appId
    name: appId
    type: userPassword
    description: >-
      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.
    extensions: []
  - id: apiKey
    name: x-app-api-key
    type: httpApiKey
    description: >-
      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.
    in: header
    extensions: []
  - id: jwt
    name: jwt
    type: http
    description: >-
      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.
    scheme: bearer
    bearerFormat: JWT
    extensions: []

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.