Skip to main content
ClaudeWave

A simulated stock market for testing trading strategies and AI agents. Orders move prices, any market can be forked, and every run reproduces exactly.

MCP ServersRegistry oficial0 estrellas0 forks● PythonApache-2.0Actualizado today
ClaudeWave Trust Score
95/100
✓ Verified
Passed
  • ✓Open-source license (Apache-2.0)
  • ✓Actively maintained (<30d)
  • ✓Clear description
  • ✓Topics declared
  • ✓Documented (README)
Last scanned: 10/4/2026
Install in Claude Code / Claude Desktop
Method: pip / Python · tradefloor
Claude Code CLI
claude mcp add tradefloor -- python -m tradefloor
claude_desktop_config.json (Claude Desktop)
{
  "mcpServers": {
    "tradefloor": {
      "command": "python",
      "args": ["-m", "tradefloor"]
    }
  }
}
1. Run the command above in your terminal (Claude Code), or paste the JSON config into claude_desktop_config.json (Claude Desktop).
2. Replace any <placeholder> values with your API keys or paths.
3. Restart Claude. The MCP server and its tools appear automatically.
💡 Install first: pip install tradefloor
Casos de uso

Resumen de MCP Servers

# tradefloor

[![determinism](https://github.com/simoncoombes/tradefloor/actions/workflows/determinism.yml/badge.svg)](https://github.com/simoncoombes/tradefloor/actions/workflows/determinism.yml)
[![PyPI](https://img.shields.io/pypi/v/tradefloor.svg)](https://pypi.org/project/tradefloor/)
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/tradefloor?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/tradefloor)
[![crates.io](https://img.shields.io/crates/v/tradefloor.svg)](https://crates.io/crates/tradefloor)
[![license: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](#license)
[![python 3.11+](https://img.shields.io/badge/python-3.11%2B-blue.svg)](https://www.python.org/downloads/)

<a href="https://tradefloor.dev"><img src="https://tradefloor.dev/multiverse.gif" width="900" alt="One simulated market, forked on six days into seven futures: a rate cut, a stimulus, an oil spike, a rate shock, a liquidity crisis and a recession, each run on from the same past."></a>

tradefloor is a market simulator you can run a strategy against. It has a
Rust core and a Python API.

Give it a seed and a list of companies. It runs a market forward: prices, a
limit order book, fills, and an economy that moves each day. Your orders match
against the book's depth, so your trades move the price.

Real market data can't tell you what would have happened if you had traded
differently, or what caused a move. tradefloor can, because it computed every
price. You can fork a running market, change one thing in one branch (a rate
rise, a liquidity crisis, a different agent), and measure where the two
branches came apart. `engine.truth()` splits each move in the gap between a
price and the model's fair value into eleven factors, and
`engine.explain(ticker, day)` breaks down the move in the traded price, two
records no historical dataset carries.

Documentation is at https://docs.tradefloor.dev.

## Install

```
pip install tradefloor
```

There are wheels for Linux, macOS and Windows on CPython 3.11+, and no
dependencies. The same engine is a Rust crate (`cargo add tradefloor`).
Optional extras add the MCP server (`tradefloor[mcp]`), Arrow output
(`tradefloor[arrow]`), the Gymnasium environment (`tradefloor[rl]`) and one
extra per agent framework.

The API may change before 1.0. Model changes ship as new presets, so a market
with no agent orders in it replays exactly on its named preset in later
releases. tradefloor was called pretium until 0.5.0. Versions up to 0.4.3
still install under that name, and results recorded with them still replay.

## A first run

```python
import tradefloor as tf

universe = tf.Universe.random(40, seed=111)

spec = tf.StrategySpec.momentum(lookback_days=1.0, top_k=5)
scores = tf.evaluate({"mine": spec}, seed=7, universe=universe, days=10)

scores["mine"].return_pct            # what it made
scores["mine"].impact_bps            # what its own footprint cost
scores["mine"].strategy_fingerprint  # sha256, cite this
scores["mine"].errors                # each step that raised or was refused
scores["mine"].sharpe                # annualised, from the daily closes
scores["mine"].time_in_market        # share of steps holding a position
```

That result comes from one random market, so it says as much about the seed
as about the strategy. `tf.rank` runs many seeds and compares strategies with
a paired sign test. Add `tf.baselines.reference_agents()` to the entrants and
`tf.versus_buy_and_hold(scores)` reads each score against buy-and-hold on
the same market.

A Python agent is any object with `act(obs)` that returns orders: a number
of shares for a market order, `tf.Limit(quantity, price)` or `tf.Cancel()`.
It sees a read-only view of the market and its own portfolio, and
`obs.history` holds a daily bar per name. A bar's close is the day's last
print. On pt-v20 the close then re-marks every name, so the next day starts
15 bp away at the median on a 20-name roster.
[docs/AGENTS.md](https://github.com/simoncoombes/tradefloor/blob/main/docs/AGENTS.md)
covers what the view holds, how trades are charged, the framework adapters
(OpenAI Agents SDK, PydanticAI, LangGraph, FinRobot) and how scoring works.

## The demo

The examples are in this repository and not in the package, so clone it
first:

```
git clone https://github.com/simoncoombes/tradefloor
cd tradefloor
python examples/rate-shock/counterfactual.py
```

It runs an agent in a controlled market, checkpoints the world and forks it,
raises rates by 200 bp in one branch, and compares what the same agent does
next. It prints nine checks that the two branches started identical, the
step at which the agent's behavior changed, and the two branches side by
side. The run takes under five seconds of CPU and needs no keys and no network.
The walkthrough is
[Your first counterfactual experiment](https://github.com/simoncoombes/tradefloor/blob/main/examples/rate-shock/README.md).

## Contents

| | |
|---|---|
| `engine.truth()` | why each price moved: eleven factors that sum to the mispricing's move, to 1e-16 |
| `engine.prints()` | how each trade price came about: the shock, and the order book depth that absorbed it |
| counterfactual TCA | your trading cost, from the same seed run with your orders and without them |
| `tf.rank` | many seeds, paired sign tests |
| `RunManifest` | what a reader needs to replay a run, checked by `reproduce()` |
| `World` / `compare` | fork a running experiment, change one variable, and measure where the two came apart |
| scenarios | seven packaged shocks, and a file format for your own |
| MCP server | thirteen read-only tools for a coding agent, scenarios included |
| more | a Gymnasium environment, Arrow output, checkpoints, SEC EDGAR data, simulated rate indices, a browser build |

## Drive it from an agent

```
pip install "tradefloor[mcp]"
claude mcp add tradefloor -- tradefloor-mcp
```

<!-- mcp-name: io.github.simoncoombes/tradefloor -->

`tradefloor-mcp` speaks MCP over stdio, and `tradefloor mcp` starts the same
server. Strategies, universes and scenarios are data, so a tool argument
cannot reach code. Each result carries its own caveats. See
[the MCP page](https://docs.tradefloor.dev/mcp-local.html).

## Scenarios

```python
engine = tf.Engine(seed=42, universe=universe)
engine.run_days(20)                                # a shared history first
scenario = tf.Scenario.load("liquidity_crisis")    # ships with the package

control, stress = tf.branch(engine, 2)
for day in range(80):
    scenario.apply(stress, day)
    ...                                  # run both branches
```

A scenario is a file of changes to the market and the assumptions behind
them. Each change targets a field the engine reads, and the file keeps the
shock apart from the knock-on effects you assume follow it:

```
tradefloor scenario show oil_price_spike

Exogenous shocks
----------------------------------------------------------
  day 50+            commodity.oil            x1.4

Assumed transmission
----------------------------------------------------------
  day 55..74 ramp    macro.inflation          +1.50pp
  day 55+            macro.corporate_yield    +0.50pp
```

`at` in a scenario counts days from the first day it is applied, so on a
branch it counts from the branch. Most packaged files first fire on day 50.
To fire one on the first day after a fork, use `scenario.starting_at(0)`, or
`world.apply(scenario, at=0)` on a `World`. The gaps between its events stay
the same, and the run's record keeps the packaged file's fingerprint and the
days each event fired.

tradefloor does not predict what a war, an election, an oil shock or a
recession will do to markets. You state the assumptions and it measures how an
agent behaves under them. `tradefloor scenario list` names the seven packaged
scenarios, and `tradefloor scenario targets` lists every field a scenario can
change.

## Reproducibility

The same seed gives the same market on every platform. tradefloor ships its
own `exp`, `log`, `pow`, `sin` and `cos`, so the system's math library cannot
change a result, and each release runs a fixed simulation on five platforms
and stops if any result differs.

A shipped preset never changes, so a market with no agent orders in it replays
exactly on its named preset in every later release. Each release checks that
with a digest per preset. A run with agent orders in it replays exactly on the
same release. Across releases the promise is narrower. 0.8.5 changed how an
agent's fills reach the market, on every preset, so a traded run recorded
before 0.8.5 matches up to its first trade and differs after it. The default
preset is `pt-v20`, and any earlier one can be named:

```python
eng = tf.Engine(seed=42, universe=u, model="pt-v10")
```

To let a reader rerun a result, publish its `RunManifest`. It records the
version, preset, seed, universe, macro state and scenario, and `reproduce()`
stops on a mismatch. A manifest checks the market and carries no score. Its
`result` block holds the market's `digest`, the number of `days` and
`draws_consumed`. `tf.evaluate` and `tf.rank` write no manifest, so a
published score has to be rerun to be checked.
[docs/REPRODUCIBILITY.md](https://github.com/simoncoombes/tradefloor/blob/main/docs/REPRODUCIBILITY.md)
has the full contract, including what a saved engine state promises when it
is restored, and
[docs/SUPPORT.md](https://github.com/simoncoombes/tradefloor/blob/main/docs/SUPPORT.md)
says which release to pin for a long study.

## Realism

tradefloor checks its market against real ones with three named sets of
statistics, listed in
[docs/STATISTICS.md](https://github.com/simoncoombes/tradefloor/blob/main/docs/STATISTICS.md).
On the default preset, `pt-v20`, all 19 statistics of the one-year table
(volatility, fat tails, how much stocks move together, how far the VIX jumps
after a fall) are inside the range rea
agent-based-modelingagent-evaluationai-agentsalgorithmic-tradingbacktestinggymnasiumllm-agentsmarket-simulationmcp-serverorder-bookpythonquantitative-financereinforcement-learningruststock-markettrading-simulator

Lo que la gente pregunta sobre tradefloor

¿Qué es simoncoombes/tradefloor?

+

simoncoombes/tradefloor es mcp servers para el ecosistema de Claude AI. A simulated stock market for testing trading strategies and AI agents. Orders move prices, any market can be forked, and every run reproduces exactly. Tiene 0 estrellas en GitHub y su última actualización registrada es del 2026-10-04.

¿Cómo se instala tradefloor?

+

Puedes instalar tradefloor clonando el repositorio (https://github.com/simoncoombes/tradefloor) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.

¿Es seguro usar simoncoombes/tradefloor?

+

Nuestro agente de seguridad ha analizado simoncoombes/tradefloor y le ha asignado un Trust Score de 95/100 (tier: Verified). Revisa el desglose completo de comprobaciones superadas y flags en esta página.

¿Quién mantiene simoncoombes/tradefloor?

+

simoncoombes/tradefloor es mantenido por simoncoombes. La última actividad registrada en GitHub es del 2026-10-04, con 20 issues abiertos.

¿Hay alternativas a tradefloor?

+

Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.

Despliega tradefloor en tu cloud

Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.

¿Mantienes este repo? Añade un badge a tu README

Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.

Featured on ClaudeWave: simoncoombes/tradefloor
[![Featured on ClaudeWave](https://claudewave.com/api/badge/simoncoombes-tradefloor)](https://claudewave.com/repo/simoncoombes-tradefloor)
<a href="https://claudewave.com/repo/simoncoombes-tradefloor"><img src="https://claudewave.com/api/badge/simoncoombes-tradefloor" alt="Featured on ClaudeWave: simoncoombes/tradefloor" width="320" height="64" /></a>

Más MCP Servers

Alternativas a tradefloor