MarketLab Docs

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.toml

When --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 run
  • script backtest

Precedence

Values resolve in this order:

built-in defaults < marketlab.toml < CLI flags

CLI values always win:

mlab script backtest --config marketlab.toml --symbol BTC/USDT --leverage 10

Only 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 = 5

Source tables become source flags:

[sources.vd]
timeframe = 60
bucket = 1

is equivalent to:

--source vd:timeframe=60 --source vd:bucket=1

Script parameter tables become parameter flags:

[script.params.candles]
fast = 20
slow = 50

is equivalent to:

--param candles:fast=20 --param candles:slow=50

Script 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 mmt

Inspect credential status without exposing the key:

mlab auth status

Remove it:

mlab auth remove mmt

For CI and non-interactive environments, MMT_API_KEY overrides the OS keychain:

MMT_API_KEY=your_key mlab health --provider mmt

The API key is never read from the project TOML file.

On this page