Configuration
Reuse Market Lab command settings with marketlab.toml.
Configuration
Market Lab can load script settings from a TOML file. Configuration contains only non-secret values. Provider credentials are stored separately in the operating system keychain.
Discovery
Pass an exact file:
mlab script backtest --config ./marketlab.tomlWhen --config is omitted, Market Lab uses ./marketlab.toml if it exists. It does not search parent directories or alternate filenames.
Current TOML support covers:
script runscript backtest
Precedence
Values resolve in this order:
built-in defaults < marketlab.toml < CLI flagsCLI values always win:
mlab script backtest --config marketlab.toml --symbol BTC/USDT --leverage 10Only symbol and leverage are changed by this command.
File Shape
version = 1
[market]
provider = "mmt"
exchange = "hyperliquid"
symbol = "HYPE/USDT"
[output]
format = "terminal"
verbose = false
[sources.candles]
timeframe = 60
[sources.orderbook]
depth = 100
[sources.vd]
timeframe = 60
bucket = 1
[script]
path = "./scripts/orderflow.js"
[script.params.candles]
lookback = 48
notional = 1000
[script.params.orderbook]
max_spread_bps = 3
[script.params.vd]
min_delta = 50000
[backtest]
from = 1780497965372
to = 1780618018000
leverage = 5Source tables become source flags:
[sources.vd]
timeframe = 60
bucket = 1is equivalent to:
--source vd:timeframe=60 --source vd:bucket=1Script parameter tables become parameter flags:
[script.params.candles]
fast = 20
slow = 50is equivalent to:
--param candles:fast=20 --param candles:slow=50Script paths in TOML are resolved relative to the TOML file. Paths passed directly on the command line are resolved relative to the current shell directory.
Credentials
Never add an API key to marketlab.toml.
Store the MMT key securely:
mlab auth set mmtInspect credential status without exposing the key:
mlab auth statusRemove it:
mlab auth remove mmtFor CI and non-interactive environments, MMT_API_KEY overrides the OS keychain:
MMT_API_KEY=your_key mlab health --provider mmtThe API key is never read from the project TOML file.