MarketLab Docs

CLI Reference

High-level command map for the current Market Lab CLI surface.

CLI Reference

Current top-level commands:

  • markets
  • inspect
  • replay
  • source
  • study
  • script
  • strategy
  • health
  • status
  • upgrade

Markets

Inspect an embedded provider market catalog and trading rules.

Current catalog provider:

  • bulk

List the local snapshot:

mlab markets
mlab markets --provider bulk

Inspect one market using Market Lab or BULK symbol notation:

mlab markets --provider bulk --symbol BTC/USDT
mlab markets --provider bulk --symbol BTC-USD

Return the full catalog or one market as JSON:

mlab markets --provider bulk --json
mlab markets --provider bulk --symbol BTC/USDT --json

markets reads a versioned snapshot embedded in the binary. It performs no runtime request and requires no credentials. See BULK Provider.

Inspect

Historical or reconstructed market-state inspection.

Example:

mlab inspect --provider mmt --exchange binancef --symbol BTC/USDT --at 1779399687271 --depth 20 --output terminal

Source

Raw provider-facing commands.

Current source commands:

  • source orderbook
  • source candles
  • source vd
  • source oi
  • source volumes
  • source stats
  • source funding

Examples:

mlab source orderbook --provider mmt --exchange bybitf --symbol BTC/USDT --depth 100 --output json
mlab source candles --provider mmt --exchange binancef --symbol BTC/USDT --timeframe 60 --from 1779880000000 --to 1779883600000 --output json
mlab source vd --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779620400000 --to 1779624000000 --bucket 1 --output json
mlab source oi --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779660000000 --to 1779705600000 --output json
mlab source volumes --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779660000000 --to 1779705600000 --output json

BULK is also a source provider. Omit --exchange because the provider resolves the native venue:

mlab source orderbook --provider bulk --symbol BTC/USDT --depth 100 --output json
mlab source candles --provider bulk --symbol BTC/USDT --timeframe 60 --from 1780307559000 --to 1780523645000 --output json
mlab source oi --provider bulk --symbol BTC/USDT --stream --output jsonl
mlab source vd --provider bulk --symbol BTC/USDT --stream --output jsonl
mlab source stats --provider bulk --period 7d --output json
mlab source funding --provider bulk --symbol BTC/USDT --stream --output jsonl

BULK source modes and flags differ by source. See BULK Provider.

Script

Run local JavaScript against Market Lab data sources.

Reusable script settings can be loaded with --config marketlab.toml. See Configuration.

Script commands:

  • script run
  • script backtest
  • script runs list
  • script runs show

Examples:

mlab script backtest ./scripts/sma-cross.js --provider mmt --exchange bybitf --symbol BTC/USDT --from 1704067200000 --to 1704667200000 --source candles:timeframe=60 --param candles:fast=20 --param candles:slow=50 --param candles:notional=1000 --leverage 5 --output json

script backtest --leverage <N> uses intent.notional / N as margin capital for return, drawdown, and Sharpe calculations. PnL remains based on the full notional.

mlab script runs list
mlab script runs show <run-id>

Auth

Store provider credentials in the operating system keychain:

mlab auth set mmt
mlab auth set bulk
mlab auth status
mlab auth remove mmt
mlab auth remove bulk

auth status never prints an MMT API key or BULK private key. For BULK it prints the registration state, account public key when known, and agent public key.

auth set bulk:

  • generates an agent wallet locally
  • stores the agent credential in the operating system keychain
  • prompts for the main wallet private key without echoing it
  • uses the main key once to sign agent authorization and never stores it
  • preserves an unconfirmed agent as pending so the same registration can be retried safely

auth remove bulk revokes an active agent on BULK before deleting the local credential. It asks for the matching main wallet private key to sign the revocation.

The BULK command surface includes public market data, the embedded market catalog, and agent-wallet management. Order placement is not implemented yet. See BULK Provider.

Study

Derived metrics and calculations.

Current study commands:

  • study spread
  • study depth
  • study imbalance
  • study slippage
  • study vamp
  • study cvd

Examples:

mlab study spread --provider mmt --exchange bybitf --symbol BTC/USDT --depth 20 --output json
mlab study slippage --provider mmt --exchange bybitf --symbol BTC/USDT --side buy --notional 100000 --depth 100 --output json

Strategy

Time-series logic over provider data.

Current strategy commands:

  • strategy run sma-crossover
  • strategy backtest sma-crossover

Run mode:

mlab strategy run sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --output terminal

Backtest mode:

mlab strategy backtest sma-crossover --provider mmt --exchange bybitf --symbol BTC/USDT --timeframe 60 --from 1779660000000 --to 1779705600000 --fast 20 --slow 50 --confirm-bars 1 --output terminal

Notes:

  • strategy run is live mode
  • strategy backtest is historical mode
  • strategy run can accept optional --from as a warmup anchor
  • strategy backtest requires --from and --to

Health

Provider health and connectivity checks.

mlab health --provider mmt --output json
mlab health --provider bulk --output json

Status

Local CLI and runtime status.

mlab status

Upgrade

Check for newer CLI releases.

mlab upgrade --check

On this page