# Trades (/scripting-v2/sources/trades)



The `trades` source sends each accepted WebSocket trade to `on_data`:

```python
history.source("btc@trades@bulkf")
history.source("btc@trades@hyperliquidf")
history.source("btc@trades@binancef@mmt")
```

```python
SOURCE = "btc@trades@bulkf"


def on_data(ctx, history):
    if ctx.source != SOURCE:
        return

    trades = history.source(SOURCE)
    latest = history.source(SOURCE, 0)
```

Each record contains only `price` and `size`. The selector already identifies the symbol, exchange, and provider. Timestamps and aggressor side remain internal.

Trades are live-only. Backtests must use historical candles because Market Lab does not claim to reconstruct tick ordering from candle data.

When a script requests both MMT trades and trade-derived candles for the same market, Market Lab reuses one underlying trade subscription.

See [Trade Data](/scripting-v2/data-types/trades).
