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

# Fills

> Track executions, fees, and the account's side of each trade.

Use `fill` events to record executions for an account. Subscribe through the
public [account stream](https://docs.bulk.trade/api-reference/ws-account.md), without a signature.
There is no network-side filter for fills: other account events arrive on the
same subscription.

## When it arrives

A fill is emitted for each trade execution, alongside separate order-state
updates. `isBuy` describes this account's side, while `maker` identifies its
role in the execution. The maker and taker views have opposite directions.
Liquidation and ADL executions are distinguished by their reason fields.

## Handling

Retain `orderId`, the account, and isolated-account identity when recording a
fill. Treat `tradeId` as an opaque, network-local execution ID: maker, taker,
and isolated views of one execution share it. Do not deduplicate different
account-side records solely by `tradeId`, or interpret gaps as missing fills.
IDs are not portable across forks or networks.

On reconnect, reconcile through [paginated account history](https://docs.bulk.trade/api-reference/getAccount.md#history-queries).
HTTP fill history does not expose `tradeId`; it provides `slot`, `sequence`,
`orderIdMaker`, and `orderIdTaker`. Preserve account and isolated identity when
matching historical rows to live events. A fresh account snapshot restores
current state but does not replay missed fills.


## AsyncAPI

````yaml api-reference/asyncapi.yaml account-fills
id: account-fills
title: Fills
description: >-
  Public read-only account subscription; no signature. This channel is a
  documentation view of selected messages, not a network-side event filter.
  Every view sends the same account subscription and the live connection can
  receive all account event types. Wait for accountSnapshot before treating
  account state as ready. Snapshot replaces state; identify positions by symbol
  and isoPubkey and subscribe to subaccounts separately. No replay cursor. Save
  the acknowledged topic for unsubscribe. Unsubscribe using the acknowledged
  topic; see [Connection Management](/api-reference/ws-connection#unsubscribe).
servers:
  - id: mainnet
    protocol: wss
    host: mainnet-ws1.bulk.trade
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: exchange-ws1.bulk.trade
    bindings: []
    variables: []
address: /
parameters: []
bindings: []
operations:
  - &ref_1
    id: account-fillsSubscribe
    title: Subscribe
    type: receive
    messages:
      - &ref_3
        id: subscribe
        contentType: application/json
        payload:
          - name: Subscribe
            description: >-
              Schema defaults on this request are playground example prefills,
              not omitted-field defaults accepted by the network endpoint.
            type: object
            properties:
              - name: method
                type: string
                enumValues:
                  - subscribe
                required: true
              - name: subscription
                type: array
                description: >-
                  Playground form template only. Paste an account public key
                  into user before sending; the blank value is not a valid
                  account and no account is preselected.
                required: true
                properties:
                  - name: type
                    type: string
                    enumValues:
                      - account
                    required: true
                  - name: user
                    type: oneOf
                    description: >-
                      Paste the account public key to observe. No account is
                      preselected.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            method:
              type: string
              enum:
                - subscribe
              default: subscribe
              x-parser-schema-id: <anonymous-schema-312>
            subscription:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - account
                    default: account
                    x-parser-schema-id: <anonymous-schema-315>
                  user:
                    oneOf:
                      - type: string
                        description: Account public key in base58.
                        x-parser-schema-id: <anonymous-schema-317>
                      - type: array
                        minItems: 1
                        items:
                          type: string
                          x-parser-schema-id: <anonymous-schema-319>
                        x-parser-schema-id: <anonymous-schema-318>
                    description: >-
                      Paste the account public key to observe. No account is
                      preselected.
                    x-parser-schema-id: <anonymous-schema-316>
                required:
                  - type
                  - user
                x-parser-schema-id: <anonymous-schema-314>
              minItems: 1
              default:
                - type: account
                  user: ''
              description: >-
                Playground form template only. Paste an account public key into
                user before sending; the blank value is not a valid account and
                no account is preselected.
              x-parser-schema-id: <anonymous-schema-313>
          required:
            - method
            - subscription
          x-parser-schema-id: <anonymous-schema-311>
        title: Subscribe
        description: >-
          Schema defaults on this request are playground example prefills, not
          omitted-field defaults accepted by the network endpoint.
        example: |-
          {
            "method": "subscribe",
            "subscription": [
              {
                "type": "account",
                "user": "FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: account-fills
  - &ref_2
    id: account-fillsEvents
    title: Receive events
    type: send
    messages:
      - &ref_4
        id: fill
        contentType: application/json
        payload:
          - name: Fill
            description: Network-published fill
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - account
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: type
                    type: string
                    enumValues:
                      - fill
                    required: true
                  - name: tradeId
                    type: string
                    required: false
                  - name: symbol
                    type: string
                    required: false
                  - name: orderId
                    type: string
                    required: false
                  - name: price
                    type: number
                    required: false
                  - name: size
                    type: number
                    required: false
                  - name: fee
                    type: number
                    required: false
                  - name: isBuy
                    type: boolean
                    required: false
                  - name: reasonCode
                    type: number
                    required: false
                  - name: counterpartyHint
                    type: string
                    required: false
                  - name: timestamp
                    type: number
                    description: Unix timestamp in nanoseconds.
                    required: false
                  - name: maker
                    type: boolean
                    required: false
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - account
              x-parser-schema-id: <anonymous-schema-503>
            data:
              type: object
              properties:
                type:
                  type: string
                  enum:
                    - fill
                  x-parser-schema-id: <anonymous-schema-505>
                tradeId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-506>
                symbol:
                  type: string
                  x-parser-schema-id: <anonymous-schema-507>
                orderId:
                  type: string
                  x-parser-schema-id: <anonymous-schema-508>
                price:
                  type: number
                  x-parser-schema-id: <anonymous-schema-509>
                size:
                  type: number
                  x-parser-schema-id: <anonymous-schema-510>
                fee:
                  type: number
                  x-parser-schema-id: <anonymous-schema-511>
                isBuy:
                  type: boolean
                  x-parser-schema-id: <anonymous-schema-512>
                reasonCode:
                  type: number
                  x-parser-schema-id: <anonymous-schema-513>
                counterpartyHint:
                  type: string
                  x-parser-schema-id: <anonymous-schema-514>
                timestamp:
                  type: number
                  description: Unix timestamp in nanoseconds.
                  x-parser-schema-id: <anonymous-schema-515>
                maker:
                  type: boolean
                  x-parser-schema-id: <anonymous-schema-516>
              required:
                - type
              x-parser-schema-id: <anonymous-schema-504>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-517>
          required:
            - type
            - data
            - topic
          x-parser-schema-id: <anonymous-schema-502>
        title: Fill
        description: Network-published fill
        example: |-
          {
            "type": "account",
            "data": {
              "type": "fill",
              "tradeId": "34554078:127",
              "symbol": "BTC-USD",
              "orderId": "Fpa3oVuL3UzjNANAMZZdmrn6D1Zhk83GmBuJpuAWG51F",
              "price": 102000,
              "size": 0.05,
              "fee": 0.35,
              "isBuy": true,
              "reasonCode": 0,
              "counterpartyHint": "5Am6..nVux",
              "timestamp": 1763316177219383300,
              "maker": false
            },
            "topic": "account.FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: fill
      - &ref_5
        id: subscribed
        contentType: application/json
        payload:
          - name: Subscribed
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - subscriptionResponse
                required: true
              - name: topics
                type: array
                required: false
                properties:
                  - name: item
                    type: string
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - subscriptionResponse
              x-parser-schema-id: <anonymous-schema-418>
            topics:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-420>
              x-parser-schema-id: <anonymous-schema-419>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-417>
        title: Subscribed
        example: |-
          {
            "type": "subscriptionResponse",
            "topics": [
              "account.FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
      - &ref_6
        id: unsubscribed
        contentType: application/json
        payload:
          - name: Unsubscribed
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - unsubscribeResponse
                required: true
              - name: topic
                type: string
                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - unsubscribeResponse
              x-parser-schema-id: <anonymous-schema-422>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-423>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-421>
        title: Unsubscribed
        example: |-
          {
            "type": "unsubscribeResponse",
            "topic": "account.FuueqefENiGEW6uMqZQgmwjzgpnb85EgUcZa5Em4PQh7"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribed
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
receiveOperations:
  - *ref_2
sendMessages:
  - *ref_3
receiveMessages:
  - *ref_4
  - *ref_5
  - *ref_6
extensions:
  - id: x-parser-unique-object-id
    value: account-fills
securitySchemes: []

````

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