WhiteBIT · AsyncAPI Specification

WhiteBit Deals

Version 1.0.0

Get and subscribe to deals/trades updates. **Important**: [Market](/glossary#market) should exist. The maximum limit is 100. **Note**: Update events use ARRAY format, not object format.

View Spec View on GitHub CompanyCryptocurrencyExchangeTradingWebSocketAsyncAPIEventsWebSockets

Channels

/ws
Deals operations

Messages

✉
dealsRequest
Deals Query
Get user deals/trades
✉
dealsResponse
Deals Response
Paginated list of deals
✉
dealsSubscribe
Subscribe to Deals
Subscribe to deals updates (Update interval: real-time)
✉
dealsSubscribeResponse
Subscribe Response
Subscription confirmation
✉
dealsUpdate
Deals Update
New trade execution
✉
dealsUnsubscribe
Unsubscribe from Deals
Stop receiving deals updates
✉
dealsUnsubscribeResponse
Unsubscribe Response
Unsubscription confirmation

Servers

wss
production
WhiteBIT Global Server
wss
eu
WhiteBIT EU Server

AsyncAPI Specification

Raw ↑
asyncapi: 3.0.0
info:
  title: WhiteBit Deals
  version: 1.0.0
  description: |
    Get and subscribe to deals/trades updates.

    **Important**: [Market](/glossary#market) should exist. The maximum limit is 100.

    **Note**: Update events use ARRAY format, not object format.
  x-auth-required: true
  x-rate-limits:
    connections-per-minute: 1000
    requests-per-10-seconds: 12000

servers:
  production:
    host: wss.whitebit.com
    protocol: wss
    description: WhiteBIT Global Server
  eu:
    host: api.whitebit.eu
    protocol: wss
    description: WhiteBIT EU Server

channels:
  /ws:
    address: /ws
    description: Deals operations
    messages:
      dealsRequest:
        $ref: '#/components/messages/dealsRequest'
      dealsResponse:
        $ref: '#/components/messages/dealsResponse'
      dealsSubscribe:
        $ref: '#/components/messages/dealsSubscribe'
      dealsSubscribeResponse:
        $ref: '#/components/messages/dealsSubscribeResponse'
      dealsUpdate:
        $ref: '#/components/messages/dealsUpdate'
      dealsUnsubscribe:
        $ref: '#/components/messages/dealsUnsubscribe'
      dealsUnsubscribeResponse:
        $ref: '#/components/messages/dealsUnsubscribeResponse'

operations:
  sendDealsRequest:
    action: receive
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsRequest'

  receiveDealsResponse:
    action: send
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsResponse'

  sendDealsSubscribe:
    action: receive
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsSubscribe'

  receiveDealsSubscribeResponse:
    action: send
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsSubscribeResponse'

  receiveDealsUpdates:
    action: send
    description: "Receive real-time deals updates (Update interval: real-time)"
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsUpdate'

  sendDealsUnsubscribe:
    action: receive
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsUnsubscribe'

  receiveDealsUnsubscribeResponse:
    action: send
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/dealsUnsubscribeResponse'

components:
  messages:
    dealsRequest:
      name: DealsRequest
      title: Deals Query
      summary: Get user deals/trades
      payload:
        $ref: '#/components/schemas/DealsRequest'
      examples:
        - name: queryDeals
          summary: |
            Query user deals with parameters:
            - params[0]: Market name (BTC_USDT)
            - params[1]: Offset for pagination (0)
            - params[2]: Limit, maximum 100 (30)
          payload:
            id: 14
            method: deals_request
            params:
              - "BTC_USDT"
              - 0
              - 30

    dealsResponse:
      name: DealsResponse
      title: Deals Response
      summary: Paginated list of deals
      payload:
        $ref: '#/components/schemas/DealsResponse'
      examples:
        - name: dealsResponse
          summary: Deals response
          payload:
            id: 14
            result:
              limit: 100
              offset: 0
              records:
                - time: 1738230617.8867061
                  id: 13663227034
                  side: 1
                  role: 2
                  price: "105361.32"
                  amount: "0.160998"
                  deal: "16962.96179736"
                  fee: "1.696296179736"
                  order_id: 1212266594338
                  deal_order_id: 1212266160846
                  market: "BTC_USDT"
                  client_order_id: ""
                  fee_asset: "USDT"
            error: null

    dealsSubscribe:
      name: DealsSubscribe
      title: Subscribe to Deals
      summary: "Subscribe to deals updates (Update interval: real-time)"
      payload:
        $ref: '#/components/schemas/DealsSubscribe'
      examples:
        - name: subscribeToDeals
          summary: |
            Subscribe to deals updates:
            - params[0]: Array of market names (BTC_USDT, ETH_BTC)
          payload:
            id: 15
            method: deals_subscribe
            params:
              - - "BTC_USDT"
                - "ETH_BTC"

    dealsSubscribeResponse:
      name: DealsSubscribeResponse
      title: Subscribe Response
      summary: Subscription confirmation
      payload:
        $ref: '#/components/schemas/SubscriptionResponse'
      examples:
        - name: subscriptionSuccess
          summary: Subscription successful
          payload:
            id: 15
            result:
              status: success
            error: null

    dealsUpdate:
      name: DealsUpdate
      title: Deals Update
      summary: New trade execution
      payload:
        $ref: '#/components/schemas/DealsUpdate'
      examples:
        - name: dealUpdate
          summary: |
            Deal update event with 11-element array format:
            - params[0]: Deal ID (13674578673)
            - params[1]: Deal time Unix timestamp (1738251095.345432)
            - params[2]: Market name (ETH_BTC)
            - params[3]: Order ID (1212909726406)
            - params[4]: Deal price (0.03084)
            - params[5]: Stock amount (0.2625)
            - params[6]: Deal fee (0.0002625)
            - params[7]: Custom client order ID (may be empty string)
            - params[8]: Side - 1=sell, 2=buy
            - params[9]: Role - 1=maker, 2=taker
            - params[10]: Fee asset type (ETH)
          payload:
            id: null
            method: deals_update
            params:
              - 13674578673
              - 1738251095.345432
              - "ETH_BTC"
              - 1212909726406
              - "0.03084"
              - "0.2625"
              - "0.0002625"
              - ""
              - 2
              - 2
              - "ETH"

    dealsUnsubscribe:
      name: DealsUnsubscribe
      title: Unsubscribe from Deals
      summary: Stop receiving deals updates
      payload:
        $ref: '#/components/schemas/UnsubscribeRequest'
      examples:
        - name: unsubscribe
          summary: Unsubscribe from deals
          payload:
            id: 16
            method: deals_unsubscribe
            params: []

    dealsUnsubscribeResponse:
      name: DealsUnsubscribeResponse
      title: Unsubscribe Response
      summary: Unsubscription confirmation
      payload:
        $ref: '#/components/schemas/SubscriptionResponse'
      examples:
        - name: unsubscribeSuccess
          summary: Unsubscription successful
          payload:
            id: 16
            result:
              status: success
            error: null

  schemas:
    DealsRequest:
      type: object
      required:
        - id
        - method
        - params
      properties:
        id:
          type: integer
          description: Unique request identifier
        method:
          type: string
          const: deals_request
          description: "Method name. Fixed value: `deals_request`."
        params:
          type: array
          description: |
            Query parameters tuple:
            - [0] Market name (STRING)
            - [1] Offset (INTEGER)
            - [2] Limit (INTEGER, max 100)
          minItems: 3
          maxItems: 3
          items:
            - type: string
              description: "[Market](/glossary#market) name. Example: BTC_USDT"
              x-field-name: market
              x-required: true
              x-example: "BTC_USDT"
            - type: integer
              description: "Offset for pagination"
              x-field-name: offset
              x-required: true
              x-example: 0
            - type: integer
              description: "Limit (maximum 100)"
              x-field-name: limit
              x-required: true
              x-example: 30

    DealsResponse:
      type: object
      required:
        - id
        - result
        - error
      properties:
        id:
          type: integer
          description: Request identifier matching the request
        result:
          type: object
          properties:
            limit:
              type: integer
              description: "Limit from request"
            offset:
              type: integer
              description: "Offset from request"
            records:
              type: array
              items:
                type: object
                properties:
                  time:
                    type: number
                    description: "Deal time in Unix time"
                  id:
                    type: integer
                    description: "Deal ID"
                  side:
                    type: integer
                    enum: [1, 2]
                    description: "Side: 1=sell, 2=buy/bid"
                  role:
                    type: integer
                    enum: [1, 2]
                    description: "Role: 1=[maker](/glossary#maker), 2=taker"
                  price:
                    type: string
                    description: "Deal price"
                  amount:
                    type: string
                    description: "[Stock](/glossary#stock) amount"
                  deal:
                    type: string
                    description: "[Money](/glossary#money) amount"
                  fee:
                    type: string
                    description: "Deal fee expressed in asset in fee_asset"
                  order_id:
                    type: integer
                    description: "Order ID"
                  deal_order_id:
                    type: integer
                    description: "Counterparty Order ID"
                  market:
                    type: string
                    description: "[Market](/glossary#market)"
                  client_order_id:
                    type: string
                    description: "Client Order ID"
                  fee_asset:
                    type: string
                    description: "Fee asset type"
        error:
          type: "null"
          description: Error object (null on success)

    DealsSubscribe:
      type: object
      required:
        - id
        - method
        - params
      properties:
        id:
          type: integer
          description: Unique request identifier
        method:
          type: string
          const: deals_subscribe
          description: "Method name. Fixed value: `deals_subscribe`."
        params:
          type: array
          minItems: 1
          maxItems: 1
          items:
            type: array
            items:
              type: string
              description: "[Market](/glossary#market). Example: BTC_USDT"
          description: "Array containing array of markets"

    SubscriptionResponse:
      type: object
      required:
        - id
        - result
        - error
      properties:
        id:
          type: integer
          description: Request identifier matching the request
        result:
          type: object
          required:
            - status
          properties:
            status:
              type: string
              const: success
              description: "Fixed value: `success`."
        error:
          type: "null"
          description: Error object (null on success)

    DealsUpdate:
      type: object
      required:
        - id
        - method
        - params
      properties:
        id:
          type: "null"
          description: Update events have null id
        method:
          type: string
          const: deals_update
          description: "Method name. Fixed value: `deals_update`."
        params:
          type: array
          description: |
            Update event tuple (11 elements):
            - [0] Deal ID
            - [1] Deal time (Unix timestamp)
            - [2] Market
            - [3] Order ID
            - [4] Price
            - [5] Stock amount
            - [6] Deal fee
            - [7] Client order ID
            - [8] Side (1=sell, 2=buy)
            - [9] Role (1=maker, 2=taker)
            - [10] Fee asset
          minItems: 11
          maxItems: 11
          items:
            - type: integer
              description: Unique deal ID
              x-field-name: deal_id
              x-example: "13674578673"
            - type: number
              description: Unix timestamp of execution
              x-field-name: time
              x-example: "1738251095.345432"
            - type: string
              description: Market name
              x-field-name: market
              x-example: '"ETH_BTC"'
            - type: integer
              description: Order ID
              x-field-name: order_id
              x-example: "1212909726406"
            - type: string
              description: Execution price
              x-field-name: price
              x-example: '"0.03084"'
            - type: string
              description: Stock amount executed
              x-field-name: amount
              x-example: '"0.2625"'
            - type: string
              description: Fee charged
              x-field-name: fee
              x-example: '"0.0002625"'
            - type: string
              description: Custom client order ID (may be empty)
              x-field-name: client_order_id
              x-example: '""'
            - type: integer
              enum: [1, 2]
              description: "1 = sell, 2 = buy"
              x-field-name: side
              x-example: "2"
            - type: integer
              enum: [1, 2]
              description: "1 = maker, 2 = taker"
              x-field-name: role
              x-example: "2"
            - type: string
              description: Asset in which fee was charged
              x-field-name: fee_asset
              x-example: '"ETH"'

    UnsubscribeRequest:
      type: object
      required:
        - id
        - method
        - params
      properties:
        id:
          type: integer
          description: Unique request identifier
        method:
          type: string
          const: deals_unsubscribe
          description: "Method name. Fixed value: `deals_unsubscribe`."
        params:
          type: array
          items: {}
          maxItems: 0
          description: Empty array for unsubscribe

Work with this as data

Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for asyncapi

4 MCP tools reach this
  • find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This AsyncAPI spec
curl "https://apis.io/api/v1/asyncapis/whitebit-private-deals-asyncapi"
All asyncapi
curl "https://apis.io/api/v1/asyncapis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.