Skip to main content

Market Lab mark

Market Lab

Build AI trading agents. Test them against baselines. Replay the record.
A local research workbench for Python agents, historical markets and simulated accounts.

Version 1.0.0 App Python target: 3.9–3.12 License: Apache-2.0

Visit the Market Lab website on GitHub Pages

Watch the demo · Quick start · Build an agent · Documentation


Give your agent market tools and a simulated account. Choose its model and Python loop, observe its orders and fills, then verify the recorded trading operations without calling the model again. Compare its repeated runs with people, rules and your own neural-network models on the same market, with confidence intervals and a guard against prices the model may remember. Use the Desktop to explore an experiment, or work directly with the Python API.

Watch the demo

Play the 71-second Market Lab walkthrough: prepare an experiment, trade and verify Replay

▶ Watch the walkthrough · 1 min 11 sec
Prepare an experiment → submit an order → inspect a fill → verify a Live run in Replay.
Recorded in the real Desktop with synthetic data and no model API calls. Read the transcript.

From an agent idea to a trading record

Bring your own agent

Use the built-in template or import a Python project. Choose its model, instructions and tools, and replace the agent loop when you need more control.

Let the market keep moving

In Live mode, market time continues while the agent analyses data or waits for a model. The agent decides when to read, trade, wait or finish. Or run it turn-based: the market waits for each decision, to judge the decisions alone.

Inspect the experiment

See market data, cash, positions, orders, fills and agent activity together. Use manual trading, built-in rules and your own model file (for example a neural network) as baselines in the same platform.

Replay without another model call

Recalculate the financial outcomes of recorded trading operations. Inspect what happened without rerunning the agent or paying for another model response.

Is it really better?

Evaluate saved runs side by side: bootstrap confidence intervals, permutation tests against a baseline and Holm adjustment. Evaluation guide.

Rule out memory

A language model may have seen a famous stock's prices. Disguise a recording's dates and price level, and see which Agent runs used dates the model could know.
01 · Prepare 02 · Run 03 · Inspect 04 · Evaluate
Select data, an account and an Agent revision. Play a Live experiment or step through a manual, rule or model run. Follow orders, fills and agent activity in Desktop. Replay the record and test the Agent against baselines.

Market Lab runs on your computer. Model requests go to your configured provider; simulated trades stay in the local experiment. There is no broker connection or real order submission.

Quick start

Install a release, no build needed. Download the installer for your system from the latest GitHub Release: a .dmg for macOS, an .exe for Windows or an .AppImage for Linux. For Python, install the package from PyPI (its wheels include the native market library), then run the demo:

python -m pip install market-lab-research
market-lab demo

Or build from source. Clone or download this repository, then run the following from its root directory. The Desktop instructions target macOS, with Python 3.9–3.12, Make and a C++17 compiler. On macOS, install Apple's command-line developer tools if needed. See platform support for Linux and Windows coverage.

python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements-desktop.txt
make all
python -m sim_platform desktop --demo

The demo uses a small synthetic recording and temporary accounts. No historical data download or model API key is needed. Explore market playback and manual/rule trading; closing the app removes the demo workspace.

To keep your experiments, launch without --demo:

python -m sim_platform desktop

Continue with the first-experiment guide to add your data, configure a model, create an experiment and inspect its results.

Write an agent

Your project exports create_agent(context). The platform supplies the selected settings, model adapter and granted tools. For example, agent.py can use the built-in loop:

from sim_platform.sdk import TradingAgent


def create_agent(context):
    return TradingAgent(
        model=context.model,
        tools=context.tools.values(),
        instructions=context.settings['initial_prompt'],
        parameters=context.settings['parameters'],
    )

You can replace that loop with your own implementation and add local Python tools. Develop your project separately from the platform; the SDK guide explains installation and the Agent interface.

In Desktop, import the project under Agents, prepare its Python dependencies, then select the saved Agent revision in New experiment. Choose an account and market data, wait for preparation, and press Play. The project guide covers configuration and dependency preparation; examples show a local math tool and a custom resident loop.

Find your way around

I want to… Guide
Use Desktop, CLI or Replay User guide
Compare an Agent with baselines Evaluation
Build an Agent or add tools Agent development
Integrate from Python Platform API
Understand execution and processes Architecture
Change, test or release the platform Development

Project status

Market Lab 1.0 is a stable release with a frozen public API (API stability). Trading uses simulated cash with limit and market orders; short selling is optional, with a margin rule, and there is no leverage. Manual, rule, model-file and Agent experiments can trade several symbols from one account, in Controlled or Live mode. Historical recordings are not included. Imported Python is trusted local code unless you run it in the optional OS sandbox; model-backed experiments need your own credentials or a local model server. Installers for macOS, Windows and Linux and wheels with the native library are built by the release workflow. Multi-agent experiments are future work. See support and limitations and the roadmap.

Pull requests are welcome; read contributing and governance first. Bug reports should include reproduction steps, OS/Python versions and redacted logs; troubleshooting covers common problems. For sensitive issues, follow security reporting. To cite Market Lab, use CITATION.cff.

License

Apache-2.0. Third-party components retain their own licenses; see third-party notices.

Metadata

Release files for market-lab-research 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for market-lab-research 1.0.0
File Size Uploaded Provenance Actions
market_lab_research-1.0.0.tar.gz 703.2 kB With provenance Details for market_lab_research-1.0.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for market-lab-research 1.0.0
File Actions
market_lab_research-1.0.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for market_lab_research-1.0.0-py3-none-win_amd64.whl
market_lab_research-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for market_lab_research-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
market_lab_research-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for market_lab_research-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
market_lab_research-1.0.0-py3-none-macosx_12_0_x86_64.whl Python 3 none macOS 12.0+ x86-64 Details for market_lab_research-1.0.0-py3-none-macosx_12_0_x86_64.whl
market_lab_research-1.0.0-py3-none-macosx_12_0_arm64.whl Python 3 none macOS 12.0+ ARM64 Details for market_lab_research-1.0.0-py3-none-macosx_12_0_arm64.whl

Total release size: 5.2 MB

Release files / market_lab_research-1.0.0.tar.gz

Download URL market_lab_research-1.0.0.tar.gz
Size 703.2 kB
Tags Source
SHA-256 checksum
How to use checksums
191f9a5db43f714e4376f739e1d434a62136b9023bf9a6aa253256408e06adf4
BLAKE2b-256 checksum
How to use checksums
084a8f423cbaad4c67007f5f005e25f1560775f1f361ea96a90b44a828162caa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / market_lab_research-1.0.0-py3-none-win_amd64.whl

Download URL market_lab_research-1.0.0-py3-none-win_amd64.whl
Size 873.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
2e8528c851b2f5564b2da2a8bdbfe731f1dee0993067deea1ad84dd329d5195b
BLAKE2b-256 checksum
How to use checksums
52a75b767f75882f5e0ca4e1bb6296a85535f516625cc6a7db659abd13596cff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / market_lab_research-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL market_lab_research-1.0.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 910.1 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
9d991e31f7a1b88bb9df94473f6f804a118353e5cabfb0aaee33559cddea2215
BLAKE2b-256 checksum
How to use checksums
dcea98db04bbae0cc6362500823ea6886aaf0977755108db54826c20de745d70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / market_lab_research-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL market_lab_research-1.0.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 908.8 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ccd695bab5450c31ba55203a01542764517cb6945e7a98a6ad996c7dde9058ab
BLAKE2b-256 checksum
How to use checksums
623f326779462461e893385ee274ffd8293959c20fbccbc47743efe83cf68d62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / market_lab_research-1.0.0-py3-none-macosx_12_0_x86_64.whl

Download URL market_lab_research-1.0.0-py3-none-macosx_12_0_x86_64.whl
Size 881.2 kB
Tags Python 3 macOS 12.0+ x86-64
SHA-256 checksum
How to use checksums
2f3cff46a351c3eb5819c7df4138258baf78c020e3082cdb5327a993e91cea34
BLAKE2b-256 checksum
How to use checksums
7f90814165c5e4394d21a3cc53431a9b9c2cf5b81926bc6b670ec3ed3e377d89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / market_lab_research-1.0.0-py3-none-macosx_12_0_arm64.whl

Download URL market_lab_research-1.0.0-py3-none-macosx_12_0_arm64.whl
Size 879.1 kB
Tags Python 3 macOS 12.0+ ARM64
SHA-256 checksum
How to use checksums
aaf6f0485c4e4546f6808cbebf706f966434b9ec377a6752bcefc8f8c45dd6c9
BLAKE2b-256 checksum
How to use checksums
1e02fc105483c46b47d6dae86433abb1adfd5c9c9cbadbb26ced116678716805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for market-lab-research 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for market_lab_research-1.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

6 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page