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

# Market Trades

> Subscribe to real-time trade execution updates for a trading pair via WhiteBIT WebSocket.

WebSocket URL

:

Subscribe to real-time trade execution updates for one or more markets. Each message delivers a batch of trade objects containing price, quantity, trade direction, and execution timestamp. The channel supports both targeted subscriptions for specific markets and a wildcard subscription for all available markets.

> [!NOTE]
>
> Connect to `wss://wss.whitebit.com/ws` — see [WebSocket Overview](/websocket/overview) for protocol details and keepalive requirements.

## Rate limits

<table>
  <thead>
    <tr />
  </thead>

  <tbody />
</table>

## Query recent trades (one-time)

Fetch recent trades for a market without subscribing.

Index

Field

Description

**Request**

json

**Response**

json

## Subscribe to trades

> [!WARNING]
>
> For each WebSocket connection, subscribe to either specific markets or all markets. **Every new subscription replaces the existing one.**

To add or remove markets on an active subscription, resubscribe with the full target list — see [Managing subscriptions](/websocket/market-streams/overview#managing-subscriptions).

> [!NOTE]
>
> **Initial snapshot.** On subscribe, the server first sends a snapshot — one `trades_update` carrying up to 100 of the latest trades per market, ordered newest first — then streams new trades in real time. Resubscribing replays this snapshot, so deduplicate by trade `id`.

**Send subscription request**

Pass market name strings in params to subscribe to specific markets. params\[0], params\[1], ... — market name (STRING, e.g. BTC\_USDT). Pass an empty array to subscribe to all markets.

**Receive confirmation**

**Receive real-time updates**

The first trades\_update after the confirmation is the initial snapshot — up to 100 of the latest trades, newest first. New trades then stream in real time. In every message, params\[0] is the market name and params\[1] is an array of trade objects.

**Unsubscribe**

**Subscribe to all markets:**

json

## Update frequency

Updates are pushed in **real time** on each trade execution.

## Unsubscribe

Send `trades_unsubscribe` with an empty `params` array to stop receiving trade updates on the connection. There is no per-market unsubscribe — to keep a subset of markets, resubscribe with the markets to retain. See [Managing subscriptions](/websocket/market-streams/overview#managing-subscriptions).

## Error codes

## RPI orders in trade updates

Trade updates can include executions originating from RPI orders:

* `rpi: true` — the trade involved a Retail Price Improvement (RPI) order
* `rpi: false` or absent — regular trade

> [!NOTE]
>
> Public market data feeds do not expose RPI orders as visible liquidity in `depth` or `bookTicker`. RPI orders remain visible only in private active orders and in the exchange UI order book (web and mobile).

## Trade object

Field

Type

Description

## Related resources

* [Recent trades](/api-reference/market-data/recent-trades) — latest executed trades via REST for polling use cases.


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