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

# Fills Stream

> Authenticated stream of the caller's own order fills (auth required).

Authenticated stream of the caller's own order fills (auth required).


## AsyncAPI

````yaml openpx.asyncapi.yaml fills
id: fills
title: Fills Stream
description: Authenticated stream of the caller's own order fills (auth required).
servers:
  - id: inprocess
    protocol: ws
    host: openpx-engine
    bindings: []
    variables: []
address: /v1/fills
parameters: []
bindings: []
operations:
  - &ref_16
    id: fills_subscribe
    title: Subscribe
    description: Add to the active fills subscription set
    type: send
    messages:
      - &ref_24
        id: fills_subscribe
        contentType: application/json
        payload:
          - name: Subscribe
            description: Add to the active fills subscription set
            type: object
            properties:
              - name: market_id
                type: string
                description: >-
                  Native market identifier (Kalshi ticker or Polymarket
                  condition_id).
                required: true
              - name: outcome
                type: &ref_0
                  - string
                  - 'null'
                description: Optional outcome filter for binary markets.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - market_id
          properties:
            market_id:
              type: string
              description: >-
                Native market identifier (Kalshi ticker or Polymarket
                condition_id).
              x-parser-schema-id: <anonymous-schema-88>
            outcome:
              type: *ref_0
              description: Optional outcome filter for binary markets.
              x-parser-schema-id: <anonymous-schema-89>
          x-parser-schema-id: <anonymous-schema-87>
        title: Subscribe
        description: Add to the active fills subscription set
        example: |-
          {
            "market_id": "example",
            "outcome": "example"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: fills_subscribe
    bindings: []
    extensions: &ref_2
      - id: x-parser-unique-object-id
        value: fills
  - &ref_17
    id: fills_unsubscribe
    title: Unsubscribe
    description: Remove from the active fills subscription set
    type: send
    messages:
      - &ref_25
        id: fills_unsubscribe
        contentType: application/json
        payload:
          - name: Unsubscribe
            description: Remove from the active fills subscription set
            type: object
            properties:
              - name: market_id
                type: string
                description: >-
                  Native market identifier (Kalshi ticker or Polymarket
                  condition_id).
                required: true
              - name: outcome
                type: &ref_1
                  - string
                  - 'null'
                description: Optional outcome filter for binary markets.
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - market_id
          properties:
            market_id:
              type: string
              description: >-
                Native market identifier (Kalshi ticker or Polymarket
                condition_id).
              x-parser-schema-id: <anonymous-schema-91>
            outcome:
              type: *ref_1
              description: Optional outcome filter for binary markets.
              x-parser-schema-id: <anonymous-schema-92>
          x-parser-schema-id: <anonymous-schema-90>
        title: Unsubscribe
        description: Remove from the active fills subscription set
        example: |-
          {
            "market_id": "example",
            "outcome": "example"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: fills_unsubscribe
    bindings: []
    extensions: *ref_2
  - &ref_10
    id: fills_receive_Fill
    title: Fill
    description: A fill on one of the authenticated user's orders.
    type: receive
    messages:
      - &ref_18
        id: Fill
        contentType: application/json
        payload:
          - name: Fill
            description: A fill on one of the authenticated user's orders.
            type: object
            properties:
              - name: fill
                type: object
                title: ActivityFill
                required: true
                properties:
                  - name: asset_id
                    type: string
                    required: true
                  - name: exchange_ts_ms
                    type: &ref_3
                      - integer
                      - 'null'
                    description: Exchange-authoritative timestamp (millis since epoch).
                    required: false
                  - name: fee
                    type: &ref_4
                      - number
                      - 'null'
                    description: >-
                      Fee charged for this fill, when the exchange publishes
                      one.
                    required: false
                  - name: fill_id
                    type: &ref_5
                      - string
                      - 'null'
                    required: false
                  - name: liquidity_role
                    type: string
                    required: false
                  - name: market_id
                    type: string
                    required: true
                  - name: order_id
                    type: &ref_6
                      - string
                      - 'null'
                    required: false
                  - name: outcome
                    type: &ref_7
                      - string
                      - 'null'
                    required: false
                  - name: price
                    type: number
                    required: true
                  - name: side
                    type: &ref_8
                      - string
                      - 'null'
                    required: false
                  - name: size
                    type: number
                    required: true
                  - name: source_channel
                    type: string
                    required: true
                  - name: tx_hash
                    type: &ref_9
                      - string
                      - 'null'
                    description: >-
                      On-chain transaction hash, when the exchange publishes
                      one.
                    required: false
              - name: kind
                type: string
                enumValues:
                  - Fill
                required: true
              - name: local_ts_ms
                type: integer
                required: true
        headers: []
        jsonPayloadSchema:
          description: A fill on one of the authenticated user's orders.
          properties:
            fill:
              properties:
                asset_id:
                  type: string
                  x-parser-schema-id: <anonymous-schema-71>
                exchange_ts_ms:
                  description: Exchange-authoritative timestamp (millis since epoch).
                  format: uint64
                  minimum: 0
                  type: *ref_3
                  x-parser-schema-id: <anonymous-schema-72>
                fee:
                  description: Fee charged for this fill, when the exchange publishes one.
                  format: double
                  type: *ref_4
                  x-parser-schema-id: <anonymous-schema-73>
                fill_id:
                  type: *ref_5
                  x-parser-schema-id: <anonymous-schema-74>
                liquidity_role:
                  anyOf:
                    - description: >-
                        Whether a fill provided liquidity (`maker`) or took it
                        (`taker`).
                      enum:
                        - maker
                        - taker
                      type: string
                      x-parser-schema-id: LiquidityRole
                    - type: 'null'
                      x-parser-schema-id: <anonymous-schema-76>
                  x-parser-schema-id: <anonymous-schema-75>
                market_id:
                  type: string
                  x-parser-schema-id: <anonymous-schema-77>
                order_id:
                  type: *ref_6
                  x-parser-schema-id: <anonymous-schema-78>
                outcome:
                  type: *ref_7
                  x-parser-schema-id: <anonymous-schema-79>
                price:
                  format: double
                  type: number
                  x-parser-schema-id: <anonymous-schema-80>
                side:
                  type: *ref_8
                  x-parser-schema-id: <anonymous-schema-81>
                size:
                  format: double
                  type: number
                  x-parser-schema-id: <anonymous-schema-82>
                source_channel:
                  type: string
                  x-parser-schema-id: <anonymous-schema-83>
                tx_hash:
                  description: On-chain transaction hash, when the exchange publishes one.
                  type: *ref_9
                  x-parser-schema-id: <anonymous-schema-84>
              required:
                - asset_id
                - market_id
                - price
                - size
                - source_channel
              title: ActivityFill
              type: object
              x-parser-schema-id: ActivityFill
            kind:
              enum:
                - Fill
              type: string
              x-parser-schema-id: <anonymous-schema-85>
            local_ts_ms:
              format: uint64
              minimum: 0
              type: integer
              x-parser-schema-id: <anonymous-schema-86>
          required:
            - fill
            - kind
            - local_ts_ms
          type: object
          x-parser-schema-id: Fill
        title: Fill
        description: A fill on one of the authenticated user's orders.
        example: |-
          {
            "fill": {
              "asset_id": "example",
              "exchange_ts_ms": 0,
              "fee": 0.5,
              "fill_id": "example",
              "liquidity_role": null,
              "market_id": "example",
              "order_id": "example",
              "outcome": "example",
              "price": 0.5,
              "side": "example",
              "size": 0.5,
              "source_channel": "example",
              "tx_hash": "example"
            },
            "kind": "Fill",
            "local_ts_ms": 0
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Fill
    bindings: []
    extensions: *ref_2
  - &ref_11
    id: fills_receive_Connected
    title: Connected
    description: Initial socket establishment.
    type: receive
    messages:
      - &ref_19
        id: Connected
        contentType: application/json
        payload:
          - name: Connected
            description: Initial socket establishment.
            type: object
            properties:
              - name: kind
                type: string
                enumValues:
                  - Connected
                required: true
        headers: []
        jsonPayloadSchema:
          description: Initial socket establishment.
          properties:
            kind:
              enum:
                - Connected
              type: string
              x-parser-schema-id: <anonymous-schema-35>
          required:
            - kind
          type: object
          x-parser-schema-id: Connected
        title: Connected
        description: Initial socket establishment.
        example: |-
          {
            "kind": "Connected"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Connected
    bindings: []
    extensions: *ref_2
  - &ref_12
    id: fills_receive_Reconnected
    title: Reconnected
    description: >-
      Socket re-established after an outage — `gap_ms` is the wall-clock
      interval since the last received message.
    type: receive
    messages:
      - &ref_20
        id: Reconnected
        contentType: application/json
        payload:
          - name: Reconnected
            description: >-
              Socket re-established after an outage — `gap_ms` is the wall-clock
              interval since the last received message.
            type: object
            properties:
              - name: gap_ms
                type: integer
                required: true
              - name: kind
                type: string
                enumValues:
                  - Reconnected
                required: true
        headers: []
        jsonPayloadSchema:
          description: >-
            Socket re-established after an outage — `gap_ms` is the wall-clock
            interval since the last received message.
          properties:
            gap_ms:
              format: uint64
              minimum: 0
              type: integer
              x-parser-schema-id: <anonymous-schema-36>
            kind:
              enum:
                - Reconnected
              type: string
              x-parser-schema-id: <anonymous-schema-37>
          required:
            - gap_ms
            - kind
          type: object
          x-parser-schema-id: Reconnected
        title: Reconnected
        description: >-
          Socket re-established after an outage — `gap_ms` is the wall-clock
          interval since the last received message.
        example: |-
          {
            "gap_ms": 0,
            "kind": "Reconnected"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Reconnected
    bindings: []
    extensions: *ref_2
  - &ref_13
    id: fills_receive_Lagged
    title: Lagged
    description: >-
      Slow consumer dropped messages — every affected book is invalidated and
      must be rebuilt from the next `Snapshot`.
    type: receive
    messages:
      - &ref_21
        id: Lagged
        contentType: application/json
        payload:
          - name: Lagged
            description: >-
              Slow consumer dropped messages — every affected book is
              invalidated and must be rebuilt from the next `Snapshot`.
            type: object
            properties:
              - name: dropped
                type: integer
                required: true
              - name: first_seq
                type: integer
                required: true
              - name: kind
                type: string
                enumValues:
                  - Lagged
                required: true
              - name: last_seq
                type: integer
                required: true
        headers: []
        jsonPayloadSchema:
          description: >-
            Slow consumer dropped messages — every affected book is invalidated
            and must be rebuilt from the next `Snapshot`.
          properties:
            dropped:
              format: uint64
              minimum: 0
              type: integer
              x-parser-schema-id: <anonymous-schema-38>
            first_seq:
              format: uint64
              minimum: 0
              type: integer
              x-parser-schema-id: <anonymous-schema-39>
            kind:
              enum:
                - Lagged
              type: string
              x-parser-schema-id: <anonymous-schema-40>
            last_seq:
              format: uint64
              minimum: 0
              type: integer
              x-parser-schema-id: <anonymous-schema-41>
          required:
            - dropped
            - first_seq
            - kind
            - last_seq
          type: object
          x-parser-schema-id: Lagged
        title: Lagged
        description: >-
          Slow consumer dropped messages — every affected book is invalidated
          and must be rebuilt from the next `Snapshot`.
        example: |-
          {
            "dropped": 0,
            "first_seq": 0,
            "kind": "Lagged",
            "last_seq": 0
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Lagged
    bindings: []
    extensions: *ref_2
  - &ref_14
    id: fills_receive_BookInvalidated
    title: BookInvalidated
    description: >-
      A specific market's book is no longer trustworthy — drop cache and wait
      for next `Snapshot` (reasons: `Reconnect`, `Lag`, `SequenceGap`,
      `ExchangeReset`).
    type: receive
    messages:
      - &ref_22
        id: BookInvalidated
        contentType: application/json
        payload:
          - name: BookInvalidated
            description: >-
              A specific market's book is no longer trustworthy — drop cache and
              wait for next `Snapshot` (reasons: `Reconnect`, `Lag`,
              `SequenceGap`, `ExchangeReset`).
            type: object
            properties:
              - name: kind
                type: string
                enumValues:
                  - BookInvalidated
                required: true
              - name: market_id
                type: string
                required: true
              - name: reason
                type: oneOf
                description: >-
                  Why a specific book was invalidated — handed to users so they
                  can decide whether to alert, log, or handle it silently.
                required: true
                properties:
                  - name: SequenceGap
                    type: object
                    required: true
                    properties:
                      - name: expected
                        type: integer
                        required: true
                      - name: received
                        type: integer
                        required: true
        headers: []
        jsonPayloadSchema:
          description: >-
            A specific market's book is no longer trustworthy — drop cache and
            wait for next `Snapshot` (reasons: `Reconnect`, `Lag`,
            `SequenceGap`, `ExchangeReset`).
          properties:
            kind:
              enum:
                - BookInvalidated
              type: string
              x-parser-schema-id: <anonymous-schema-42>
            market_id:
              type: string
              x-parser-schema-id: <anonymous-schema-43>
            reason:
              description: >-
                Why a specific book was invalidated — handed to users so they
                can decide whether to alert, log, or handle it silently.
              oneOf:
                - enum:
                    - Reconnect
                    - Lag
                    - ExchangeReset
                  type: string
                  x-parser-schema-id: <anonymous-schema-29>
                - additionalProperties: false
                  properties:
                    SequenceGap:
                      properties:
                        expected:
                          format: uint64
                          minimum: 0
                          type: integer
                          x-parser-schema-id: <anonymous-schema-32>
                        received:
                          format: uint64
                          minimum: 0
                          type: integer
                          x-parser-schema-id: <anonymous-schema-33>
                      required:
                        - expected
                        - received
                      type: object
                      x-parser-schema-id: <anonymous-schema-31>
                  required:
                    - SequenceGap
                  type: object
                  x-parser-schema-id: <anonymous-schema-30>
              x-parser-schema-id: InvalidationReason
          required:
            - kind
            - market_id
            - reason
          type: object
          x-parser-schema-id: BookInvalidated
        title: Book invalidated
        description: >-
          A specific market's book is no longer trustworthy — drop cache and
          wait for next `Snapshot` (reasons: `Reconnect`, `Lag`, `SequenceGap`,
          `ExchangeReset`).
        example: |-
          {
            "kind": "BookInvalidated",
            "market_id": "example",
            "reason": null
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: BookInvalidated
    bindings: []
    extensions: *ref_2
  - &ref_15
    id: fills_receive_Error
    title: Error
    description: A non-fatal error observed on the connection (session continues).
    type: receive
    messages:
      - &ref_23
        id: Error
        contentType: application/json
        payload:
          - name: Error
            description: A non-fatal error observed on the connection (session continues).
            type: object
            properties:
              - name: kind
                type: string
                enumValues:
                  - Error
                required: true
              - name: message
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          description: A non-fatal error observed on the connection (session continues).
          properties:
            kind:
              enum:
                - Error
              type: string
              x-parser-schema-id: <anonymous-schema-44>
            message:
              type: string
              x-parser-schema-id: <anonymous-schema-45>
          required:
            - kind
            - message
          type: object
          x-parser-schema-id: Error
        title: Error
        description: A non-fatal error observed on the connection (session continues).
        example: |-
          {
            "kind": "Error",
            "message": "example"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: Error
    bindings: []
    extensions: *ref_2
sendOperations:
  - *ref_10
  - *ref_11
  - *ref_12
  - *ref_13
  - *ref_14
  - *ref_15
receiveOperations:
  - *ref_16
  - *ref_17
sendMessages:
  - *ref_18
  - *ref_19
  - *ref_20
  - *ref_21
  - *ref_22
  - *ref_23
receiveMessages:
  - *ref_24
  - *ref_25
extensions:
  - id: x-parser-unique-object-id
    value: fills
securitySchemes: []

````