Features
Open-source features run in the Python library on your machine, with no account. The ones marked Hosted need a free account on the hosted app, which is in beta.
The market
Each company has a limit order book, and a simulated economy runs underneath them all.
Order book and market impact
Open sourceA market maker quotes every company. Limit orders wait in the queue and can fill in parts. Big orders cost more, following the square-root impact law. Your strategy pays the spread and moves the price, and its score includes what that cost.
An economy and scenarios
Open sourceGrowth, inflation, the central bank's rate and bond yields move through a business cycle. A packaged scenario such as
rate_shockorrecession, or one you write, pushes the economy along a set path on any seed.Generated or real companies
Open sourceUniverse.randommakes companies with made-up fundamentals that no AI model has seen in training.tf.edgarbuilds a universe from real US companies' SEC filings, but the prices are still simulated.Price history before day 0
Open sourcehistory_daysruns up to ten years of market before the first decision, with nobody trading. A 200-day trend rule can then trade from the first day.
Testing agents and strategies
Plug in a strategy or an AI agent and score it on markets it hasn't seen.
Scoring and ranking
Open sourceHosted in betatf.evaluategives each agent a copy of one market and returns a scorecard with profit, Sharpe ratio, drawdown, trades and market impact.tf.rankrepeats the comparison over many seeds and runs a paired sign test to show whether a lead could be luck.LLM agents with record and replay
Open sourceAdapters for the OpenAI Agents SDK, PydanticAI, LangGraph and FinRobot pass the model each observation and send its orders. Someone else can replay a recorded run and check the result without calling the model or holding an API key.
Local MCP server
Open sourcetradefloor mcpgives Claude Code, Claude Desktop, a CrewAI agent or another MCP client tools to build markets, score strategies written as data and explain price moves. It places no orders. It's listed in the official MCP Registry and on Smithery.Execution cost
Open sourcetf.tca.analyseruns a seed with and without your orders and prices every fill against the run where you never traded. That splits the cost of your trading from what the market would have done anyway.Reinforcement learning
Open sourcetradefloor.gym, installed withpip install "tradefloor[rl]", wraps a market as a Gymnasium environment. A policy trains on markets that react to its trades.
Research and reproducibility
Save a run so someone else can rebuild it and check the result.
Forks and counterfactuals
Open sourceHosted in betatf.branchcopies a running market. Change one input in one copy, such as a scenario, and run both forward. The copies share their past bit for bit. Any later difference comes from the change.Here 40 companies are copied on day 100 and one copy gets a 200 bp rate rise.
import tradefloor as tf u = tf.Universe.random(40, seed=7) market = tf.Engine(seed=776644, universe=u) market.run_days(100) # one shared past calm, hiked = tf.branch(market, 2) # two copies of day 100 rate = market.macro_state.federal_funds_rate spread = market.macro_state.corporate_bond_yield - rate hike = tf.Scenario.rate_shock( start=rate, end=rate + 0.02, over=20, credit_spread=spread) for day in range(60): calm.run_days(1) hike.apply(hiked, day) # +200 bp, one copy hiked.run_days(1)95100105110day 0day 100day 160shared pastrates unchanged, 106.8 at day 160+200 bp, 99.1 at day 160
Reproducible results
Open sourceA market depends on its companies, seed, preset, package version, any scenario and the orders sent into it. A
RunManifestsaves all of them. On the same release, anyone can rebuild the market bit for bit on any platform tradefloor ships wheels for.Price attribution
Open sourceengine.truth()gives each company's fair value and the factors behind every price move. You can check an agent's explanation of a move against what caused it.Realism envelope check
Open sourcetf.envelope.check()tells you whether a question falls inside what the model is certified for. If it doesn't, it names the gap before you rely on a statistic the model is known to get wrong.
Works with
Bring the agent framework or coding assistant you already use. Each page has a tested setup.
Agents that trade in the market
Open sourceAn adapter turns the agent's decisions into orders, scores the run and records each model call so the run replays without a key.
Agent frameworks over MCP
Open sourceThe framework's agent gets the local MCP server's tools to build markets, score strategies and explain price moves.
Agno · AutoGen · CrewAI · Google ADK · LlamaIndex · smolagents
Coding assistants over MCP
Open sourceAdd the local MCP server once and ask the assistant to run markets and compare strategies for you.
Saved markets
in betaMarkets are kept on a server and saved after every step. An agent can stop and carry on the next day from where it left off.
APIs for agents and bots
in betaAn MCP endpoint for Claude, Codex and Cursor, an HTTP API for any language, and an API shaped like Alpaca's. A bot written for Alpaca's API works after you change its base URL and add one call that advances the market.
Python strategies in a sandbox
in betaPaste a strategy, or start from momentum, trend following or RSI, and it runs on tradefloor with no network or file access and nothing to install.
Evaluation suites for teams and teaching
in betaA fixed suite of markets scores every agent against the baselines, and a teacher can assign work to a class. Each result links to a manifest that rebuilds it.
-

