Build trading systems. Not spreadsheets.

Market Lab is a programmable runtime for market research, backtesting, and live analysis. Inspect market history, analyze order flow, and run custom scripts from the terminal.

Read docs
$ curl -fsSL https://marketlab.sh/install.sh | sh
~/strategies/btc-momentum.jsmarketlab
$mlab script backtest ./btc-momentum.js \--provider mmt \--exchange hyperliquid \--symbol BTC/USDT \--from 1780307559000 --to 1780523645331 \--source candles:timeframe=60 \--source orderbook:timeframe=60 \--source orderbook:depth=100 \--param candles:fast=20 --param candles:slow=50 \--param candles:notional=1000 \--param orderbook:max_spread_bps=3 --leverage 5
Backtest complete2.84s
MarketBTC / USDT
ExchangeHyperliquid
Window01 Jun 2026 - 30 Jun 2026
Sourcecandles:60 + orderbook:100
Trades0
Sharpe0.00
Win rate0.0%
Total PnL+$0
report saved~/.market-lab/runs/01J4BTC9
01 / CAPABILITIES

One runtime. Four command layers.

Source, study, strategy, and script share the same market model, provider interface, and structured output contracts.

01

Source data

Access live and historical candles, orderbooks, volume delta, open interest, and volume profiles through one provider interface.

$ mlab source orderbook ...
02

Run studies

Compute spread, depth, imbalance, slippage, VAMP, CVD, EMA, and SMA on normalized market data.

$ mlab study slippage ...
03

Test strategies

Run built-in strategy logic live or over a historical range and inspect structured performance summaries.

$ mlab strategy backtest sma-crossover ...
04

Write scripts

Run custom JavaScript against one or more market sources, in live or backtest mode, with source-scoped inputs.

$ mlab script backtest ./strategy.js ...
02 / ARCHITECTURE

The market, normalized into one runtime.

Provider access, validation, historical inspection, studies, scripts, and output envelopes live behind one command surface. Your logic stays focused on the market.

EXCHANGESHover or focus a venue
binanceCEX / Spot

Binance spot order books and trades.

SOURCE LAYERcandlesorderbookvdoivolumes
MARKET LABRuntime
v0.0.4
SourcesStudiesStrategiesScripts
OUTPUTS TODAYTerminal / JSON / JSONL
NEXT BOUNDARYExecution adaptersplanned
03 / MARKET CATALOG

Find the market before you write the command.

Search the symbols indexed across every supported MMT venue. Filter spot, derivatives, and decentralized markets without leaving the page.

Loading catalog
MMT symbolExchangeMarketMarket Lab input
Loading local market catalog...
04 / WORKFLOW

From data to live logic without changing tools.

Each command advances the same workflow instead of starting a separate project, notebook, or integration.

01mlab source

Connect market data

02mlab study

Measure the market

03mlab strategy backtest

Test built-in logic

04mlab script backtest

Test custom logic

05mlab script run

Run custom logic live

05 / SCRIPTING

Write strategy logic. The runtime handles the rest.

Market Lab owns data loading, source normalization, parameter validation, backtest accounting, and structured output. You own the idea.

Persistent QuickJS runtime
Built-in studies call the same Rust implementations exposed by the CLI
Signals and intents become deterministic backtest positions
Explore scripting
QuickJS runtime
01 export const script = {
02   name: "ema-cross",
03   sources: ["candles"],
04   lookback: 100
05 }

06 export function onData(ctx, input) {
07   const candles = input.candles.candles
08   const fast = ctx.study.ema(candles, {
09     field: "c", window: 20
10   })
11   const slow = ctx.study.ema(candles, {
12     field: "c", window: 50
13   })

14   if (fast.previous <= slow.previous &&
15       fast.latest > slow.latest) {
16     return {
17       signal: { triggered: true, side: "buy" },
18       intent: { action: "open", side: "long" }
19     }
20   }
21 }
06 / INCLUDED

The primitives are already here.

A compact surface for the recurring work behind quantitative research and market-structure analysis.

marketlab.toml config
Strategy backtesting
Embedded JavaScript
Multi-exchange data
Orderbook analysis
Volume profiles
EMA & SMA
Agent-ready JSON
Live streaming
OS keychain auth
Historical datasets
Execution-cost studies
07 / BUILT FOR

For people and systems that operate in code.

Market Lab is infrastructure for technical market participants, not another dashboard to watch.

Quant traders

Build, test, and inspect strategy logic without moving between notebooks, scripts, and dashboards.

Market makers

Measure spread, depth, imbalance, VAMP, and slippage directly against the orderbook.

AI agents

Give agents compact JSON, deterministic commands, and a constrained runtime they can operate programmatically.

08 / OPEN SOURCE

Inspect the runtime. Extend the boundary.

Market Lab is public and licensed under AGPL-3.0. The current runtime covers market data, studies, JavaScript scripting, live evaluation, and backtesting. Exchange execution adapters are the next boundary, and are not presented as shipping today.

Your next strategy starts in the terminal.

Install Market Lab and go from market data to a reproducible backtest in one runtime.