Build trading systems. Not spreadsheets.

Market Lab is a programmable runtime for market research, execution-aware backtesting, and controlled live trading. Inspect order flow, simulate JavaScript orders, then deploy the same logic as a supervised BULK strategy job.

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 \--param candles:fast=20 --param candles:slow=50 \--leverage 5
Backtest complete2.84s
MarketBTC / USDT
ExchangeHyperliquid
Window01 Jun - 30 Jun
Sourcecandles:60
Trades0
Sharpe0.00
Win rate0.0%
Total PnL+$0
report saved~/.market-lab/runs/01J4BTC9
01 / CAPABILITIES

One runtime. Five command layers.

Source, study, strategy, script, and execution share the same market model, validation boundary, and structured output contracts.

01

Source data

Access provider-native candles, orderbooks, volume delta, open interest, funding, statistics, and volume through one command surface.

$ 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 JavaScript against multiple sources, simulate execution over history, then deploy the same logic as a detached live job.

$ mlab script backtest ./strategy.js ...
05

Execute safely

Validate CLI and scripted orders, attach native protection, and receive account lifecycle events through the isolated daemon.

$ mlab trade long BTC/USDT --dry-run ...
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.

PROVIDERS / VENUESSelect a provider
MMT venues21 venues
binanceCEX / Spot

Binance spot order books and trades.

SOURCE LAYERcandlesorderbookvdoivolumesfundingstats
MARKET LABRuntime
v0.0.4
SourcesStudiesStrategiesScriptsExecution
OUTPUTS TODAYTerminal / JSON / JSONL
EXECUTION LAYERmlabd / BULKlive
03 / MARKET CATALOG

Find the market before you write the command.

Search MMT venues and native BULK markets in one catalog. Provider, venue, native symbol, and Market Lab input remain explicit.

Loading catalog
ProviderProvider symbolVenueMarketMarket 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

Simulate custom execution

05mlab script run

Deploy a live worker

06mlab script logs

Observe execution events

05 / SCRIPTING

One execution API, two runtimes.

Backtests intercept ctx.trade with a historical simulator. Live jobs route the same request through mlabd, with signing and account events kept outside JavaScript.

Persistent QuickJS runtime
Built-in studies call the same Rust implementations exposed by the CLI
Market, limit, cancellation, leverage, SL, and TP simulation
Detached jobs with journaled onExecution events
Explore scripting
QuickJS runtime
01 export const script = {
02   name: "ema-cross", version: "1",
03   sources: ["candles"],
04   lookback: 100
05 }

06 export function onData(ctx, input, history) {
07   if (input.source !== "candles@hyperliquid@mmt") return
08   const candles = history.source("candles@hyperliquid@mmt"); if (candles.length < 51) return
09   const fast = ctx.study.ema(candles, {
10     field: "c", window: 20
11   })
12   const slow = ctx.study.ema(candles, {
13     field: "c", window: 50
14   })

15   if (fast.previous <= slow.previous &&
16       fast.latest > slow.latest) {
17     const entry = ctx.trade({
18       key: "ema-cross-" + candles.at(-1).t,
19       position: "open-long", margin: 1000, leverage: 5,
20       order: { type: "market" }
21     })
22     return { metrics: {order_id: entry.id } }
23   }
24 }

25 export function onExecution(ctx, event) {
26   return { metrics: {event: event.type, order_id: event.orderId } }
27 }
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
MMT + BULK providers
Historical datasets
Script jobs + mlabd
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, backtesting, and controlled BULK execution. Public market data stays behind the provider boundary, while signing and live order routing remain isolated inside mlabd.

Your next strategy starts in the terminal.

Install Market Lab and go from market data to reproducible tests and validated execution in one runtime.