MarketlabMarketlabDocs

Trades

Consume live normalized trades in Python V2.

The trades source sends each accepted live trade to on_data:

history.source("btc@trades@bulkf")
history.source("btc@trades@hyperliquidf")
history.source("btc@trades@binancef@mmt")
SOURCE = "btc@trades@bulkf"


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

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

Ordinary exchange records contain price and size. The selector already identifies the symbol, exchange, and provider. Their timestamps and aggressor side remain internal.

Elysium trades additionally carry onchain: exact amounts, fees, current price, observed volume, contract state and transaction identity. Use the pool or bonding contract address as the symbol.

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.