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

# Recent Trades

> Getting recent trade executions on a market

## Real-Time Updates via WebSocket

To receive recent trade executions, use the [WebSocket](/latest/perps/websocket-api/overview) API and subscribe to the [Public Trade Stream](/latest/perps/websocket-api/trade-stream).
To bootstrap your recent trades data, send an `emitPublicCompletedOrders` request to receive an initial snapshot, then apply subsequent `publicCompletedOrdersDelta` updates sequentially.

## Understanding Recent Trades Messages

* **Both sides included**: Each execution is represented by taker and maker sides.
* **Batched messages**: Updates may arrive in batches for efficiency.
* **Per-market streams**: Messages are emitted per subscribed market.
* **Timestamps**: Entries include an execution timestamp (i.e., `updatedAt` in milliseconds).

## Processing Notes

* Sort or display trades by `updatedAt` for chronological views.
* Use `matchId` to correlate or deduplicate multi-side entries for the same trade.
* Expect batches; process sequentially to retain order.
