Quickstart
Authenticate providers, inspect market data, run a backtest, and preview execution.
Local Development
The CLI currently lives in the Rust repository.
Basic flow:
mlab --helpIf you use the MMT provider, store an API key:
mlab auth set mmtPublic BULK market data needs no credential. To use account or execution commands, authorize a BULK agent wallet:
mlab auth set bulkThis stores the agent credential in the operating system keychain. The main wallet private key is used only through the hidden authorization prompt and is not stored.
First Useful Commands
Inspect BULK trading rules locally:
mlab markets --exchange bulk
mlab markets --exchange bulk --symbol BTC/USDTMMT source example:
mlab source orderbook --provider mmt --exchange bybitf --symbol BTC/USDT --depth 100 --output terminalBULK source example:
mlab source orderbook --exchange bulk --symbol BTC/USDT --depth 100 --output terminalMMT uses --provider mmt --exchange <exchange>. Standalone BULK uses --exchange bulk without a provider flag.
Current study example:
mlab study slippage --provider mmt --exchange bybitf --symbol BTC/USDT --side buy --notional 100000 --depth 100 --output jsonCurrent strategy example:
mlab strategy run twap BTC/USDT --exchange bulk --side buy --margin 100 --leverage 5 --duration 300 --interval 60 --dry-runRemove --dry-run to confirm and deploy TWAP as a detached mlabd job. Read TWAP first; the current implementation uses market child orders.
Current script backtest example:
mlab script backtest ./scripts/sma-cross.js --symbol BTC/USDT --from 1704067200000 --to 1704667200000 --source candles@bybitf@mmt:timeframe=60 --param fast=20 --param slow=50 --param margin=1000 --param leverage=5 --output jsonscript backtest runs ctx.trade and ctx.cancel against the historical simulator. It never signs or submits a live order.
Deploy an analysis-only live script:
mlab script run ./scripts/candle-summary.js --symbol BTC/USDT --source candles@bulk:timeframe=5The command returns a job ID. Inspect the worker with:
mlab script jobs
mlab script status <JOB_ID>
mlab script logs <JOB_ID> --followView script runtime reports:
mlab script runs list
mlab script runs show <run-id>Preview a normalized Bulk trade without signing, submitting, or starting the execution daemon:
mlab trade long BTC/USDT --margin 10 --dry-runInspect account state:
mlab positions
mlab orders
mlab fillsRead Execution before removing --dry-run.
Read Strategies before submitting a built-in execution strategy.
Read Script Execution before adding --venue bulk to a live script.
Milliseconds First
Market Lab uses milliseconds at the app boundary.
That means values like:
--from--tots_ms
should be treated as millisecond-oriented when using the CLI.
Providers may use other units internally. Market Lab handles that conversion.