> ## 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.

# Impact Curve

> Impact Curve WebSocket subscription and response reference.

Connect to `wss://mainnet-ws1.bulk.trade`, then send the subscription below. All channels share the same socket; the page name is not a separate endpoint path. The playground sends read-only subscription messages.

Subscribe to the latest liquidation-size impact curve for one market. The
network endpoint sends the cached curve immediately when available, followed by
executor-published updates.

```json Subscribe theme={null}
{
  "method": "subscribe",
  "subscription": [{
    "type": "impact",
    "symbol": "BTC-USD"
  }]
}
```

```json Update theme={null}
{
  "type": "impact",
  "topic": "impact.BTC-USD",
  "data": {
    "symbol": "BTC-USD",
    "timestamp": 1720000000000000000,
    "full": {
      "buy": { "logMin": -4.605, "logRange": 10.127, "bps": [1.1, 1.3, 1.6] },
      "sell": { "logMin": -4.605, "logRange": 10.127, "bps": [1.2, 1.4, 1.7] }
    },
    "book": {
      "buy": { "logMin": -4.605, "logRange": 10.127, "bps": [0.8, 1.0, 1.2] },
      "sell": null
    }
  }
}
```

* `timestamp` is Unix time in nanoseconds.
* `full` contains adjusted total-impact curves; `book` contains raw order-book
  sweep-cost curves. `buy` consumes asks and `sell` consumes bids.
* A side can be `null` when a curve cannot be formed from the available depth.
  Treat it as unavailable, not zero impact.
* Each non-null curve contains `logMin`, `logRange`, and `bps`. The example
  abbreviates the arrays; use `n = bps.length`. Knot `i` represents quantity
  `exp(logMin + i / (n - 1) * logRange)`. The smallest quantity is `exp(logMin)`.
* No initial event is sent before the executor publishes the first curve for
  that symbol.

The same cached value is available through [`GET
/impact`](https://docs.bulk.trade/api-reference/getImpact.md).

## Connection and Limits

See [connection management](https://docs.bulk.trade/api-reference/ws-connection.md) for reconnect behavior and [public rate limits](https://docs.bulk.trade/api-reference/rate-limits.md) for connection budgets.


## AsyncAPI

````yaml api-reference/asyncapi.yaml impact
id: impact
title: Impact curves
description: >-
  Cached liquidation-size curves when available, then updates. Null sides mean
  unavailable, not zero. Knot i quantity is exp(logMin +
  i/(bps.length-1)*logRange). Connect, then send subscribe; unsubscribe uses the
  acknowledged topic. 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: impactSubscribe
    title: Impact curves subscribe
    type: receive
    messages:
      - &ref_3
        id: subscribe
        contentType: application/json
        payload:
          - name: Impact curves 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 example prefill. Send the subscription array
                  explicitly; this is not a network-side default.
                required: true
                properties:
                  - name: type
                    type: string
                    enumValues:
                      - impact
                    required: true
                  - name: symbol
                    type: string
                    description: Playground example prefill; not a network-side default.
                    required: true
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            method:
              type: string
              enum:
                - subscribe
              default: subscribe
              x-parser-schema-id: <anonymous-schema-201>
            subscription:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - impact
                    default: impact
                    x-parser-schema-id: <anonymous-schema-204>
                  symbol:
                    type: string
                    default: BTC-USD
                    description: Playground example prefill; not a network-side default.
                    x-parser-schema-id: <anonymous-schema-205>
                required:
                  - type
                  - symbol
                x-parser-schema-id: <anonymous-schema-203>
              minItems: 1
              default:
                - type: impact
                  symbol: BTC-USD
              description: >-
                Playground example prefill. Send the subscription array
                explicitly; this is not a network-side default.
              x-parser-schema-id: <anonymous-schema-202>
          required:
            - method
            - subscription
          x-parser-schema-id: <anonymous-schema-200>
        title: Impact curves 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": "impact",
                "symbol": "BTC-USD"
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: impact
  - &ref_2
    id: impactEvents
    title: Impact curves events
    type: send
    messages:
      - &ref_4
        id: impact
        contentType: application/json
        payload:
          - name: Impact curves impact
            description: Network-published impact
            type: object
            properties:
              - name: type
                type: string
                enumValues:
                  - impact
                required: true
              - name: topic
                type: string
                required: true
              - name: data
                type: object
                required: true
                properties:
                  - name: symbol
                    type: string
                    required: false
                  - name: timestamp
                    type: number
                    description: Unix timestamp in nanoseconds.
                    required: false
                  - name: full
                    type: object
                    required: false
                    properties:
                      - name: buy
                        type: object
                        required: false
                        properties:
                          - name: logMin
                            type: number
                            description: Natural logarithm of the smallest size knot.
                            required: true
                          - name: logRange
                            type: number
                            description: Natural-log span across size knots.
                            required: true
                          - name: bps
                            type: array
                            description: >-
                              Impact in basis points at each logarithmically
                              spaced quantity knot.
                            required: true
                            properties:
                              - name: item
                                type: number
                                required: false
                      - name: sell
                        type: object
                        required: false
                        properties:
                          - name: logMin
                            type: number
                            description: Natural logarithm of the smallest size knot.
                            required: true
                          - name: logRange
                            type: number
                            description: Natural-log span across size knots.
                            required: true
                          - name: bps
                            type: array
                            description: >-
                              Impact in basis points at each logarithmically
                              spaced quantity knot.
                            required: true
                            properties:
                              - name: item
                                type: number
                                required: false
                  - name: book
                    type: object
                    required: false
                    properties:
                      - name: buy
                        type: object
                        required: false
                        properties:
                          - name: logMin
                            type: number
                            description: Natural logarithm of the smallest size knot.
                            required: true
                          - name: logRange
                            type: number
                            description: Natural-log span across size knots.
                            required: true
                          - name: bps
                            type: array
                            description: >-
                              Impact in basis points at each logarithmically
                              spaced quantity knot.
                            required: true
                            properties:
                              - name: item
                                type: number
                                required: false
                      - name: sell
                        type: object
                        required: false
                        properties:
                          - name: logMin
                            type: number
                            description: Natural logarithm of the smallest size knot.
                            required: true
                          - name: logRange
                            type: number
                            description: Natural-log span across size knots.
                            required: true
                          - name: bps
                            type: array
                            description: >-
                              Impact in basis points at each logarithmically
                              spaced quantity knot.
                            required: true
                            properties:
                              - name: item
                                type: number
                                required: false
        headers: []
        jsonPayloadSchema:
          type: object
          properties:
            type:
              type: string
              enum:
                - impact
              x-parser-schema-id: <anonymous-schema-207>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-208>
            data:
              type: object
              properties:
                symbol:
                  type: string
                  x-parser-schema-id: <anonymous-schema-210>
                timestamp:
                  type: number
                  description: Unix timestamp in nanoseconds.
                  x-parser-schema-id: <anonymous-schema-211>
                full:
                  type: object
                  properties:
                    buy:
                      anyOf:
                        - type: object
                          required:
                            - logMin
                            - logRange
                            - bps
                          properties:
                            logMin:
                              type: number
                              description: Natural logarithm of the smallest size knot.
                              x-parser-schema-id: <anonymous-schema-215>
                            logRange:
                              type: number
                              description: Natural-log span across size knots.
                              x-parser-schema-id: <anonymous-schema-216>
                            bps:
                              type: array
                              items:
                                type: number
                                x-parser-schema-id: <anonymous-schema-218>
                              description: >-
                                Impact in basis points at each logarithmically
                                spaced quantity knot.
                              x-parser-schema-id: <anonymous-schema-217>
                          x-parser-schema-id: <anonymous-schema-214>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-219>
                      x-parser-schema-id: <anonymous-schema-213>
                    sell:
                      anyOf:
                        - type: object
                          required:
                            - logMin
                            - logRange
                            - bps
                          properties:
                            logMin:
                              type: number
                              description: Natural logarithm of the smallest size knot.
                              x-parser-schema-id: <anonymous-schema-222>
                            logRange:
                              type: number
                              description: Natural-log span across size knots.
                              x-parser-schema-id: <anonymous-schema-223>
                            bps:
                              type: array
                              items:
                                type: number
                                x-parser-schema-id: <anonymous-schema-225>
                              description: >-
                                Impact in basis points at each logarithmically
                                spaced quantity knot.
                              x-parser-schema-id: <anonymous-schema-224>
                          x-parser-schema-id: <anonymous-schema-221>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-226>
                      x-parser-schema-id: <anonymous-schema-220>
                  x-parser-schema-id: <anonymous-schema-212>
                book:
                  type: object
                  properties:
                    buy:
                      anyOf:
                        - type: object
                          required:
                            - logMin
                            - logRange
                            - bps
                          properties:
                            logMin:
                              type: number
                              description: Natural logarithm of the smallest size knot.
                              x-parser-schema-id: <anonymous-schema-230>
                            logRange:
                              type: number
                              description: Natural-log span across size knots.
                              x-parser-schema-id: <anonymous-schema-231>
                            bps:
                              type: array
                              items:
                                type: number
                                x-parser-schema-id: <anonymous-schema-233>
                              description: >-
                                Impact in basis points at each logarithmically
                                spaced quantity knot.
                              x-parser-schema-id: <anonymous-schema-232>
                          x-parser-schema-id: <anonymous-schema-229>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-234>
                      x-parser-schema-id: <anonymous-schema-228>
                    sell:
                      anyOf:
                        - type: object
                          required:
                            - logMin
                            - logRange
                            - bps
                          properties:
                            logMin:
                              type: number
                              description: Natural logarithm of the smallest size knot.
                              x-parser-schema-id: <anonymous-schema-237>
                            logRange:
                              type: number
                              description: Natural-log span across size knots.
                              x-parser-schema-id: <anonymous-schema-238>
                            bps:
                              type: array
                              items:
                                type: number
                                x-parser-schema-id: <anonymous-schema-240>
                              description: >-
                                Impact in basis points at each logarithmically
                                spaced quantity knot.
                              x-parser-schema-id: <anonymous-schema-239>
                          x-parser-schema-id: <anonymous-schema-236>
                        - type: 'null'
                          x-parser-schema-id: <anonymous-schema-241>
                      x-parser-schema-id: <anonymous-schema-235>
                  x-parser-schema-id: <anonymous-schema-227>
              x-parser-schema-id: <anonymous-schema-209>
          required:
            - type
            - data
            - topic
          x-parser-schema-id: <anonymous-schema-206>
        title: Impact curves impact
        description: Network-published impact
        example: |-
          {
            "type": "impact",
            "topic": "impact.BTC-USD",
            "data": {
              "symbol": "BTC-USD",
              "timestamp": 1720000000000000000,
              "full": {
                "buy": {
                  "logMin": -4.605,
                  "logRange": 10.127,
                  "bps": [
                    1.1,
                    1.3,
                    1.6
                  ]
                },
                "sell": {
                  "logMin": -4.605,
                  "logRange": 10.127,
                  "bps": [
                    1.2,
                    1.4,
                    1.7
                  ]
                }
              },
              "book": {
                "buy": {
                  "logMin": -4.605,
                  "logRange": 10.127,
                  "bps": [
                    0.8,
                    1,
                    1.2
                  ]
                },
                "sell": null
              }
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: impact
      - &ref_5
        id: subscribed
        contentType: application/json
        payload:
          - name: Impact curves 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-243>
            topics:
              type: array
              items:
                type: string
                x-parser-schema-id: <anonymous-schema-245>
              x-parser-schema-id: <anonymous-schema-244>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-242>
        title: Impact curves subscribed
        example: |-
          {
            "type": "subscriptionResponse",
            "topics": [
              "impact.BTC-USD"
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
      - &ref_6
        id: unsubscribed
        contentType: application/json
        payload:
          - name: Impact curves 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-247>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-248>
          required:
            - type
          x-parser-schema-id: <anonymous-schema-246>
        title: Impact curves unsubscribed
        example: |-
          {
            "type": "unsubscribeResponse",
            "topic": "impact.BTC-USD"
          }
        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: impact
securitySchemes: []

````

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