# Code generated by asyncapi bundle from api.yml. DO NOT EDIT.
asyncapi: 3.0.0
id: urn:udx:public-websocket
info:
  title: WebSocket API
  version: '2026-08-11'
  description: >-
    The versioned public WebSocket contract for live UDX market data. Clients
    authenticate and negotiate `udx.json.2026-08-11` during the HTTP Upgrade,
    then exchange the JSON messages defined here. This version supports
    authenticated public L2 order books only; L1, L3, and private account
    channels are not part of this closed contract. Every concept and identifier
    on the wire belongs to the UDX public model.
  tags:
    - name: Market Data
      description: Live public order book subscriptions and recovery.
defaultContentType: application/json
servers:
  uat:
    host: api.uat.udx.underdogsports.com
    protocol: wss
    title: UDX UAT WebSocket
    summary: Secure WebSocket endpoint for client development and acceptance testing.
    security:
      - type: httpApiKey
        in: header
        name: UDX-Access-Key
        description: >-
          API key signature over `timestamp + "GET" + "/ws"`. The channel
          binding lists the required upgrade headers.
  production:
    host: api.udx.underdogsports.com
    protocol: wss
    title: UDX Production WebSocket
    summary: Secure WebSocket endpoint for production trading.
    security:
      - type: httpApiKey
        in: header
        name: UDX-Access-Key
        description: >-
          API key signature over `timestamp + "GET" + "/ws"`. The channel
          binding lists the required upgrade headers.
channels:
  publicWebSocket:
    address: /ws
    title: Public WebSocket Session
    summary: One authenticated, bidirectional UDX WebSocket session.
    description: >-
      Commands and server messages share one ordered WebSocket connection.
      Subscription IDs and sequence numbers exist only for the lifetime of that
      connection. A disconnected session cannot be resumed: reconnect,
      authenticate again, create new subscriptions, and rebuild each book from
      its new initial snapshot.
    x-udx-session-resumption:
      supported: false
      reconnectBehavior: >-
        Re-authenticate, resubscribe, and replace local state from fresh
        snapshots.
    x-udx-close-codes:
      '1000': Normal closure; reconnect only when another session is needed.
      '1001': Session lifetime or idle bound expired; reconnect and resubscribe.
      '1002': WebSocket protocol error; fix the client before reconnecting.
      '1003': Unsupported application data; send JSON text messages.
      '1007': Invalid UTF-8; fix the client before reconnecting.
      '1008': Repeated invalid or abusive input; back off and fix the client.
      '1009': Frame too large; send a smaller command.
      '1011': Unexpected server failure; reconnect with backoff and fresh snapshots.
      '1012': Service restart or drain; reconnect with backoff and resubscribe.
      '1013': >-
        Temporary service or admission failure; reconnect with backoff and fresh
        snapshots.
      '4001': Authorization revoked; re-authenticate before reconnecting.
      '4003': >-
        Slow consumer or outbound memory bound; repair consumption and reconnect
        from fresh snapshots. This close frame is best effort, so an abnormal
        close is equivalent.
    servers:
      - $ref: '#/servers/uat'
      - $ref: '#/servers/production'
    bindings:
      ws:
        method: GET
        headers:
          type: object
          additionalProperties: true
          description: Headers required for authentication and version negotiation.
          required:
            - UDX-Access-Key
            - UDX-Access-Timestamp
            - UDX-Access-Signature
            - Sec-WebSocket-Protocol
          properties:
            UDX-Access-Key:
              type: string
              minLength: 1
              maxLength: 255
              description: Opaque API key ID.
            UDX-Access-Timestamp:
              type: string
              pattern: ^[0-9]{13}$
              maxLength: 13
              description: Unix time in milliseconds.
            UDX-Access-Signature:
              type: string
              minLength: 1
              maxLength: 1024
              description: Base64 RSA-PSS/SHA-256 signature.
            Sec-WebSocket-Protocol:
              type: string
              const: udx.json.2026-08-11
              description: Negotiated dated WebSocket API version.
    messages:
      SubscribeCommand:
        name: SubscribeCommand
        title: Subscribe Command
        summary: Subscribe to L2 order book market data.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: >-
            Command that atomically creates one independent L2 order book
            subscription per requested ticker.
          required:
            - id
            - cmd
            - params
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            cmd:
              type: string
              const: subscribe
              description: Selects the subscribe command.
            params:
              type: object
              additionalProperties: false
              description: >-
                Markets and common L2 view requested for independent
                subscriptions. Any ticker in the caller-visible public market
                catalog is subscribable regardless of market status. Lifecycle
                transitions do not end the subscription; removal from that
                catalog does.
              required:
                - channels
                - tickers
              properties:
                channels:
                  type: array
                  minItems: 1
                  maxItems: 1
                  uniqueItems: true
                  description: The initial protocol supports only the order book channel.
                  items:
                    type: string
                    const: orderbook
                    description: Aggregated L2 order book market data.
                tickers:
                  type: array
                  minItems: 1
                  maxItems: 250
                  uniqueItems: true
                  description: >-
                    A canonical non-empty list of distinct market tickers. The
                    protocol ceiling is 250; an operational profile may impose a
                    lower limit.
                  items:
                    type: string
                    minLength: 1
                    maxLength: 128
                    description: A market's public ticker.
                level:
                  type: string
                  const: L2
                  default: L2
                  description: >-
                    Aggregated market-by-price depth. Later protocol versions
                    may add L1 or entitled L3 without changing this version's
                    closed schema.
                depth:
                  type: integer
                  minimum: 1
                  maximum: 25
                  default: 25
                  description: Maximum visible levels per side; omission requests 25.
        examples:
          - name: SubscribeToTwoMarkets
            summary: Subscribe to two order books
            payload:
              id: 1
              cmd: subscribe
              params:
                channels:
                  - orderbook
                tickers:
                  - UDX-EXAMPLE-MARKET-A
                  - UDX-EXAMPLE-MARKET-B
                level: L2
                depth: 10
      UnsubscribeCommand:
        name: UnsubscribeCommand
        title: Unsubscribe Command
        summary: End one or more subscriptions on this connection.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: Command that atomically ends subscriptions on this connection.
          required:
            - id
            - cmd
            - params
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            cmd:
              type: string
              const: unsubscribe
              description: Selects the unsubscribe command.
            params:
              type: object
              additionalProperties: false
              description: Identifies the subscriptions to end as a canonical array.
              required:
                - sids
              properties:
                sids:
                  type: array
                  minItems: 1
                  maxItems: 250
                  uniqueItems: true
                  description: >-
                    Canonical non-empty list of distinct subscription IDs. It
                    remains an array when one subscription is targeted.
                  items:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 9007199254740991
                    description: >-
                      Opaque server-assigned subscription ID whose lifetime is
                      this WebSocket connection.
        examples:
          - name: UnsubscribeOrderbooks
            summary: End subscriptions 7 and 8
            payload:
              id: 2
              cmd: unsubscribe
              params:
                sids:
                  - 7
                  - 8
      SnapshotCommand:
        name: SnapshotCommand
        title: Snapshot Command
        summary: Request fresh snapshots for existing order book subscriptions.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: Command that requests fresh state without changing subscriptions.
          required:
            - id
            - cmd
            - params
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            cmd:
              type: string
              const: snapshot
              description: Selects the snapshot command.
            params:
              type: object
              additionalProperties: false
              description: Selects order book subscriptions as a canonical array.
              required:
                - sids
              properties:
                sids:
                  type: array
                  minItems: 1
                  maxItems: 250
                  uniqueItems: true
                  description: >-
                    Canonical non-empty list of distinct subscription IDs. It
                    remains an array when one subscription is targeted.
                  items:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 9007199254740991
                    description: >-
                      Opaque server-assigned subscription ID whose lifetime is
                      this WebSocket connection.
        examples:
          - name: SnapshotSubscriptions
            summary: Snapshot subscriptions 7 and 8
            payload:
              id: 3
              cmd: snapshot
              params:
                sids:
                  - 7
                  - 8
      Subscribed:
        name: Subscribed
        title: Subscribed Acknowledgement
        summary: Confirm that an atomic subscription was committed.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: Successful subscribe response with normalized effective settings.
          required:
            - id
            - type
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: subscribed
              description: Identifies a successful subscribe response.
            msg:
              type: object
              additionalProperties: false
              description: Normalized settings committed for the subscription batch.
              required:
                - channel
                - subscriptions
                - level
                - depth
              properties:
                channel:
                  type: string
                  const: orderbook
                  description: The committed market data channel.
                subscriptions:
                  type: array
                  minItems: 1
                  maxItems: 250
                  uniqueItems: true
                  description: >-
                    Canonical non-empty list of independent subscriptions in
                    request order. It remains an array when one subscription is
                    returned.
                  items:
                    type: object
                    additionalProperties: false
                    description: One independent one-ticker order book subscription.
                    required:
                      - sid
                      - ticker
                    properties:
                      sid:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 9007199254740991
                        description: >-
                          Opaque server-assigned subscription ID whose lifetime
                          is this WebSocket connection.
                      ticker:
                        type: string
                        minLength: 1
                        maxLength: 128
                        description: A market's public ticker.
                level:
                  type: string
                  const: L2
                  default: L2
                  description: >-
                    Aggregated market-by-price depth. Later protocol versions
                    may add L1 or entitled L3 without changing this version's
                    closed schema.
                depth:
                  type: integer
                  minimum: 1
                  maximum: 25
                  default: 25
                  description: Maximum visible levels per side; omission requests 25.
            rate_limit:
              allOf:
                - type: object
                  additionalProperties: false
                  description: >-
                    Member bucket state returned by the same atomic decision
                    that admitted or rejected the command. Streaming market data
                    never carries it.
                  required:
                    - bucket
                    - capacity
                    - refill_tokens_per_minute
                    - remaining
                    - full_after_ms
                  properties:
                    bucket:
                      type: string
                      enum:
                        - read
                        - write
                        - cancel
                      description: Shared member bucket consulted for this command.
                    capacity:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Maximum tokens held by the bucket.
                    refill_tokens_per_minute:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Tokens restored per minute.
                    remaining:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 10000000
                      description: Tokens remaining after the atomic decision.
                    full_after_ms:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 86400000
                      description: >-
                        Milliseconds until the bucket is full if no more work is
                        admitted.
              description: >-
                Present for a newly admitted charged batch. An exact duplicate
                subscribe response omits it because no tokens were spent.
        examples:
          - name: TwoMarketsSubscribed
            summary: Independent subscriptions committed atomically
            payload:
              id: 1
              type: subscribed
              msg:
                channel: orderbook
                subscriptions:
                  - sid: 7
                    ticker: UDX-EXAMPLE-MARKET-A
                  - sid: 8
                    ticker: UDX-EXAMPLE-MARKET-B
                level: L2
                depth: 10
              rate_limit:
                bucket: read
                capacity: 30
                refill_tokens_per_minute: 900
                remaining: 27
                full_after_ms: 200
      Unsubscribed:
        name: Unsubscribed
        title: Unsubscribed Acknowledgement
        summary: Confirm that one or more subscriptions ended atomically.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: Successful batched unsubscribe and terminal barrier.
          required:
            - id
            - type
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: unsubscribed
              description: Identifies a successful unsubscribe response.
            msg:
              type: object
              additionalProperties: false
              description: Subscriptions ended atomically in request order.
              required:
                - subscriptions
              properties:
                subscriptions:
                  type: array
                  minItems: 1
                  maxItems: 250
                  uniqueItems: true
                  description: >-
                    Canonical non-empty list of independent subscriptions in
                    request order. It remains an array when one subscription is
                    returned.
                  items:
                    type: object
                    additionalProperties: false
                    description: One independent one-ticker order book subscription.
                    required:
                      - sid
                      - ticker
                    properties:
                      sid:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 9007199254740991
                        description: >-
                          Opaque server-assigned subscription ID whose lifetime
                          is this WebSocket connection.
                      ticker:
                        type: string
                        minLength: 1
                        maxLength: 128
                        description: A market's public ticker.
        examples:
          - name: SubscriptionsEnded
            summary: Subscriptions 7 and 8 ended
            payload:
              id: 2
              type: unsubscribed
              msg:
                subscriptions:
                  - sid: 7
                    ticker: UDX-EXAMPLE-MARKET-A
                  - sid: 8
                    ticker: UDX-EXAMPLE-MARKET-B
      InitialOrderbookSnapshot:
        name: InitialOrderbookSnapshot
        title: Order Book Snapshot
        summary: Establish current book state for one ticker without a command ID.
        payload:
          type: object
          additionalProperties: false
          description: >-
            Initial or server-recovery snapshot. Its lack of `id` distinguishes
            it from the finite response to a client snapshot command.
          required:
            - type
            - sid
            - seq
            - msg
          properties:
            type:
              type: string
              const: orderbook_snapshot
              description: Identifies a complete order book snapshot.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            seq:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Gap-detection sequence local to one-ticker subscription. It
                starts at 1 and increments once for every snapshot or update.
            msg:
              type: object
              additionalProperties: false
              description: Complete visible L2 order book state for one market.
              required:
                - ticker
                - bids
                - asks
              properties:
                ticker:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
                bids:
                  type: array
                  maxItems: 25
                  description: Bid levels in best-first order as `[price, quantity]` pairs.
                  items:
                    type: array
                    minItems: 2
                    maxItems: 2
                    description: A `[price, quantity]` pair of exact decimal strings.
                    prefixItems:
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,6})?$
                        maxLength: 24
                        description: >-
                          YES-side price in dollars as an exact fixed-point
                          decimal string with at most six decimal places.
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,2})?$
                        maxLength: 24
                        description: >-
                          Contract quantity as an exact fixed-point decimal
                          string with at most two decimal places. Zero removes
                          an updated price level.
                    items: false
                asks:
                  type: array
                  maxItems: 25
                  description: Ask levels in best-first order as `[price, quantity]` pairs.
                  items:
                    type: array
                    minItems: 2
                    maxItems: 2
                    description: A `[price, quantity]` pair of exact decimal strings.
                    prefixItems:
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,6})?$
                        maxLength: 24
                        description: >-
                          YES-side price in dollars as an exact fixed-point
                          decimal string with at most six decimal places.
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,2})?$
                        maxLength: 24
                        description: >-
                          Contract quantity as an exact fixed-point decimal
                          string with at most two decimal places. Zero removes
                          an updated price level.
                    items: false
        examples:
          - name: InitialOrderbookState
            summary: Initial book state
            payload:
              type: orderbook_snapshot
              sid: 7
              seq: 1
              msg:
                ticker: UDX-EXAMPLE-MARKET-A
                bids:
                  - - '0.45'
                    - '100'
                asks:
                  - - '0.47'
                    - '80'
      RequestedOrderbookSnapshot:
        name: RequestedOrderbookSnapshot
        title: Requested Order Book Snapshot
        summary: Return one snapshot correlated to a snapshot command.
        correlationId:
          description: >-
            The positive client-assigned command ID echoed by every correlated
            response. It is not a resource identifier or idempotency key.
          location: $message.payload#/id
        payload:
          type: object
          additionalProperties: false
          description: >-
            One correlated result in a snapshot command's finite response
            series.
          required:
            - id
            - type
            - sid
            - seq
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: orderbook_snapshot
              description: Identifies a complete order book snapshot.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            seq:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Gap-detection sequence local to one-ticker subscription. It
                starts at 1 and increments once for every snapshot or update.
            msg:
              type: object
              additionalProperties: false
              description: Complete visible L2 order book state for one market.
              required:
                - ticker
                - bids
                - asks
              properties:
                ticker:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
                bids:
                  type: array
                  maxItems: 25
                  description: Bid levels in best-first order as `[price, quantity]` pairs.
                  items:
                    type: array
                    minItems: 2
                    maxItems: 2
                    description: A `[price, quantity]` pair of exact decimal strings.
                    prefixItems:
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,6})?$
                        maxLength: 24
                        description: >-
                          YES-side price in dollars as an exact fixed-point
                          decimal string with at most six decimal places.
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,2})?$
                        maxLength: 24
                        description: >-
                          Contract quantity as an exact fixed-point decimal
                          string with at most two decimal places. Zero removes
                          an updated price level.
                    items: false
                asks:
                  type: array
                  maxItems: 25
                  description: Ask levels in best-first order as `[price, quantity]` pairs.
                  items:
                    type: array
                    minItems: 2
                    maxItems: 2
                    description: A `[price, quantity]` pair of exact decimal strings.
                    prefixItems:
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,6})?$
                        maxLength: 24
                        description: >-
                          YES-side price in dollars as an exact fixed-point
                          decimal string with at most six decimal places.
                      - type: string
                        pattern: ^[0-9]+(\.[0-9]{1,2})?$
                        maxLength: 24
                        description: >-
                          Contract quantity as an exact fixed-point decimal
                          string with at most two decimal places. Zero removes
                          an updated price level.
                    items: false
            rate_limit:
              allOf:
                - type: object
                  additionalProperties: false
                  description: >-
                    Member bucket state returned by the same atomic decision
                    that admitted or rejected the command. Streaming market data
                    never carries it.
                  required:
                    - bucket
                    - capacity
                    - refill_tokens_per_minute
                    - remaining
                    - full_after_ms
                  properties:
                    bucket:
                      type: string
                      enum:
                        - read
                        - write
                        - cancel
                      description: Shared member bucket consulted for this command.
                    capacity:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Maximum tokens held by the bucket.
                    refill_tokens_per_minute:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Tokens restored per minute.
                    remaining:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 10000000
                      description: Tokens remaining after the atomic decision.
                    full_after_ms:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 86400000
                      description: >-
                        Milliseconds until the bucket is full if no more work is
                        admitted.
              description: >-
                Present only on the first snapshot in this command's finite
                result series; later snapshots from the same command omit it.
        examples:
          - name: RequestedOrderbookState
            summary: Snapshot command result
            payload:
              id: 3
              type: orderbook_snapshot
              sid: 7
              seq: 18
              msg:
                ticker: UDX-EXAMPLE-MARKET-A
                bids:
                  - - '0.45'
                    - '100'
                asks:
                  - - '0.47'
                    - '80'
              rate_limit:
                bucket: read
                capacity: 30
                refill_tokens_per_minute: 900
                remaining: 9
                full_after_ms: 1400
      OrderbookUpdate:
        name: OrderbookUpdate
        title: Order Book Update
        summary: Replace one or more visible price-level quantities for one ticker.
        payload:
          type: object
          additionalProperties: false
          description: Sequenced absolute L2 changes for exactly one market.
          required:
            - type
            - sid
            - seq
            - msg
          properties:
            type:
              type: string
              const: orderbook_update
              description: Identifies an incremental order book update.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            seq:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Gap-detection sequence local to one-ticker subscription. It
                starts at 1 and increments once for every snapshot or update.
            msg:
              type: object
              additionalProperties: false
              description: One market's complete visible transition between book states.
              required:
                - ticker
                - changes
              properties:
                ticker:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
                changes:
                  type: array
                  minItems: 1
                  maxItems: 100
                  description: >-
                    Absolute price-level replacements applied atomically. Array
                    order has no meaning; a zero quantity removes the level.
                  items:
                    type: object
                    additionalProperties: false
                    description: >-
                      Absolute replacement quantity for one YES-side price
                      level.
                    required:
                      - side
                      - price
                      - quantity
                    properties:
                      side:
                        type: string
                        enum:
                          - buy
                          - sell
                        description: >-
                          `buy` is bid liquidity and `sell` is ask liquidity,
                          both for YES.
                      price:
                        type: string
                        pattern: ^[0-9]+(\.[0-9]{1,6})?$
                        maxLength: 24
                        description: >-
                          YES-side price in dollars as an exact fixed-point
                          decimal string with at most six decimal places.
                      quantity:
                        type: string
                        pattern: ^[0-9]+(\.[0-9]{1,2})?$
                        maxLength: 24
                        description: >-
                          Contract quantity as an exact fixed-point decimal
                          string with at most two decimal places. Zero removes
                          an updated price level.
        examples:
          - name: ReplaceAndRemoveLevels
            summary: Replace and remove levels
            payload:
              type: orderbook_update
              sid: 7
              seq: 2
              msg:
                ticker: UDX-EXAMPLE-MARKET-A
                changes:
                  - side: buy
                    price: '0.45'
                    quantity: '125'
                  - side: sell
                    price: '0.47'
                    quantity: '0'
      CommandError:
        name: CommandError
        title: Command Error
        summary: Reject one command while leaving the connection usable.
        payload:
          oneOf:
            - type: object
              additionalProperties: false
              description: Invalid-message error; ID is omitted if it was not trustworthy.
              required:
                - type
                - msg
              properties:
                id:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Client-assigned command correlation ID, unique among
                    commands in flight on this connection.
                type:
                  type: string
                  const: error
                  description: Identifies a rejected command.
                msg:
                  type: object
                  additionalProperties: false
                  description: The JSON or common command envelope is invalid.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: invalid_message
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    field:
                      type: string
                      minLength: 1
                      maxLength: 255
                      description: >-
                        JSON path to the invalid field when one can be
                        identified.
            - type: object
              additionalProperties: false
              description: Rejected command correlated by its trustworthy client ID.
              required:
                - id
                - type
                - msg
              properties:
                id:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Client-assigned command correlation ID, unique among
                    commands in flight on this connection.
                type:
                  type: string
                  const: error
                  description: Identifies a rejected command.
                sid:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Opaque server-assigned subscription ID whose lifetime is
                    this WebSocket connection.
                msg:
                  oneOf:
                    - type: object
                      additionalProperties: false
                      description: >-
                        The command is unsupported by the negotiated protocol
                        version.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: unknown_command
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: Command params fail schema or semantic validation.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: invalid_params
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                        field:
                          type: string
                          minLength: 1
                          maxLength: 255
                          description: >-
                            JSON path to the invalid param when one can be
                            identified.
                    - type: object
                      additionalProperties: false
                      description: Another command with the supplied ID is still in flight.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: command_id_in_use
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: >-
                        The ticker is absent from the caller-visible market
                        catalog.
                      required:
                        - code
                        - detail
                        - instance
                        - ticker
                      properties:
                        code:
                          type: string
                          const: market_not_found
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                        ticker:
                          type: string
                          minLength: 1
                          maxLength: 128
                          description: A market's public ticker.
                    - type: object
                      additionalProperties: false
                      description: The caller lacks required access.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: permission_denied
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: The subscription ID is not active on this connection.
                      required:
                        - code
                        - detail
                        - instance
                        - sid
                      properties:
                        code:
                          type: string
                          const: subscription_not_found
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                        sid:
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 9007199254740991
                          description: >-
                            Opaque server-assigned subscription ID whose
                            lifetime is this WebSocket connection.
                    - type: object
                      additionalProperties: false
                      description: >-
                        Current state is not yet established for the requested
                        operation.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: subscription_not_ready
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: >-
                        The subscription already has a snapshot command in
                        flight.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: snapshot_in_progress
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: A command rate limit was exceeded.
                      required:
                        - code
                        - detail
                        - instance
                        - retry_after_ms
                      properties:
                        code:
                          type: string
                          const: rate_limit_exceeded
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                        retry_after_ms:
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 86400000
                          description: >-
                            Minimum delay in milliseconds before another
                            attempt.
                    - type: object
                      additionalProperties: false
                      description: A standing-resource limit prevents command admission.
                      required:
                        - code
                        - detail
                        - instance
                        - scope
                        - resource
                        - limit
                      properties:
                        code:
                          type: string
                          const: capacity_exceeded
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                        scope:
                          type: string
                          enum:
                            - connection
                            - member
                            - process
                          description: >-
                            Boundary at which the standing-resource limit
                            applies.
                        resource:
                          type: string
                          enum:
                            - in_flight_commands
                            - active_subscriptions
                            - market_data_streams
                          description: >-
                            Retained or concurrent resource that reached its
                            limit.
                        limit:
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 10000000
                          description: >-
                            Enforced maximum for the identified scope and
                            resource.
                    - type: object
                      additionalProperties: false
                      description: >-
                        Shared admission policy or state is temporarily
                        unavailable.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: admission_unavailable
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: >-
                        Current market data needed by the operation is
                        unavailable.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: market_data_unavailable
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                    - type: object
                      additionalProperties: false
                      description: >-
                        An unexpected failure left connection state safe to
                        continue.
                      required:
                        - code
                        - detail
                        - instance
                      properties:
                        code:
                          type: string
                          const: internal_error
                          description: Stable machine-readable error code.
                        detail:
                          type: string
                          minLength: 1
                          maxLength: 500
                          description: >-
                            Human-readable occurrence detail that clients must
                            not parse.
                        instance:
                          type: string
                          format: uri-reference
                          pattern: >-
                            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                          maxLength: 100
                          description: Request ID for troubleshooting with UDX support.
                  description: >-
                    Closed set of command errors that may optionally identify a
                    sid.
                rate_limit:
                  allOf:
                    - type: object
                      additionalProperties: false
                      description: >-
                        Member bucket state returned by the same atomic decision
                        that admitted or rejected the command. Streaming market
                        data never carries it.
                      required:
                        - bucket
                        - capacity
                        - refill_tokens_per_minute
                        - remaining
                        - full_after_ms
                      properties:
                        bucket:
                          type: string
                          enum:
                            - read
                            - write
                            - cancel
                          description: Shared member bucket consulted for this command.
                        capacity:
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 10000000
                          description: Maximum tokens held by the bucket.
                        refill_tokens_per_minute:
                          type: integer
                          format: int64
                          minimum: 1
                          maximum: 10000000
                          description: Tokens restored per minute.
                        remaining:
                          type: integer
                          format: int64
                          minimum: 0
                          maximum: 10000000
                          description: Tokens remaining after the atomic decision.
                        full_after_ms:
                          type: integer
                          format: int64
                          minimum: 0
                          maximum: 86400000
                          description: >-
                            Milliseconds until the bucket is full if no more
                            work is admitted.
                  description: >-
                    Present on `rate_limit_exceeded` and omitted for uncharged
                    command failures, capacity failures, and unavailable
                    admission.
            - type: object
              additionalProperties: false
              description: >-
                Rejected subscribe command identifying the conflicting
                subscription.
              required:
                - id
                - type
                - sid
                - msg
              properties:
                id:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Client-assigned command correlation ID, unique among
                    commands in flight on this connection.
                type:
                  type: string
                  const: error
                  description: Identifies a rejected command.
                sid:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Opaque server-assigned subscription ID whose lifetime is
                    this WebSocket connection.
                msg:
                  type: object
                  additionalProperties: false
                  description: The ticker already belongs to the identified subscription.
                  required:
                    - code
                    - detail
                    - instance
                    - ticker
                  properties:
                    code:
                      type: string
                      const: subscription_conflict
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    ticker:
                      type: string
                      minLength: 1
                      maxLength: 128
                      description: A market's public ticker.
          description: Complete closed union of command-error message envelopes.
        examples:
          - name: ConflictingSubscription
            summary: Ticker already subscribed
            payload:
              id: 4
              type: error
              sid: 7
              msg:
                code: subscription_conflict
                detail: UDX-EXAMPLE-MARKET-A is already subscribed on sid 7
                instance: urn:request-id:8f14e45f-ceea-4abc-a743-e89a34d3f6ef
                ticker: UDX-EXAMPLE-MARKET-A
      SubscriptionError:
        name: SubscriptionError
        title: Subscription Error
        summary: End one subscription while leaving the connection usable.
        payload:
          type: object
          additionalProperties: false
          description: >-
            Terminal failure for one subscription; it carries no ID or sequence.
            Removal from the caller-visible catalog uses `permission_denied`;
            inability to re-prove visibility within its lease uses
            `market_data_unavailable`.
          required:
            - type
            - sid
            - msg
          properties:
            type:
              type: string
              const: subscription_error
              description: Identifies a terminal subscription failure.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            msg:
              oneOf:
                - type: object
                  additionalProperties: false
                  description: The caller lacks required access.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: permission_denied
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: Current market data needed by the operation is unavailable.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: market_data_unavailable
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: >-
                    An unexpected failure left connection state safe to
                    continue.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: internal_error
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
              description: Closed set of terminal failures for an order book subscription.
        examples:
          - name: MarketDataUnavailable
            summary: Upstream data unavailable
            payload:
              type: subscription_error
              sid: 7
              msg:
                code: market_data_unavailable
                detail: Current market data is unavailable for this subscription
                instance: urn:request-id:4ecbe594-50fa-4b7a-950f-5ed74bb8372d
operations:
  receiveSubscribeCommand:
    action: receive
    title: Subscribe to Order Book Updates
    summary: Atomically create one independent subscription per requested market.
    tags:
      - name: Market Data
    description: >-
      UDX validates and reserves the complete batch before assigning one
      subscription ID per ticker. The single subscribed response contains an
      always-array subscriptions field and is enqueued before any sequenced data
      for the returned subscriptions. Each subscription becomes ready only when
      its own initial snapshot arrives. Retrying an exact batch on the same
      connection returns its existing subscription IDs without a second
      delivery; a partial overlap is rejected atomically.
    channel:
      $ref: '#/channels/publicWebSocket'
    messages:
      - $ref: '#/channels/publicWebSocket/messages/SubscribeCommand'
    x-udx-rate-limit:
      bucket: read
      baseWeight: 1
      countedItems: tickers
      itemChunkSize: 50
      weightPerChunk: 1
    reply:
      channel:
        $ref: '#/channels/publicWebSocket'
      messages:
        - $ref: '#/channels/publicWebSocket/messages/Subscribed'
        - $ref: '#/channels/publicWebSocket/messages/CommandError'
  receiveUnsubscribeCommand:
    action: receive
    title: Unsubscribe from Order Book Updates
    summary: Atomically end one or more subscriptions on the current connection.
    tags:
      - name: Market Data
    description: >-
      A successful unsubscribed response contains an always-array subscriptions
      field and is a barrier: UDX sends no later message for any returned
      subscription ID.
    channel:
      $ref: '#/channels/publicWebSocket'
    messages:
      - $ref: '#/channels/publicWebSocket/messages/UnsubscribeCommand'
    x-udx-rate-limit:
      charged: false
    reply:
      channel:
        $ref: '#/channels/publicWebSocket'
      messages:
        - $ref: '#/channels/publicWebSocket/messages/Unsubscribed'
        - $ref: '#/channels/publicWebSocket/messages/CommandError'
  receiveSnapshotCommand:
    action: receive
    title: Request Order Book Snapshots
    summary: Atomically request fresh snapshots for one or more subscriptions.
    tags:
      - name: Market Data
    description: >-
      The returned snapshots are the successful response; no intermediate
      acknowledgement is sent. UDX returns exactly one snapshot per requested
      sid in request order. Every returned snapshot echoes the command ID and
      consumes that subscription's next sequence number. After a sequence gap,
      stop applying that sid until this snapshot replaces its complete local
      state; later messages then continue from the snapshot sequence.
    channel:
      $ref: '#/channels/publicWebSocket'
    messages:
      - $ref: '#/channels/publicWebSocket/messages/SnapshotCommand'
    x-udx-rate-limit:
      bucket: read
      baseWeight: 1
      countedItems: sids
      itemChunkSize: 50
      weightPerChunk: 1
    reply:
      channel:
        $ref: '#/channels/publicWebSocket'
      messages:
        - $ref: '#/channels/publicWebSocket/messages/RequestedOrderbookSnapshot'
        - $ref: '#/channels/publicWebSocket/messages/CommandError'
  sendOrderbookData:
    action: send
    title: Stream Order Book Data
    summary: Publish snapshots, absolute level updates, and terminal errors.
    tags:
      - name: Market Data
    description: >-
      Each one-ticker subscription has its own gap-detecting sequence. A
      terminal subscription error ends only that subscription; a
      connection-fatal condition is reported with a WebSocket close frame.
      Absolute updates are idempotent and consumers deduplicate by `(sid, seq)`;
      a forward gap requires the snapshot recovery procedure above.
    channel:
      $ref: '#/channels/publicWebSocket'
    messages:
      - $ref: '#/channels/publicWebSocket/messages/InitialOrderbookSnapshot'
      - $ref: '#/channels/publicWebSocket/messages/OrderbookUpdate'
      - $ref: '#/channels/publicWebSocket/messages/SubscriptionError'
components:
  securitySchemes:
    signedApiKey:
      type: httpApiKey
      in: header
      name: UDX-Access-Key
      description: >-
        API key signature over `timestamp + "GET" + "/ws"`. The channel binding
        lists the required upgrade headers.
  correlationIds:
    commandId:
      description: >-
        The positive client-assigned command ID echoed by every correlated
        response. It is not a resource identifier or idempotency key.
      location: $message.payload#/id
  messages:
    SubscribeCommand:
      name: SubscribeCommand
      title: Subscribe Command
      summary: Subscribe to L2 order book market data.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: >-
          Command that atomically creates one independent L2 order book
          subscription per requested ticker.
        required:
          - id
          - cmd
          - params
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          cmd:
            type: string
            const: subscribe
            description: Selects the subscribe command.
          params:
            type: object
            additionalProperties: false
            description: >-
              Markets and common L2 view requested for independent
              subscriptions. Any ticker in the caller-visible public market
              catalog is subscribable regardless of market status. Lifecycle
              transitions do not end the subscription; removal from that catalog
              does.
            required:
              - channels
              - tickers
            properties:
              channels:
                type: array
                minItems: 1
                maxItems: 1
                uniqueItems: true
                description: The initial protocol supports only the order book channel.
                items:
                  type: string
                  const: orderbook
                  description: Aggregated L2 order book market data.
              tickers:
                type: array
                minItems: 1
                maxItems: 250
                uniqueItems: true
                description: >-
                  A canonical non-empty list of distinct market tickers. The
                  protocol ceiling is 250; an operational profile may impose a
                  lower limit.
                items:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
              level:
                type: string
                const: L2
                default: L2
                description: >-
                  Aggregated market-by-price depth. Later protocol versions may
                  add L1 or entitled L3 without changing this version's closed
                  schema.
              depth:
                type: integer
                minimum: 1
                maximum: 25
                default: 25
                description: Maximum visible levels per side; omission requests 25.
      examples:
        - name: SubscribeToTwoMarkets
          summary: Subscribe to two order books
          payload:
            id: 1
            cmd: subscribe
            params:
              channels:
                - orderbook
              tickers:
                - UDX-EXAMPLE-MARKET-A
                - UDX-EXAMPLE-MARKET-B
              level: L2
              depth: 10
    UnsubscribeCommand:
      name: UnsubscribeCommand
      title: Unsubscribe Command
      summary: End one or more subscriptions on this connection.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: Command that atomically ends subscriptions on this connection.
        required:
          - id
          - cmd
          - params
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          cmd:
            type: string
            const: unsubscribe
            description: Selects the unsubscribe command.
          params:
            type: object
            additionalProperties: false
            description: Identifies the subscriptions to end as a canonical array.
            required:
              - sids
            properties:
              sids:
                type: array
                minItems: 1
                maxItems: 250
                uniqueItems: true
                description: >-
                  Canonical non-empty list of distinct subscription IDs. It
                  remains an array when one subscription is targeted.
                items:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Opaque server-assigned subscription ID whose lifetime is
                    this WebSocket connection.
      examples:
        - name: UnsubscribeOrderbooks
          summary: End subscriptions 7 and 8
          payload:
            id: 2
            cmd: unsubscribe
            params:
              sids:
                - 7
                - 8
    SnapshotCommand:
      name: SnapshotCommand
      title: Snapshot Command
      summary: Request fresh snapshots for existing order book subscriptions.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: Command that requests fresh state without changing subscriptions.
        required:
          - id
          - cmd
          - params
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          cmd:
            type: string
            const: snapshot
            description: Selects the snapshot command.
          params:
            type: object
            additionalProperties: false
            description: Selects order book subscriptions as a canonical array.
            required:
              - sids
            properties:
              sids:
                type: array
                minItems: 1
                maxItems: 250
                uniqueItems: true
                description: >-
                  Canonical non-empty list of distinct subscription IDs. It
                  remains an array when one subscription is targeted.
                items:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Opaque server-assigned subscription ID whose lifetime is
                    this WebSocket connection.
      examples:
        - name: SnapshotSubscriptions
          summary: Snapshot subscriptions 7 and 8
          payload:
            id: 3
            cmd: snapshot
            params:
              sids:
                - 7
                - 8
    Subscribed:
      name: Subscribed
      title: Subscribed Acknowledgement
      summary: Confirm that an atomic subscription was committed.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: Successful subscribe response with normalized effective settings.
        required:
          - id
          - type
          - msg
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          type:
            type: string
            const: subscribed
            description: Identifies a successful subscribe response.
          msg:
            type: object
            additionalProperties: false
            description: Normalized settings committed for the subscription batch.
            required:
              - channel
              - subscriptions
              - level
              - depth
            properties:
              channel:
                type: string
                const: orderbook
                description: The committed market data channel.
              subscriptions:
                type: array
                minItems: 1
                maxItems: 250
                uniqueItems: true
                description: >-
                  Canonical non-empty list of independent subscriptions in
                  request order. It remains an array when one subscription is
                  returned.
                items:
                  type: object
                  additionalProperties: false
                  description: One independent one-ticker order book subscription.
                  required:
                    - sid
                    - ticker
                  properties:
                    sid:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Opaque server-assigned subscription ID whose lifetime is
                        this WebSocket connection.
                    ticker:
                      type: string
                      minLength: 1
                      maxLength: 128
                      description: A market's public ticker.
              level:
                type: string
                const: L2
                default: L2
                description: >-
                  Aggregated market-by-price depth. Later protocol versions may
                  add L1 or entitled L3 without changing this version's closed
                  schema.
              depth:
                type: integer
                minimum: 1
                maximum: 25
                default: 25
                description: Maximum visible levels per side; omission requests 25.
          rate_limit:
            allOf:
              - type: object
                additionalProperties: false
                description: >-
                  Member bucket state returned by the same atomic decision that
                  admitted or rejected the command. Streaming market data never
                  carries it.
                required:
                  - bucket
                  - capacity
                  - refill_tokens_per_minute
                  - remaining
                  - full_after_ms
                properties:
                  bucket:
                    type: string
                    enum:
                      - read
                      - write
                      - cancel
                    description: Shared member bucket consulted for this command.
                  capacity:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 10000000
                    description: Maximum tokens held by the bucket.
                  refill_tokens_per_minute:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 10000000
                    description: Tokens restored per minute.
                  remaining:
                    type: integer
                    format: int64
                    minimum: 0
                    maximum: 10000000
                    description: Tokens remaining after the atomic decision.
                  full_after_ms:
                    type: integer
                    format: int64
                    minimum: 0
                    maximum: 86400000
                    description: >-
                      Milliseconds until the bucket is full if no more work is
                      admitted.
            description: >-
              Present for a newly admitted charged batch. An exact duplicate
              subscribe response omits it because no tokens were spent.
      examples:
        - name: TwoMarketsSubscribed
          summary: Independent subscriptions committed atomically
          payload:
            id: 1
            type: subscribed
            msg:
              channel: orderbook
              subscriptions:
                - sid: 7
                  ticker: UDX-EXAMPLE-MARKET-A
                - sid: 8
                  ticker: UDX-EXAMPLE-MARKET-B
              level: L2
              depth: 10
            rate_limit:
              bucket: read
              capacity: 30
              refill_tokens_per_minute: 900
              remaining: 27
              full_after_ms: 200
    Unsubscribed:
      name: Unsubscribed
      title: Unsubscribed Acknowledgement
      summary: Confirm that one or more subscriptions ended atomically.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: Successful batched unsubscribe and terminal barrier.
        required:
          - id
          - type
          - msg
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          type:
            type: string
            const: unsubscribed
            description: Identifies a successful unsubscribe response.
          msg:
            type: object
            additionalProperties: false
            description: Subscriptions ended atomically in request order.
            required:
              - subscriptions
            properties:
              subscriptions:
                type: array
                minItems: 1
                maxItems: 250
                uniqueItems: true
                description: >-
                  Canonical non-empty list of independent subscriptions in
                  request order. It remains an array when one subscription is
                  returned.
                items:
                  type: object
                  additionalProperties: false
                  description: One independent one-ticker order book subscription.
                  required:
                    - sid
                    - ticker
                  properties:
                    sid:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Opaque server-assigned subscription ID whose lifetime is
                        this WebSocket connection.
                    ticker:
                      type: string
                      minLength: 1
                      maxLength: 128
                      description: A market's public ticker.
      examples:
        - name: SubscriptionsEnded
          summary: Subscriptions 7 and 8 ended
          payload:
            id: 2
            type: unsubscribed
            msg:
              subscriptions:
                - sid: 7
                  ticker: UDX-EXAMPLE-MARKET-A
                - sid: 8
                  ticker: UDX-EXAMPLE-MARKET-B
    InitialOrderbookSnapshot:
      name: InitialOrderbookSnapshot
      title: Order Book Snapshot
      summary: Establish current book state for one ticker without a command ID.
      payload:
        type: object
        additionalProperties: false
        description: >-
          Initial or server-recovery snapshot. Its lack of `id` distinguishes it
          from the finite response to a client snapshot command.
        required:
          - type
          - sid
          - seq
          - msg
        properties:
          type:
            type: string
            const: orderbook_snapshot
            description: Identifies a complete order book snapshot.
          sid:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
          seq:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Gap-detection sequence local to one-ticker subscription. It starts
              at 1 and increments once for every snapshot or update.
          msg:
            type: object
            additionalProperties: false
            description: Complete visible L2 order book state for one market.
            required:
              - ticker
              - bids
              - asks
            properties:
              ticker:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
              bids:
                type: array
                maxItems: 25
                description: Bid levels in best-first order as `[price, quantity]` pairs.
                items:
                  type: array
                  minItems: 2
                  maxItems: 2
                  description: A `[price, quantity]` pair of exact decimal strings.
                  prefixItems:
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,6})?$
                      maxLength: 24
                      description: >-
                        YES-side price in dollars as an exact fixed-point
                        decimal string with at most six decimal places.
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,2})?$
                      maxLength: 24
                      description: >-
                        Contract quantity as an exact fixed-point decimal string
                        with at most two decimal places. Zero removes an updated
                        price level.
                  items: false
              asks:
                type: array
                maxItems: 25
                description: Ask levels in best-first order as `[price, quantity]` pairs.
                items:
                  type: array
                  minItems: 2
                  maxItems: 2
                  description: A `[price, quantity]` pair of exact decimal strings.
                  prefixItems:
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,6})?$
                      maxLength: 24
                      description: >-
                        YES-side price in dollars as an exact fixed-point
                        decimal string with at most six decimal places.
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,2})?$
                      maxLength: 24
                      description: >-
                        Contract quantity as an exact fixed-point decimal string
                        with at most two decimal places. Zero removes an updated
                        price level.
                  items: false
      examples:
        - name: InitialOrderbookState
          summary: Initial book state
          payload:
            type: orderbook_snapshot
            sid: 7
            seq: 1
            msg:
              ticker: UDX-EXAMPLE-MARKET-A
              bids:
                - - '0.45'
                  - '100'
              asks:
                - - '0.47'
                  - '80'
    RequestedOrderbookSnapshot:
      name: RequestedOrderbookSnapshot
      title: Requested Order Book Snapshot
      summary: Return one snapshot correlated to a snapshot command.
      correlationId:
        description: >-
          The positive client-assigned command ID echoed by every correlated
          response. It is not a resource identifier or idempotency key.
        location: $message.payload#/id
      payload:
        type: object
        additionalProperties: false
        description: One correlated result in a snapshot command's finite response series.
        required:
          - id
          - type
          - sid
          - seq
          - msg
        properties:
          id:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Client-assigned command correlation ID, unique among commands in
              flight on this connection.
          type:
            type: string
            const: orderbook_snapshot
            description: Identifies a complete order book snapshot.
          sid:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
          seq:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Gap-detection sequence local to one-ticker subscription. It starts
              at 1 and increments once for every snapshot or update.
          msg:
            type: object
            additionalProperties: false
            description: Complete visible L2 order book state for one market.
            required:
              - ticker
              - bids
              - asks
            properties:
              ticker:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
              bids:
                type: array
                maxItems: 25
                description: Bid levels in best-first order as `[price, quantity]` pairs.
                items:
                  type: array
                  minItems: 2
                  maxItems: 2
                  description: A `[price, quantity]` pair of exact decimal strings.
                  prefixItems:
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,6})?$
                      maxLength: 24
                      description: >-
                        YES-side price in dollars as an exact fixed-point
                        decimal string with at most six decimal places.
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,2})?$
                      maxLength: 24
                      description: >-
                        Contract quantity as an exact fixed-point decimal string
                        with at most two decimal places. Zero removes an updated
                        price level.
                  items: false
              asks:
                type: array
                maxItems: 25
                description: Ask levels in best-first order as `[price, quantity]` pairs.
                items:
                  type: array
                  minItems: 2
                  maxItems: 2
                  description: A `[price, quantity]` pair of exact decimal strings.
                  prefixItems:
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,6})?$
                      maxLength: 24
                      description: >-
                        YES-side price in dollars as an exact fixed-point
                        decimal string with at most six decimal places.
                    - type: string
                      pattern: ^[0-9]+(\.[0-9]{1,2})?$
                      maxLength: 24
                      description: >-
                        Contract quantity as an exact fixed-point decimal string
                        with at most two decimal places. Zero removes an updated
                        price level.
                  items: false
          rate_limit:
            allOf:
              - type: object
                additionalProperties: false
                description: >-
                  Member bucket state returned by the same atomic decision that
                  admitted or rejected the command. Streaming market data never
                  carries it.
                required:
                  - bucket
                  - capacity
                  - refill_tokens_per_minute
                  - remaining
                  - full_after_ms
                properties:
                  bucket:
                    type: string
                    enum:
                      - read
                      - write
                      - cancel
                    description: Shared member bucket consulted for this command.
                  capacity:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 10000000
                    description: Maximum tokens held by the bucket.
                  refill_tokens_per_minute:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 10000000
                    description: Tokens restored per minute.
                  remaining:
                    type: integer
                    format: int64
                    minimum: 0
                    maximum: 10000000
                    description: Tokens remaining after the atomic decision.
                  full_after_ms:
                    type: integer
                    format: int64
                    minimum: 0
                    maximum: 86400000
                    description: >-
                      Milliseconds until the bucket is full if no more work is
                      admitted.
            description: >-
              Present only on the first snapshot in this command's finite result
              series; later snapshots from the same command omit it.
      examples:
        - name: RequestedOrderbookState
          summary: Snapshot command result
          payload:
            id: 3
            type: orderbook_snapshot
            sid: 7
            seq: 18
            msg:
              ticker: UDX-EXAMPLE-MARKET-A
              bids:
                - - '0.45'
                  - '100'
              asks:
                - - '0.47'
                  - '80'
            rate_limit:
              bucket: read
              capacity: 30
              refill_tokens_per_minute: 900
              remaining: 9
              full_after_ms: 1400
    OrderbookUpdate:
      name: OrderbookUpdate
      title: Order Book Update
      summary: Replace one or more visible price-level quantities for one ticker.
      payload:
        type: object
        additionalProperties: false
        description: Sequenced absolute L2 changes for exactly one market.
        required:
          - type
          - sid
          - seq
          - msg
        properties:
          type:
            type: string
            const: orderbook_update
            description: Identifies an incremental order book update.
          sid:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
          seq:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Gap-detection sequence local to one-ticker subscription. It starts
              at 1 and increments once for every snapshot or update.
          msg:
            type: object
            additionalProperties: false
            description: One market's complete visible transition between book states.
            required:
              - ticker
              - changes
            properties:
              ticker:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
              changes:
                type: array
                minItems: 1
                maxItems: 100
                description: >-
                  Absolute price-level replacements applied atomically. Array
                  order has no meaning; a zero quantity removes the level.
                items:
                  type: object
                  additionalProperties: false
                  description: Absolute replacement quantity for one YES-side price level.
                  required:
                    - side
                    - price
                    - quantity
                  properties:
                    side:
                      type: string
                      enum:
                        - buy
                        - sell
                      description: >-
                        `buy` is bid liquidity and `sell` is ask liquidity, both
                        for YES.
                    price:
                      type: string
                      pattern: ^[0-9]+(\.[0-9]{1,6})?$
                      maxLength: 24
                      description: >-
                        YES-side price in dollars as an exact fixed-point
                        decimal string with at most six decimal places.
                    quantity:
                      type: string
                      pattern: ^[0-9]+(\.[0-9]{1,2})?$
                      maxLength: 24
                      description: >-
                        Contract quantity as an exact fixed-point decimal string
                        with at most two decimal places. Zero removes an updated
                        price level.
      examples:
        - name: ReplaceAndRemoveLevels
          summary: Replace and remove levels
          payload:
            type: orderbook_update
            sid: 7
            seq: 2
            msg:
              ticker: UDX-EXAMPLE-MARKET-A
              changes:
                - side: buy
                  price: '0.45'
                  quantity: '125'
                - side: sell
                  price: '0.47'
                  quantity: '0'
    CommandError:
      name: CommandError
      title: Command Error
      summary: Reject one command while leaving the connection usable.
      payload:
        oneOf:
          - type: object
            additionalProperties: false
            description: Invalid-message error; ID is omitted if it was not trustworthy.
            required:
              - type
              - msg
            properties:
              id:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Client-assigned command correlation ID, unique among commands
                  in flight on this connection.
              type:
                type: string
                const: error
                description: Identifies a rejected command.
              msg:
                type: object
                additionalProperties: false
                description: The JSON or common command envelope is invalid.
                required:
                  - code
                  - detail
                  - instance
                properties:
                  code:
                    type: string
                    const: invalid_message
                    description: Stable machine-readable error code.
                  detail:
                    type: string
                    minLength: 1
                    maxLength: 500
                    description: >-
                      Human-readable occurrence detail that clients must not
                      parse.
                  instance:
                    type: string
                    format: uri-reference
                    pattern: >-
                      ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                    maxLength: 100
                    description: Request ID for troubleshooting with UDX support.
                  field:
                    type: string
                    minLength: 1
                    maxLength: 255
                    description: JSON path to the invalid field when one can be identified.
          - type: object
            additionalProperties: false
            description: Rejected command correlated by its trustworthy client ID.
            required:
              - id
              - type
              - msg
            properties:
              id:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Client-assigned command correlation ID, unique among commands
                  in flight on this connection.
              type:
                type: string
                const: error
                description: Identifies a rejected command.
              sid:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
              msg:
                oneOf:
                  - type: object
                    additionalProperties: false
                    description: >-
                      The command is unsupported by the negotiated protocol
                      version.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: unknown_command
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: Command params fail schema or semantic validation.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: invalid_params
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                      field:
                        type: string
                        minLength: 1
                        maxLength: 255
                        description: >-
                          JSON path to the invalid param when one can be
                          identified.
                  - type: object
                    additionalProperties: false
                    description: Another command with the supplied ID is still in flight.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: command_id_in_use
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: >-
                      The ticker is absent from the caller-visible market
                      catalog.
                    required:
                      - code
                      - detail
                      - instance
                      - ticker
                    properties:
                      code:
                        type: string
                        const: market_not_found
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                      ticker:
                        type: string
                        minLength: 1
                        maxLength: 128
                        description: A market's public ticker.
                  - type: object
                    additionalProperties: false
                    description: The caller lacks required access.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: permission_denied
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: The subscription ID is not active on this connection.
                    required:
                      - code
                      - detail
                      - instance
                      - sid
                    properties:
                      code:
                        type: string
                        const: subscription_not_found
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                      sid:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 9007199254740991
                        description: >-
                          Opaque server-assigned subscription ID whose lifetime
                          is this WebSocket connection.
                  - type: object
                    additionalProperties: false
                    description: >-
                      Current state is not yet established for the requested
                      operation.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: subscription_not_ready
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: The subscription already has a snapshot command in flight.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: snapshot_in_progress
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: A command rate limit was exceeded.
                    required:
                      - code
                      - detail
                      - instance
                      - retry_after_ms
                    properties:
                      code:
                        type: string
                        const: rate_limit_exceeded
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                      retry_after_ms:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 86400000
                        description: Minimum delay in milliseconds before another attempt.
                  - type: object
                    additionalProperties: false
                    description: A standing-resource limit prevents command admission.
                    required:
                      - code
                      - detail
                      - instance
                      - scope
                      - resource
                      - limit
                    properties:
                      code:
                        type: string
                        const: capacity_exceeded
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                      scope:
                        type: string
                        enum:
                          - connection
                          - member
                          - process
                        description: Boundary at which the standing-resource limit applies.
                      resource:
                        type: string
                        enum:
                          - in_flight_commands
                          - active_subscriptions
                          - market_data_streams
                        description: >-
                          Retained or concurrent resource that reached its
                          limit.
                      limit:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 10000000
                        description: >-
                          Enforced maximum for the identified scope and
                          resource.
                  - type: object
                    additionalProperties: false
                    description: >-
                      Shared admission policy or state is temporarily
                      unavailable.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: admission_unavailable
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: >-
                      Current market data needed by the operation is
                      unavailable.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: market_data_unavailable
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                  - type: object
                    additionalProperties: false
                    description: >-
                      An unexpected failure left connection state safe to
                      continue.
                    required:
                      - code
                      - detail
                      - instance
                    properties:
                      code:
                        type: string
                        const: internal_error
                        description: Stable machine-readable error code.
                      detail:
                        type: string
                        minLength: 1
                        maxLength: 500
                        description: >-
                          Human-readable occurrence detail that clients must not
                          parse.
                      instance:
                        type: string
                        format: uri-reference
                        pattern: >-
                          ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                        maxLength: 100
                        description: Request ID for troubleshooting with UDX support.
                description: >-
                  Closed set of command errors that may optionally identify a
                  sid.
              rate_limit:
                allOf:
                  - type: object
                    additionalProperties: false
                    description: >-
                      Member bucket state returned by the same atomic decision
                      that admitted or rejected the command. Streaming market
                      data never carries it.
                    required:
                      - bucket
                      - capacity
                      - refill_tokens_per_minute
                      - remaining
                      - full_after_ms
                    properties:
                      bucket:
                        type: string
                        enum:
                          - read
                          - write
                          - cancel
                        description: Shared member bucket consulted for this command.
                      capacity:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 10000000
                        description: Maximum tokens held by the bucket.
                      refill_tokens_per_minute:
                        type: integer
                        format: int64
                        minimum: 1
                        maximum: 10000000
                        description: Tokens restored per minute.
                      remaining:
                        type: integer
                        format: int64
                        minimum: 0
                        maximum: 10000000
                        description: Tokens remaining after the atomic decision.
                      full_after_ms:
                        type: integer
                        format: int64
                        minimum: 0
                        maximum: 86400000
                        description: >-
                          Milliseconds until the bucket is full if no more work
                          is admitted.
                description: >-
                  Present on `rate_limit_exceeded` and omitted for uncharged
                  command failures, capacity failures, and unavailable
                  admission.
          - type: object
            additionalProperties: false
            description: >-
              Rejected subscribe command identifying the conflicting
              subscription.
            required:
              - id
              - type
              - sid
              - msg
            properties:
              id:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Client-assigned command correlation ID, unique among commands
                  in flight on this connection.
              type:
                type: string
                const: error
                description: Identifies a rejected command.
              sid:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
              msg:
                type: object
                additionalProperties: false
                description: The ticker already belongs to the identified subscription.
                required:
                  - code
                  - detail
                  - instance
                  - ticker
                properties:
                  code:
                    type: string
                    const: subscription_conflict
                    description: Stable machine-readable error code.
                  detail:
                    type: string
                    minLength: 1
                    maxLength: 500
                    description: >-
                      Human-readable occurrence detail that clients must not
                      parse.
                  instance:
                    type: string
                    format: uri-reference
                    pattern: >-
                      ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                    maxLength: 100
                    description: Request ID for troubleshooting with UDX support.
                  ticker:
                    type: string
                    minLength: 1
                    maxLength: 128
                    description: A market's public ticker.
        description: Complete closed union of command-error message envelopes.
      examples:
        - name: ConflictingSubscription
          summary: Ticker already subscribed
          payload:
            id: 4
            type: error
            sid: 7
            msg:
              code: subscription_conflict
              detail: UDX-EXAMPLE-MARKET-A is already subscribed on sid 7
              instance: urn:request-id:8f14e45f-ceea-4abc-a743-e89a34d3f6ef
              ticker: UDX-EXAMPLE-MARKET-A
    SubscriptionError:
      name: SubscriptionError
      title: Subscription Error
      summary: End one subscription while leaving the connection usable.
      payload:
        type: object
        additionalProperties: false
        description: >-
          Terminal failure for one subscription; it carries no ID or sequence.
          Removal from the caller-visible catalog uses `permission_denied`;
          inability to re-prove visibility within its lease uses
          `market_data_unavailable`.
        required:
          - type
          - sid
          - msg
        properties:
          type:
            type: string
            const: subscription_error
            description: Identifies a terminal subscription failure.
          sid:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
          msg:
            oneOf:
              - type: object
                additionalProperties: false
                description: The caller lacks required access.
                required:
                  - code
                  - detail
                  - instance
                properties:
                  code:
                    type: string
                    const: permission_denied
                    description: Stable machine-readable error code.
                  detail:
                    type: string
                    minLength: 1
                    maxLength: 500
                    description: >-
                      Human-readable occurrence detail that clients must not
                      parse.
                  instance:
                    type: string
                    format: uri-reference
                    pattern: >-
                      ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                    maxLength: 100
                    description: Request ID for troubleshooting with UDX support.
              - type: object
                additionalProperties: false
                description: Current market data needed by the operation is unavailable.
                required:
                  - code
                  - detail
                  - instance
                properties:
                  code:
                    type: string
                    const: market_data_unavailable
                    description: Stable machine-readable error code.
                  detail:
                    type: string
                    minLength: 1
                    maxLength: 500
                    description: >-
                      Human-readable occurrence detail that clients must not
                      parse.
                  instance:
                    type: string
                    format: uri-reference
                    pattern: >-
                      ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                    maxLength: 100
                    description: Request ID for troubleshooting with UDX support.
              - type: object
                additionalProperties: false
                description: An unexpected failure left connection state safe to continue.
                required:
                  - code
                  - detail
                  - instance
                properties:
                  code:
                    type: string
                    const: internal_error
                    description: Stable machine-readable error code.
                  detail:
                    type: string
                    minLength: 1
                    maxLength: 500
                    description: >-
                      Human-readable occurrence detail that clients must not
                      parse.
                  instance:
                    type: string
                    format: uri-reference
                    pattern: >-
                      ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                    maxLength: 100
                    description: Request ID for troubleshooting with UDX support.
            description: Closed set of terminal failures for an order book subscription.
      examples:
        - name: MarketDataUnavailable
          summary: Upstream data unavailable
          payload:
            type: subscription_error
            sid: 7
            msg:
              code: market_data_unavailable
              detail: Current market data is unavailable for this subscription
              instance: urn:request-id:4ecbe594-50fa-4b7a-950f-5ed74bb8372d
  schemas:
    WebSocketUpgradeHeaders:
      type: object
      additionalProperties: true
      description: Headers required for authentication and version negotiation.
      required:
        - UDX-Access-Key
        - UDX-Access-Timestamp
        - UDX-Access-Signature
        - Sec-WebSocket-Protocol
      properties:
        UDX-Access-Key:
          type: string
          minLength: 1
          maxLength: 255
          description: Opaque API key ID.
        UDX-Access-Timestamp:
          type: string
          pattern: ^[0-9]{13}$
          maxLength: 13
          description: Unix time in milliseconds.
        UDX-Access-Signature:
          type: string
          minLength: 1
          maxLength: 1024
          description: Base64 RSA-PSS/SHA-256 signature.
        Sec-WebSocket-Protocol:
          type: string
          const: udx.json.2026-08-11
          description: Negotiated dated WebSocket API version.
    CommandId:
      type: integer
      format: int64
      minimum: 1
      maximum: 9007199254740991
      description: >-
        Client-assigned command correlation ID, unique among commands in flight
        on this connection.
    SubscriptionId:
      type: integer
      format: int64
      minimum: 1
      maximum: 9007199254740991
      description: >-
        Opaque server-assigned subscription ID whose lifetime is this WebSocket
        connection.
    SubscriptionIdList:
      type: array
      minItems: 1
      maxItems: 250
      uniqueItems: true
      description: >-
        Canonical non-empty list of distinct subscription IDs. It remains an
        array when one subscription is targeted.
      items:
        type: integer
        format: int64
        minimum: 1
        maximum: 9007199254740991
        description: >-
          Opaque server-assigned subscription ID whose lifetime is this
          WebSocket connection.
    SequenceNumber:
      type: integer
      format: int64
      minimum: 1
      maximum: 9007199254740991
      description: >-
        Gap-detection sequence local to one-ticker subscription. It starts at 1
        and increments once for every snapshot or update.
    Ticker:
      type: string
      minLength: 1
      maxLength: 128
      description: A market's public ticker.
    TickerList:
      type: array
      minItems: 1
      maxItems: 250
      uniqueItems: true
      description: >-
        A canonical non-empty list of distinct market tickers. The protocol
        ceiling is 250; an operational profile may impose a lower limit.
      items:
        type: string
        minLength: 1
        maxLength: 128
        description: A market's public ticker.
    OrderbookSubscription:
      type: object
      additionalProperties: false
      description: One independent one-ticker order book subscription.
      required:
        - sid
        - ticker
      properties:
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        ticker:
          type: string
          minLength: 1
          maxLength: 128
          description: A market's public ticker.
    OrderbookSubscriptionList:
      type: array
      minItems: 1
      maxItems: 250
      uniqueItems: true
      description: >-
        Canonical non-empty list of independent subscriptions in request order.
        It remains an array when one subscription is returned.
      items:
        type: object
        additionalProperties: false
        description: One independent one-ticker order book subscription.
        required:
          - sid
          - ticker
        properties:
          sid:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
          ticker:
            type: string
            minLength: 1
            maxLength: 128
            description: A market's public ticker.
    RateLimitQuotaState:
      type: object
      additionalProperties: false
      description: >-
        Member bucket state returned by the same atomic decision that admitted
        or rejected the command. Streaming market data never carries it.
      required:
        - bucket
        - capacity
        - refill_tokens_per_minute
        - remaining
        - full_after_ms
      properties:
        bucket:
          type: string
          enum:
            - read
            - write
            - cancel
          description: Shared member bucket consulted for this command.
        capacity:
          type: integer
          format: int64
          minimum: 1
          maximum: 10000000
          description: Maximum tokens held by the bucket.
        refill_tokens_per_minute:
          type: integer
          format: int64
          minimum: 1
          maximum: 10000000
          description: Tokens restored per minute.
        remaining:
          type: integer
          format: int64
          minimum: 0
          maximum: 10000000
          description: Tokens remaining after the atomic decision.
        full_after_ms:
          type: integer
          format: int64
          minimum: 0
          maximum: 86400000
          description: Milliseconds until the bucket is full if no more work is admitted.
    OrderbookLevel:
      type: string
      const: L2
      default: L2
      description: >-
        Aggregated market-by-price depth. Later protocol versions may add L1 or
        entitled L3 without changing this version's closed schema.
    OrderbookDepth:
      type: integer
      minimum: 1
      maximum: 25
      default: 25
      description: Maximum visible levels per side; omission requests 25.
    FixedPointPrice:
      type: string
      pattern: ^[0-9]+(\.[0-9]{1,6})?$
      maxLength: 24
      description: >-
        YES-side price in dollars as an exact fixed-point decimal string with at
        most six decimal places.
    FixedPointQuantity:
      type: string
      pattern: ^[0-9]+(\.[0-9]{1,2})?$
      maxLength: 24
      description: >-
        Contract quantity as an exact fixed-point decimal string with at most
        two decimal places. Zero removes an updated price level.
    OrderSide:
      type: string
      enum:
        - buy
        - sell
      description: '`buy` is bid liquidity and `sell` is ask liquidity, both for YES.'
    PriceLevel:
      type: array
      minItems: 2
      maxItems: 2
      description: A `[price, quantity]` pair of exact decimal strings.
      prefixItems:
        - type: string
          pattern: ^[0-9]+(\.[0-9]{1,6})?$
          maxLength: 24
          description: >-
            YES-side price in dollars as an exact fixed-point decimal string
            with at most six decimal places.
        - type: string
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          maxLength: 24
          description: >-
            Contract quantity as an exact fixed-point decimal string with at
            most two decimal places. Zero removes an updated price level.
      items: false
    SubscribeCommandEnvelope:
      type: object
      additionalProperties: false
      description: >-
        Command that atomically creates one independent L2 order book
        subscription per requested ticker.
      required:
        - id
        - cmd
        - params
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        cmd:
          type: string
          const: subscribe
          description: Selects the subscribe command.
        params:
          type: object
          additionalProperties: false
          description: >-
            Markets and common L2 view requested for independent subscriptions.
            Any ticker in the caller-visible public market catalog is
            subscribable regardless of market status. Lifecycle transitions do
            not end the subscription; removal from that catalog does.
          required:
            - channels
            - tickers
          properties:
            channels:
              type: array
              minItems: 1
              maxItems: 1
              uniqueItems: true
              description: The initial protocol supports only the order book channel.
              items:
                type: string
                const: orderbook
                description: Aggregated L2 order book market data.
            tickers:
              type: array
              minItems: 1
              maxItems: 250
              uniqueItems: true
              description: >-
                A canonical non-empty list of distinct market tickers. The
                protocol ceiling is 250; an operational profile may impose a
                lower limit.
              items:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
            level:
              type: string
              const: L2
              default: L2
              description: >-
                Aggregated market-by-price depth. Later protocol versions may
                add L1 or entitled L3 without changing this version's closed
                schema.
            depth:
              type: integer
              minimum: 1
              maximum: 25
              default: 25
              description: Maximum visible levels per side; omission requests 25.
    SubscribeCommandParams:
      type: object
      additionalProperties: false
      description: >-
        Markets and common L2 view requested for independent subscriptions. Any
        ticker in the caller-visible public market catalog is subscribable
        regardless of market status. Lifecycle transitions do not end the
        subscription; removal from that catalog does.
      required:
        - channels
        - tickers
      properties:
        channels:
          type: array
          minItems: 1
          maxItems: 1
          uniqueItems: true
          description: The initial protocol supports only the order book channel.
          items:
            type: string
            const: orderbook
            description: Aggregated L2 order book market data.
        tickers:
          type: array
          minItems: 1
          maxItems: 250
          uniqueItems: true
          description: >-
            A canonical non-empty list of distinct market tickers. The protocol
            ceiling is 250; an operational profile may impose a lower limit.
          items:
            type: string
            minLength: 1
            maxLength: 128
            description: A market's public ticker.
        level:
          type: string
          const: L2
          default: L2
          description: >-
            Aggregated market-by-price depth. Later protocol versions may add L1
            or entitled L3 without changing this version's closed schema.
        depth:
          type: integer
          minimum: 1
          maximum: 25
          default: 25
          description: Maximum visible levels per side; omission requests 25.
    UnsubscribeCommandEnvelope:
      type: object
      additionalProperties: false
      description: Command that atomically ends subscriptions on this connection.
      required:
        - id
        - cmd
        - params
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        cmd:
          type: string
          const: unsubscribe
          description: Selects the unsubscribe command.
        params:
          type: object
          additionalProperties: false
          description: Identifies the subscriptions to end as a canonical array.
          required:
            - sids
          properties:
            sids:
              type: array
              minItems: 1
              maxItems: 250
              uniqueItems: true
              description: >-
                Canonical non-empty list of distinct subscription IDs. It
                remains an array when one subscription is targeted.
              items:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
    UnsubscribeCommandParams:
      type: object
      additionalProperties: false
      description: Identifies the subscriptions to end as a canonical array.
      required:
        - sids
      properties:
        sids:
          type: array
          minItems: 1
          maxItems: 250
          uniqueItems: true
          description: >-
            Canonical non-empty list of distinct subscription IDs. It remains an
            array when one subscription is targeted.
          items:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
    SnapshotCommandEnvelope:
      type: object
      additionalProperties: false
      description: Command that requests fresh state without changing subscriptions.
      required:
        - id
        - cmd
        - params
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        cmd:
          type: string
          const: snapshot
          description: Selects the snapshot command.
        params:
          type: object
          additionalProperties: false
          description: Selects order book subscriptions as a canonical array.
          required:
            - sids
          properties:
            sids:
              type: array
              minItems: 1
              maxItems: 250
              uniqueItems: true
              description: >-
                Canonical non-empty list of distinct subscription IDs. It
                remains an array when one subscription is targeted.
              items:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
    SnapshotCommandParams:
      type: object
      additionalProperties: false
      description: Selects order book subscriptions as a canonical array.
      required:
        - sids
      properties:
        sids:
          type: array
          minItems: 1
          maxItems: 250
          uniqueItems: true
          description: >-
            Canonical non-empty list of distinct subscription IDs. It remains an
            array when one subscription is targeted.
          items:
            type: integer
            format: int64
            minimum: 1
            maximum: 9007199254740991
            description: >-
              Opaque server-assigned subscription ID whose lifetime is this
              WebSocket connection.
    SubscribedEnvelope:
      type: object
      additionalProperties: false
      description: Successful subscribe response with normalized effective settings.
      required:
        - id
        - type
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: subscribed
          description: Identifies a successful subscribe response.
        msg:
          type: object
          additionalProperties: false
          description: Normalized settings committed for the subscription batch.
          required:
            - channel
            - subscriptions
            - level
            - depth
          properties:
            channel:
              type: string
              const: orderbook
              description: The committed market data channel.
            subscriptions:
              type: array
              minItems: 1
              maxItems: 250
              uniqueItems: true
              description: >-
                Canonical non-empty list of independent subscriptions in request
                order. It remains an array when one subscription is returned.
              items:
                type: object
                additionalProperties: false
                description: One independent one-ticker order book subscription.
                required:
                  - sid
                  - ticker
                properties:
                  sid:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 9007199254740991
                    description: >-
                      Opaque server-assigned subscription ID whose lifetime is
                      this WebSocket connection.
                  ticker:
                    type: string
                    minLength: 1
                    maxLength: 128
                    description: A market's public ticker.
            level:
              type: string
              const: L2
              default: L2
              description: >-
                Aggregated market-by-price depth. Later protocol versions may
                add L1 or entitled L3 without changing this version's closed
                schema.
            depth:
              type: integer
              minimum: 1
              maximum: 25
              default: 25
              description: Maximum visible levels per side; omission requests 25.
        rate_limit:
          allOf:
            - type: object
              additionalProperties: false
              description: >-
                Member bucket state returned by the same atomic decision that
                admitted or rejected the command. Streaming market data never
                carries it.
              required:
                - bucket
                - capacity
                - refill_tokens_per_minute
                - remaining
                - full_after_ms
              properties:
                bucket:
                  type: string
                  enum:
                    - read
                    - write
                    - cancel
                  description: Shared member bucket consulted for this command.
                capacity:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Maximum tokens held by the bucket.
                refill_tokens_per_minute:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Tokens restored per minute.
                remaining:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 10000000
                  description: Tokens remaining after the atomic decision.
                full_after_ms:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 86400000
                  description: >-
                    Milliseconds until the bucket is full if no more work is
                    admitted.
          description: >-
            Present for a newly admitted charged batch. An exact duplicate
            subscribe response omits it because no tokens were spent.
    SubscribedPayload:
      type: object
      additionalProperties: false
      description: Normalized settings committed for the subscription batch.
      required:
        - channel
        - subscriptions
        - level
        - depth
      properties:
        channel:
          type: string
          const: orderbook
          description: The committed market data channel.
        subscriptions:
          type: array
          minItems: 1
          maxItems: 250
          uniqueItems: true
          description: >-
            Canonical non-empty list of independent subscriptions in request
            order. It remains an array when one subscription is returned.
          items:
            type: object
            additionalProperties: false
            description: One independent one-ticker order book subscription.
            required:
              - sid
              - ticker
            properties:
              sid:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
              ticker:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
        level:
          type: string
          const: L2
          default: L2
          description: >-
            Aggregated market-by-price depth. Later protocol versions may add L1
            or entitled L3 without changing this version's closed schema.
        depth:
          type: integer
          minimum: 1
          maximum: 25
          default: 25
          description: Maximum visible levels per side; omission requests 25.
    UnsubscribedEnvelope:
      type: object
      additionalProperties: false
      description: Successful batched unsubscribe and terminal barrier.
      required:
        - id
        - type
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: unsubscribed
          description: Identifies a successful unsubscribe response.
        msg:
          type: object
          additionalProperties: false
          description: Subscriptions ended atomically in request order.
          required:
            - subscriptions
          properties:
            subscriptions:
              type: array
              minItems: 1
              maxItems: 250
              uniqueItems: true
              description: >-
                Canonical non-empty list of independent subscriptions in request
                order. It remains an array when one subscription is returned.
              items:
                type: object
                additionalProperties: false
                description: One independent one-ticker order book subscription.
                required:
                  - sid
                  - ticker
                properties:
                  sid:
                    type: integer
                    format: int64
                    minimum: 1
                    maximum: 9007199254740991
                    description: >-
                      Opaque server-assigned subscription ID whose lifetime is
                      this WebSocket connection.
                  ticker:
                    type: string
                    minLength: 1
                    maxLength: 128
                    description: A market's public ticker.
    UnsubscribedPayload:
      type: object
      additionalProperties: false
      description: Subscriptions ended atomically in request order.
      required:
        - subscriptions
      properties:
        subscriptions:
          type: array
          minItems: 1
          maxItems: 250
          uniqueItems: true
          description: >-
            Canonical non-empty list of independent subscriptions in request
            order. It remains an array when one subscription is returned.
          items:
            type: object
            additionalProperties: false
            description: One independent one-ticker order book subscription.
            required:
              - sid
              - ticker
            properties:
              sid:
                type: integer
                format: int64
                minimum: 1
                maximum: 9007199254740991
                description: >-
                  Opaque server-assigned subscription ID whose lifetime is this
                  WebSocket connection.
              ticker:
                type: string
                minLength: 1
                maxLength: 128
                description: A market's public ticker.
    OrderbookSnapshotPayload:
      type: object
      additionalProperties: false
      description: Complete visible L2 order book state for one market.
      required:
        - ticker
        - bids
        - asks
      properties:
        ticker:
          type: string
          minLength: 1
          maxLength: 128
          description: A market's public ticker.
        bids:
          type: array
          maxItems: 25
          description: Bid levels in best-first order as `[price, quantity]` pairs.
          items:
            type: array
            minItems: 2
            maxItems: 2
            description: A `[price, quantity]` pair of exact decimal strings.
            prefixItems:
              - type: string
                pattern: ^[0-9]+(\.[0-9]{1,6})?$
                maxLength: 24
                description: >-
                  YES-side price in dollars as an exact fixed-point decimal
                  string with at most six decimal places.
              - type: string
                pattern: ^[0-9]+(\.[0-9]{1,2})?$
                maxLength: 24
                description: >-
                  Contract quantity as an exact fixed-point decimal string with
                  at most two decimal places. Zero removes an updated price
                  level.
            items: false
        asks:
          type: array
          maxItems: 25
          description: Ask levels in best-first order as `[price, quantity]` pairs.
          items:
            type: array
            minItems: 2
            maxItems: 2
            description: A `[price, quantity]` pair of exact decimal strings.
            prefixItems:
              - type: string
                pattern: ^[0-9]+(\.[0-9]{1,6})?$
                maxLength: 24
                description: >-
                  YES-side price in dollars as an exact fixed-point decimal
                  string with at most six decimal places.
              - type: string
                pattern: ^[0-9]+(\.[0-9]{1,2})?$
                maxLength: 24
                description: >-
                  Contract quantity as an exact fixed-point decimal string with
                  at most two decimal places. Zero removes an updated price
                  level.
            items: false
    InitialOrderbookSnapshotEnvelope:
      type: object
      additionalProperties: false
      description: >-
        Initial or server-recovery snapshot. Its lack of `id` distinguishes it
        from the finite response to a client snapshot command.
      required:
        - type
        - sid
        - seq
        - msg
      properties:
        type:
          type: string
          const: orderbook_snapshot
          description: Identifies a complete order book snapshot.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        seq:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Gap-detection sequence local to one-ticker subscription. It starts
            at 1 and increments once for every snapshot or update.
        msg:
          type: object
          additionalProperties: false
          description: Complete visible L2 order book state for one market.
          required:
            - ticker
            - bids
            - asks
          properties:
            ticker:
              type: string
              minLength: 1
              maxLength: 128
              description: A market's public ticker.
            bids:
              type: array
              maxItems: 25
              description: Bid levels in best-first order as `[price, quantity]` pairs.
              items:
                type: array
                minItems: 2
                maxItems: 2
                description: A `[price, quantity]` pair of exact decimal strings.
                prefixItems:
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,6})?$
                    maxLength: 24
                    description: >-
                      YES-side price in dollars as an exact fixed-point decimal
                      string with at most six decimal places.
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,2})?$
                    maxLength: 24
                    description: >-
                      Contract quantity as an exact fixed-point decimal string
                      with at most two decimal places. Zero removes an updated
                      price level.
                items: false
            asks:
              type: array
              maxItems: 25
              description: Ask levels in best-first order as `[price, quantity]` pairs.
              items:
                type: array
                minItems: 2
                maxItems: 2
                description: A `[price, quantity]` pair of exact decimal strings.
                prefixItems:
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,6})?$
                    maxLength: 24
                    description: >-
                      YES-side price in dollars as an exact fixed-point decimal
                      string with at most six decimal places.
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,2})?$
                    maxLength: 24
                    description: >-
                      Contract quantity as an exact fixed-point decimal string
                      with at most two decimal places. Zero removes an updated
                      price level.
                items: false
    RequestedOrderbookSnapshotEnvelope:
      type: object
      additionalProperties: false
      description: One correlated result in a snapshot command's finite response series.
      required:
        - id
        - type
        - sid
        - seq
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: orderbook_snapshot
          description: Identifies a complete order book snapshot.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        seq:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Gap-detection sequence local to one-ticker subscription. It starts
            at 1 and increments once for every snapshot or update.
        msg:
          type: object
          additionalProperties: false
          description: Complete visible L2 order book state for one market.
          required:
            - ticker
            - bids
            - asks
          properties:
            ticker:
              type: string
              minLength: 1
              maxLength: 128
              description: A market's public ticker.
            bids:
              type: array
              maxItems: 25
              description: Bid levels in best-first order as `[price, quantity]` pairs.
              items:
                type: array
                minItems: 2
                maxItems: 2
                description: A `[price, quantity]` pair of exact decimal strings.
                prefixItems:
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,6})?$
                    maxLength: 24
                    description: >-
                      YES-side price in dollars as an exact fixed-point decimal
                      string with at most six decimal places.
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,2})?$
                    maxLength: 24
                    description: >-
                      Contract quantity as an exact fixed-point decimal string
                      with at most two decimal places. Zero removes an updated
                      price level.
                items: false
            asks:
              type: array
              maxItems: 25
              description: Ask levels in best-first order as `[price, quantity]` pairs.
              items:
                type: array
                minItems: 2
                maxItems: 2
                description: A `[price, quantity]` pair of exact decimal strings.
                prefixItems:
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,6})?$
                    maxLength: 24
                    description: >-
                      YES-side price in dollars as an exact fixed-point decimal
                      string with at most six decimal places.
                  - type: string
                    pattern: ^[0-9]+(\.[0-9]{1,2})?$
                    maxLength: 24
                    description: >-
                      Contract quantity as an exact fixed-point decimal string
                      with at most two decimal places. Zero removes an updated
                      price level.
                items: false
        rate_limit:
          allOf:
            - type: object
              additionalProperties: false
              description: >-
                Member bucket state returned by the same atomic decision that
                admitted or rejected the command. Streaming market data never
                carries it.
              required:
                - bucket
                - capacity
                - refill_tokens_per_minute
                - remaining
                - full_after_ms
              properties:
                bucket:
                  type: string
                  enum:
                    - read
                    - write
                    - cancel
                  description: Shared member bucket consulted for this command.
                capacity:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Maximum tokens held by the bucket.
                refill_tokens_per_minute:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Tokens restored per minute.
                remaining:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 10000000
                  description: Tokens remaining after the atomic decision.
                full_after_ms:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 86400000
                  description: >-
                    Milliseconds until the bucket is full if no more work is
                    admitted.
          description: >-
            Present only on the first snapshot in this command's finite result
            series; later snapshots from the same command omit it.
    OrderbookChange:
      type: object
      additionalProperties: false
      description: Absolute replacement quantity for one YES-side price level.
      required:
        - side
        - price
        - quantity
      properties:
        side:
          type: string
          enum:
            - buy
            - sell
          description: '`buy` is bid liquidity and `sell` is ask liquidity, both for YES.'
        price:
          type: string
          pattern: ^[0-9]+(\.[0-9]{1,6})?$
          maxLength: 24
          description: >-
            YES-side price in dollars as an exact fixed-point decimal string
            with at most six decimal places.
        quantity:
          type: string
          pattern: ^[0-9]+(\.[0-9]{1,2})?$
          maxLength: 24
          description: >-
            Contract quantity as an exact fixed-point decimal string with at
            most two decimal places. Zero removes an updated price level.
    OrderbookUpdatePayload:
      type: object
      additionalProperties: false
      description: One market's complete visible transition between book states.
      required:
        - ticker
        - changes
      properties:
        ticker:
          type: string
          minLength: 1
          maxLength: 128
          description: A market's public ticker.
        changes:
          type: array
          minItems: 1
          maxItems: 100
          description: >-
            Absolute price-level replacements applied atomically. Array order
            has no meaning; a zero quantity removes the level.
          items:
            type: object
            additionalProperties: false
            description: Absolute replacement quantity for one YES-side price level.
            required:
              - side
              - price
              - quantity
            properties:
              side:
                type: string
                enum:
                  - buy
                  - sell
                description: >-
                  `buy` is bid liquidity and `sell` is ask liquidity, both for
                  YES.
              price:
                type: string
                pattern: ^[0-9]+(\.[0-9]{1,6})?$
                maxLength: 24
                description: >-
                  YES-side price in dollars as an exact fixed-point decimal
                  string with at most six decimal places.
              quantity:
                type: string
                pattern: ^[0-9]+(\.[0-9]{1,2})?$
                maxLength: 24
                description: >-
                  Contract quantity as an exact fixed-point decimal string with
                  at most two decimal places. Zero removes an updated price
                  level.
    OrderbookUpdateEnvelope:
      type: object
      additionalProperties: false
      description: Sequenced absolute L2 changes for exactly one market.
      required:
        - type
        - sid
        - seq
        - msg
      properties:
        type:
          type: string
          const: orderbook_update
          description: Identifies an incremental order book update.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        seq:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Gap-detection sequence local to one-ticker subscription. It starts
            at 1 and increments once for every snapshot or update.
        msg:
          type: object
          additionalProperties: false
          description: One market's complete visible transition between book states.
          required:
            - ticker
            - changes
          properties:
            ticker:
              type: string
              minLength: 1
              maxLength: 128
              description: A market's public ticker.
            changes:
              type: array
              minItems: 1
              maxItems: 100
              description: >-
                Absolute price-level replacements applied atomically. Array
                order has no meaning; a zero quantity removes the level.
              items:
                type: object
                additionalProperties: false
                description: Absolute replacement quantity for one YES-side price level.
                required:
                  - side
                  - price
                  - quantity
                properties:
                  side:
                    type: string
                    enum:
                      - buy
                      - sell
                    description: >-
                      `buy` is bid liquidity and `sell` is ask liquidity, both
                      for YES.
                  price:
                    type: string
                    pattern: ^[0-9]+(\.[0-9]{1,6})?$
                    maxLength: 24
                    description: >-
                      YES-side price in dollars as an exact fixed-point decimal
                      string with at most six decimal places.
                  quantity:
                    type: string
                    pattern: ^[0-9]+(\.[0-9]{1,2})?$
                    maxLength: 24
                    description: >-
                      Contract quantity as an exact fixed-point decimal string
                      with at most two decimal places. Zero removes an updated
                      price level.
    ErrorDetail:
      type: string
      minLength: 1
      maxLength: 500
      description: Human-readable occurrence detail that clients must not parse.
    ErrorInstance:
      type: string
      format: uri-reference
      pattern: >-
        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
      maxLength: 100
      description: Request ID for troubleshooting with UDX support.
    InvalidMessageErrorPayload:
      type: object
      additionalProperties: false
      description: The JSON or common command envelope is invalid.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: invalid_message
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        field:
          type: string
          minLength: 1
          maxLength: 255
          description: JSON path to the invalid field when one can be identified.
    UnknownCommandErrorPayload:
      type: object
      additionalProperties: false
      description: The command is unsupported by the negotiated protocol version.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: unknown_command
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    InvalidParamsErrorPayload:
      type: object
      additionalProperties: false
      description: Command params fail schema or semantic validation.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: invalid_params
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        field:
          type: string
          minLength: 1
          maxLength: 255
          description: JSON path to the invalid param when one can be identified.
    CommandIdInUseErrorPayload:
      type: object
      additionalProperties: false
      description: Another command with the supplied ID is still in flight.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: command_id_in_use
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    MarketNotFoundErrorPayload:
      type: object
      additionalProperties: false
      description: The ticker is absent from the caller-visible market catalog.
      required:
        - code
        - detail
        - instance
        - ticker
      properties:
        code:
          type: string
          const: market_not_found
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        ticker:
          type: string
          minLength: 1
          maxLength: 128
          description: A market's public ticker.
    PermissionDeniedErrorPayload:
      type: object
      additionalProperties: false
      description: The caller lacks required access.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: permission_denied
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    SubscriptionConflictErrorPayload:
      type: object
      additionalProperties: false
      description: The ticker already belongs to the identified subscription.
      required:
        - code
        - detail
        - instance
        - ticker
      properties:
        code:
          type: string
          const: subscription_conflict
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        ticker:
          type: string
          minLength: 1
          maxLength: 128
          description: A market's public ticker.
    SubscriptionNotFoundErrorPayload:
      type: object
      additionalProperties: false
      description: The subscription ID is not active on this connection.
      required:
        - code
        - detail
        - instance
        - sid
      properties:
        code:
          type: string
          const: subscription_not_found
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
    SubscriptionNotReadyErrorPayload:
      type: object
      additionalProperties: false
      description: Current state is not yet established for the requested operation.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: subscription_not_ready
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    SnapshotInProgressErrorPayload:
      type: object
      additionalProperties: false
      description: The subscription already has a snapshot command in flight.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: snapshot_in_progress
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    RateLimitExceededErrorPayload:
      type: object
      additionalProperties: false
      description: A command rate limit was exceeded.
      required:
        - code
        - detail
        - instance
        - retry_after_ms
      properties:
        code:
          type: string
          const: rate_limit_exceeded
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        retry_after_ms:
          type: integer
          format: int64
          minimum: 1
          maximum: 86400000
          description: Minimum delay in milliseconds before another attempt.
    CapacityExceededErrorPayload:
      type: object
      additionalProperties: false
      description: A standing-resource limit prevents command admission.
      required:
        - code
        - detail
        - instance
        - scope
        - resource
        - limit
      properties:
        code:
          type: string
          const: capacity_exceeded
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
        scope:
          type: string
          enum:
            - connection
            - member
            - process
          description: Boundary at which the standing-resource limit applies.
        resource:
          type: string
          enum:
            - in_flight_commands
            - active_subscriptions
            - market_data_streams
          description: Retained or concurrent resource that reached its limit.
        limit:
          type: integer
          format: int64
          minimum: 1
          maximum: 10000000
          description: Enforced maximum for the identified scope and resource.
    AdmissionUnavailableErrorPayload:
      type: object
      additionalProperties: false
      description: Shared admission policy or state is temporarily unavailable.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: admission_unavailable
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    MarketDataUnavailableErrorPayload:
      type: object
      additionalProperties: false
      description: Current market data needed by the operation is unavailable.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: market_data_unavailable
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    InternalErrorPayload:
      type: object
      additionalProperties: false
      description: An unexpected failure left connection state safe to continue.
      required:
        - code
        - detail
        - instance
      properties:
        code:
          type: string
          const: internal_error
          description: Stable machine-readable error code.
        detail:
          type: string
          minLength: 1
          maxLength: 500
          description: Human-readable occurrence detail that clients must not parse.
        instance:
          type: string
          format: uri-reference
          pattern: >-
            ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
          maxLength: 100
          description: Request ID for troubleshooting with UDX support.
    CorrelatedCommandErrorPayload:
      oneOf:
        - type: object
          additionalProperties: false
          description: The command is unsupported by the negotiated protocol version.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: unknown_command
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: Command params fail schema or semantic validation.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: invalid_params
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            field:
              type: string
              minLength: 1
              maxLength: 255
              description: JSON path to the invalid param when one can be identified.
        - type: object
          additionalProperties: false
          description: Another command with the supplied ID is still in flight.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: command_id_in_use
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: The ticker is absent from the caller-visible market catalog.
          required:
            - code
            - detail
            - instance
            - ticker
          properties:
            code:
              type: string
              const: market_not_found
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            ticker:
              type: string
              minLength: 1
              maxLength: 128
              description: A market's public ticker.
        - type: object
          additionalProperties: false
          description: The caller lacks required access.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: permission_denied
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: The subscription ID is not active on this connection.
          required:
            - code
            - detail
            - instance
            - sid
          properties:
            code:
              type: string
              const: subscription_not_found
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
        - type: object
          additionalProperties: false
          description: Current state is not yet established for the requested operation.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: subscription_not_ready
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: The subscription already has a snapshot command in flight.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: snapshot_in_progress
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: A command rate limit was exceeded.
          required:
            - code
            - detail
            - instance
            - retry_after_ms
          properties:
            code:
              type: string
              const: rate_limit_exceeded
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            retry_after_ms:
              type: integer
              format: int64
              minimum: 1
              maximum: 86400000
              description: Minimum delay in milliseconds before another attempt.
        - type: object
          additionalProperties: false
          description: A standing-resource limit prevents command admission.
          required:
            - code
            - detail
            - instance
            - scope
            - resource
            - limit
          properties:
            code:
              type: string
              const: capacity_exceeded
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            scope:
              type: string
              enum:
                - connection
                - member
                - process
              description: Boundary at which the standing-resource limit applies.
            resource:
              type: string
              enum:
                - in_flight_commands
                - active_subscriptions
                - market_data_streams
              description: Retained or concurrent resource that reached its limit.
            limit:
              type: integer
              format: int64
              minimum: 1
              maximum: 10000000
              description: Enforced maximum for the identified scope and resource.
        - type: object
          additionalProperties: false
          description: Shared admission policy or state is temporarily unavailable.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: admission_unavailable
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: Current market data needed by the operation is unavailable.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: market_data_unavailable
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
        - type: object
          additionalProperties: false
          description: An unexpected failure left connection state safe to continue.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: internal_error
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
      description: Closed set of command errors that may optionally identify a sid.
    InvalidMessageCommandErrorEnvelope:
      type: object
      additionalProperties: false
      description: Invalid-message error; ID is omitted if it was not trustworthy.
      required:
        - type
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: error
          description: Identifies a rejected command.
        msg:
          type: object
          additionalProperties: false
          description: The JSON or common command envelope is invalid.
          required:
            - code
            - detail
            - instance
          properties:
            code:
              type: string
              const: invalid_message
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            field:
              type: string
              minLength: 1
              maxLength: 255
              description: JSON path to the invalid field when one can be identified.
    CorrelatedCommandErrorEnvelope:
      type: object
      additionalProperties: false
      description: Rejected command correlated by its trustworthy client ID.
      required:
        - id
        - type
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: error
          description: Identifies a rejected command.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        msg:
          oneOf:
            - type: object
              additionalProperties: false
              description: The command is unsupported by the negotiated protocol version.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: unknown_command
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: Command params fail schema or semantic validation.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: invalid_params
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                field:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: JSON path to the invalid param when one can be identified.
            - type: object
              additionalProperties: false
              description: Another command with the supplied ID is still in flight.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: command_id_in_use
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: The ticker is absent from the caller-visible market catalog.
              required:
                - code
                - detail
                - instance
                - ticker
              properties:
                code:
                  type: string
                  const: market_not_found
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                ticker:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
            - type: object
              additionalProperties: false
              description: The caller lacks required access.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: permission_denied
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: The subscription ID is not active on this connection.
              required:
                - code
                - detail
                - instance
                - sid
              properties:
                code:
                  type: string
                  const: subscription_not_found
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                sid:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 9007199254740991
                  description: >-
                    Opaque server-assigned subscription ID whose lifetime is
                    this WebSocket connection.
            - type: object
              additionalProperties: false
              description: >-
                Current state is not yet established for the requested
                operation.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: subscription_not_ready
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: The subscription already has a snapshot command in flight.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: snapshot_in_progress
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: A command rate limit was exceeded.
              required:
                - code
                - detail
                - instance
                - retry_after_ms
              properties:
                code:
                  type: string
                  const: rate_limit_exceeded
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                retry_after_ms:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 86400000
                  description: Minimum delay in milliseconds before another attempt.
            - type: object
              additionalProperties: false
              description: A standing-resource limit prevents command admission.
              required:
                - code
                - detail
                - instance
                - scope
                - resource
                - limit
              properties:
                code:
                  type: string
                  const: capacity_exceeded
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                scope:
                  type: string
                  enum:
                    - connection
                    - member
                    - process
                  description: Boundary at which the standing-resource limit applies.
                resource:
                  type: string
                  enum:
                    - in_flight_commands
                    - active_subscriptions
                    - market_data_streams
                  description: Retained or concurrent resource that reached its limit.
                limit:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Enforced maximum for the identified scope and resource.
            - type: object
              additionalProperties: false
              description: Shared admission policy or state is temporarily unavailable.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: admission_unavailable
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: Current market data needed by the operation is unavailable.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: market_data_unavailable
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: An unexpected failure left connection state safe to continue.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: internal_error
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
          description: Closed set of command errors that may optionally identify a sid.
        rate_limit:
          allOf:
            - type: object
              additionalProperties: false
              description: >-
                Member bucket state returned by the same atomic decision that
                admitted or rejected the command. Streaming market data never
                carries it.
              required:
                - bucket
                - capacity
                - refill_tokens_per_minute
                - remaining
                - full_after_ms
              properties:
                bucket:
                  type: string
                  enum:
                    - read
                    - write
                    - cancel
                  description: Shared member bucket consulted for this command.
                capacity:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Maximum tokens held by the bucket.
                refill_tokens_per_minute:
                  type: integer
                  format: int64
                  minimum: 1
                  maximum: 10000000
                  description: Tokens restored per minute.
                remaining:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 10000000
                  description: Tokens remaining after the atomic decision.
                full_after_ms:
                  type: integer
                  format: int64
                  minimum: 0
                  maximum: 86400000
                  description: >-
                    Milliseconds until the bucket is full if no more work is
                    admitted.
          description: >-
            Present on `rate_limit_exceeded` and omitted for uncharged command
            failures, capacity failures, and unavailable admission.
    SubscriptionConflictCommandErrorEnvelope:
      type: object
      additionalProperties: false
      description: Rejected subscribe command identifying the conflicting subscription.
      required:
        - id
        - type
        - sid
        - msg
      properties:
        id:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Client-assigned command correlation ID, unique among commands in
            flight on this connection.
        type:
          type: string
          const: error
          description: Identifies a rejected command.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        msg:
          type: object
          additionalProperties: false
          description: The ticker already belongs to the identified subscription.
          required:
            - code
            - detail
            - instance
            - ticker
          properties:
            code:
              type: string
              const: subscription_conflict
              description: Stable machine-readable error code.
            detail:
              type: string
              minLength: 1
              maxLength: 500
              description: Human-readable occurrence detail that clients must not parse.
            instance:
              type: string
              format: uri-reference
              pattern: >-
                ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
              maxLength: 100
              description: Request ID for troubleshooting with UDX support.
            ticker:
              type: string
              minLength: 1
              maxLength: 128
              description: A market's public ticker.
    CommandErrorEnvelope:
      oneOf:
        - type: object
          additionalProperties: false
          description: Invalid-message error; ID is omitted if it was not trustworthy.
          required:
            - type
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: error
              description: Identifies a rejected command.
            msg:
              type: object
              additionalProperties: false
              description: The JSON or common command envelope is invalid.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: invalid_message
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                field:
                  type: string
                  minLength: 1
                  maxLength: 255
                  description: JSON path to the invalid field when one can be identified.
        - type: object
          additionalProperties: false
          description: Rejected command correlated by its trustworthy client ID.
          required:
            - id
            - type
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: error
              description: Identifies a rejected command.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            msg:
              oneOf:
                - type: object
                  additionalProperties: false
                  description: >-
                    The command is unsupported by the negotiated protocol
                    version.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: unknown_command
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: Command params fail schema or semantic validation.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: invalid_params
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    field:
                      type: string
                      minLength: 1
                      maxLength: 255
                      description: >-
                        JSON path to the invalid param when one can be
                        identified.
                - type: object
                  additionalProperties: false
                  description: Another command with the supplied ID is still in flight.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: command_id_in_use
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: The ticker is absent from the caller-visible market catalog.
                  required:
                    - code
                    - detail
                    - instance
                    - ticker
                  properties:
                    code:
                      type: string
                      const: market_not_found
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    ticker:
                      type: string
                      minLength: 1
                      maxLength: 128
                      description: A market's public ticker.
                - type: object
                  additionalProperties: false
                  description: The caller lacks required access.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: permission_denied
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: The subscription ID is not active on this connection.
                  required:
                    - code
                    - detail
                    - instance
                    - sid
                  properties:
                    code:
                      type: string
                      const: subscription_not_found
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    sid:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 9007199254740991
                      description: >-
                        Opaque server-assigned subscription ID whose lifetime is
                        this WebSocket connection.
                - type: object
                  additionalProperties: false
                  description: >-
                    Current state is not yet established for the requested
                    operation.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: subscription_not_ready
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: The subscription already has a snapshot command in flight.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: snapshot_in_progress
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: A command rate limit was exceeded.
                  required:
                    - code
                    - detail
                    - instance
                    - retry_after_ms
                  properties:
                    code:
                      type: string
                      const: rate_limit_exceeded
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    retry_after_ms:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 86400000
                      description: Minimum delay in milliseconds before another attempt.
                - type: object
                  additionalProperties: false
                  description: A standing-resource limit prevents command admission.
                  required:
                    - code
                    - detail
                    - instance
                    - scope
                    - resource
                    - limit
                  properties:
                    code:
                      type: string
                      const: capacity_exceeded
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                    scope:
                      type: string
                      enum:
                        - connection
                        - member
                        - process
                      description: Boundary at which the standing-resource limit applies.
                    resource:
                      type: string
                      enum:
                        - in_flight_commands
                        - active_subscriptions
                        - market_data_streams
                      description: Retained or concurrent resource that reached its limit.
                    limit:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Enforced maximum for the identified scope and resource.
                - type: object
                  additionalProperties: false
                  description: Shared admission policy or state is temporarily unavailable.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: admission_unavailable
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: Current market data needed by the operation is unavailable.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: market_data_unavailable
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
                - type: object
                  additionalProperties: false
                  description: >-
                    An unexpected failure left connection state safe to
                    continue.
                  required:
                    - code
                    - detail
                    - instance
                  properties:
                    code:
                      type: string
                      const: internal_error
                      description: Stable machine-readable error code.
                    detail:
                      type: string
                      minLength: 1
                      maxLength: 500
                      description: >-
                        Human-readable occurrence detail that clients must not
                        parse.
                    instance:
                      type: string
                      format: uri-reference
                      pattern: >-
                        ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                      maxLength: 100
                      description: Request ID for troubleshooting with UDX support.
              description: Closed set of command errors that may optionally identify a sid.
            rate_limit:
              allOf:
                - type: object
                  additionalProperties: false
                  description: >-
                    Member bucket state returned by the same atomic decision
                    that admitted or rejected the command. Streaming market data
                    never carries it.
                  required:
                    - bucket
                    - capacity
                    - refill_tokens_per_minute
                    - remaining
                    - full_after_ms
                  properties:
                    bucket:
                      type: string
                      enum:
                        - read
                        - write
                        - cancel
                      description: Shared member bucket consulted for this command.
                    capacity:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Maximum tokens held by the bucket.
                    refill_tokens_per_minute:
                      type: integer
                      format: int64
                      minimum: 1
                      maximum: 10000000
                      description: Tokens restored per minute.
                    remaining:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 10000000
                      description: Tokens remaining after the atomic decision.
                    full_after_ms:
                      type: integer
                      format: int64
                      minimum: 0
                      maximum: 86400000
                      description: >-
                        Milliseconds until the bucket is full if no more work is
                        admitted.
              description: >-
                Present on `rate_limit_exceeded` and omitted for uncharged
                command failures, capacity failures, and unavailable admission.
        - type: object
          additionalProperties: false
          description: Rejected subscribe command identifying the conflicting subscription.
          required:
            - id
            - type
            - sid
            - msg
          properties:
            id:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Client-assigned command correlation ID, unique among commands in
                flight on this connection.
            type:
              type: string
              const: error
              description: Identifies a rejected command.
            sid:
              type: integer
              format: int64
              minimum: 1
              maximum: 9007199254740991
              description: >-
                Opaque server-assigned subscription ID whose lifetime is this
                WebSocket connection.
            msg:
              type: object
              additionalProperties: false
              description: The ticker already belongs to the identified subscription.
              required:
                - code
                - detail
                - instance
                - ticker
              properties:
                code:
                  type: string
                  const: subscription_conflict
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
                ticker:
                  type: string
                  minLength: 1
                  maxLength: 128
                  description: A market's public ticker.
      description: Complete closed union of command-error message envelopes.
    SubscriptionErrorEnvelope:
      type: object
      additionalProperties: false
      description: >-
        Terminal failure for one subscription; it carries no ID or sequence.
        Removal from the caller-visible catalog uses `permission_denied`;
        inability to re-prove visibility within its lease uses
        `market_data_unavailable`.
      required:
        - type
        - sid
        - msg
      properties:
        type:
          type: string
          const: subscription_error
          description: Identifies a terminal subscription failure.
        sid:
          type: integer
          format: int64
          minimum: 1
          maximum: 9007199254740991
          description: >-
            Opaque server-assigned subscription ID whose lifetime is this
            WebSocket connection.
        msg:
          oneOf:
            - type: object
              additionalProperties: false
              description: The caller lacks required access.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: permission_denied
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: Current market data needed by the operation is unavailable.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: market_data_unavailable
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
            - type: object
              additionalProperties: false
              description: An unexpected failure left connection state safe to continue.
              required:
                - code
                - detail
                - instance
              properties:
                code:
                  type: string
                  const: internal_error
                  description: Stable machine-readable error code.
                detail:
                  type: string
                  minLength: 1
                  maxLength: 500
                  description: >-
                    Human-readable occurrence detail that clients must not
                    parse.
                instance:
                  type: string
                  format: uri-reference
                  pattern: >-
                    ^urn:request-id:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
                  maxLength: 100
                  description: Request ID for troubleshooting with UDX support.
          description: Closed set of terminal failures for an order book subscription.
