Sources
Market data sources and exact runtime selectors for Market Lab scripts.
Sources
The manifest declares base source kinds. Runtime flags bind those kinds to concrete providers and exchanges.
--source <selector>:<key>=<value>Selectors
MMT is a multi-exchange provider, so its selector includes both exchange and provider:
--source candles@binancef@mmt:timeframe=60
--source candles@hyperliquid@mmt:timeframe=30
--source oi@binancef@mmt:timeframe=60BULK remains its own exchange selector even when it is combined with MMT data:
--source orderbook@bulk:depth=20
--source candles@bulk:timeframe=5There are no script-level --provider or --exchange flags. The source selector contains that information. This lets one script consume MMT and BULK, or several MMT exchanges, at the same time.
Example:
mlab script run ./scripts/cross-market.js \
--symbol BTC/USDT \
--source candles@binancef@mmt:timeframe=5 \
--source candles@hyperliquid@mmt:timeframe=5 \
--source orderbook@bulk:depth=20The manifest still lists each required base kind once:
export const script = {
name: 'cross-market',
version: '1',
sources: ['candles', 'orderbook'],
params: {},
}Market Lab validates that every configured kind appears in script.sources and that every manifest kind has at least one concrete selector.
Runtime Access
Use the same exact selector with history.source:
const binance = history.source('candles@binancef@mmt')
const hyperliquid = history.source('candles@hyperliquid@mmt')
const bulkBook = history.source('orderbook@bulk', 0)Market records are not duplicated under input.candles, input.sources, or input.data. input carries metadata:
input.source // exact selector that triggered this hook
input.source_type // base source kind
input.source_configs['candles@binancef@mmt'].timeframe_secAvailable sources:
| Source | MMT backtest | MMT live | BULK backtest | BULK live |
|---|---|---|---|---|
candles | Yes | Yes | Yes | Yes |
orderbook | Yes | Yes | No | Yes |
vd | Yes | Yes | No | Yes, trade-derived |
oi | Yes | Yes | No | Yes, snapshots |
volumes | Yes | Yes | Yes | Yes |
Config keys:
| Source | Config |
|---|---|
candles | timeframe |
orderbook | backtest: timeframe, optional depth; live: optional depth |
vd | MMT: timeframe, bucket; BULK live: neither |
oi | MMT: timeframe; BULK live: no timeframe |
volumes | timeframe |
The timeframe value is always an integer number of seconds. Support for arbitrary intervals is specific to live candles; other time-series sources and historical data retain provider-supported intervals.
See Source History for list/index semantics and Candles Source for live aggregation details.