Skip to the page
API REFERENCE/API INDEX

API index

The classes and functions most code builds against are listed first, then every export with its tier.

Integrations

tradefloor.gymTradingEnv, a Gymnasium environment. Extra: pip install "tradefloor[rl]". Reference: Gym environment.
tradefloor.edgarSnapshots of SEC filings and Universe.from_edgar. Reference: Engine and data.
tradefloor.mcpThe MCP server, command tradefloor-mcp. Extra: pip install "tradefloor[mcp]". Tool reference: LLM adapters and MCP.
tradefloor.integrations.finrobotRuns a FinRobot agent inside a World, with an allowlist that controls which observations the agent sees. Extra: pip install "tradefloor[finrobot]" (Python 3.11 exactly). Usage: Forks and counterfactuals. Shipped studies: examples/rate-shock/ and examples/integrations/finrobot/.
tradefloor.integrations.openai_agentsRuns an OpenAI Agents SDK agent against a World. Extra: pip install "tradefloor[openai-agents]". Reference: LLM adapters and MCP.
tradefloor.integrations.pydantic_aiRuns a PydanticAI agent against a World. Extra: pip install "tradefloor[pydantic-ai]". Reference: LLM adapters and MCP.
tradefloor.integrations.langgraphRuns a LangGraph graph against a World. A LangGraph checkpoint holds the graph's workflow state but no market state. The reference lists what each checkpoint holds. Extra: pip install "tradefloor[langgraph]". Reference: LLM adapters and MCP.
tradefloor.integrationsAdapters that run an OpenAI Agents SDK agent, a PydanticAI agent, a LangGraph graph or any plain Python function in one evaluation loop. Extras: pip install "tradefloor[openai-agents]", "[pydantic-ai]", "[langgraph]". Usage: LLM adapters. Reference: LLM adapters and MCP.

Complete index

Every symbol in tradefloor.__all__, and the optional submodules that extras install, in alphabetical order. Symbols with no link in the reference column are documented under exports without a reference page, below.

recommended build against it, listed above advanced supported, for research, calibration and model work deprecated an engine internal that warns on use and names its new import path internal-transition a model internal that will leave the top-level namespace
SymbolModuleTierCategoryReference
Agenttradefloor.harnessrecommendedevaluationreference
AgentRecordtradefloor.rankingadvancedevaluationreference
agreetradefloor.counterfactualadvancedcounterfactualsreference
Agreementtradefloor.counterfactualadvancedcounterfactualsreference
ArrowStreamtradefloor._corerecommendeddatareference
atlastradefloor.atlasadvancedmodel utilityin the table below
baselinestradefloor.baselinesrecommendedevaluationreference
Batterytradefloor.fingerprintadvancedevaluationreference
batterytradefloor.fingerprintadvancedevaluationreference
BATTERY_VERSIONtradefloor.fingerprintadvancedevaluationreference
bondstradeflooradvancedmarketreference
boundarytradefloor.boundaryadvancedcounterfactualsreference
BoundaryMaptradefloor.boundaryadvancedcounterfactualsreference
branchtradefloor.checkpointrecommendedreproducibilityreference
callabletradefloor.integrations.callableadvancedintegrationreference
Canceltradefloor.portfoliorecommendedexecutionreference
capture_ratiotradefloor.baselinesadvancedevaluationreference
capture_withheldtradefloor.baselinesadvancedevaluationreference
Celltradefloor.fingerprintadvancedevaluationreference
Checkpointtradefloor.checkpointrecommendedreproducibilityreference
committradefloor.fingerprintadvancedtrustreference
commontradefloor.integrations.commonadvancedintegrationreference
comparetradefloor.counterfactualrecommendedcounterfactualsreference
Comparisontradefloor.counterfactualadvancedcounterfactualsreference
counterfactualtradefloor.counterfactualadvancedcounterfactualsreference
DayLedgertradefloor.manifestadvancedreproducibilityreference
Divergencetradefloor.counterfactualadvancedcounterfactualsreference
edgartradefloor.edgaradvanceddatareference
Enginetradefloor._corerecommendedmarketreference
EngineBatchtradefloor._coreadvancedmarketreference
envelopetradefloor.envelopeadvancedtrustreference
evaluatetradefloor.harnessrecommendedevaluationreference
Executiontradefloor.tcaadvancedexecutionreference
Exercisetradefloor.portfolioadvancedexecutionreference
explaintradefloor.explainadvancedtrustreference
Explanationtradefloor.explainadvancedtrustreference
externalitiestradefloor.externalityadvancedevaluationin the table below
Externalitytradefloor.externalityadvancedevaluationin the table below
externalitytradefloor.externalityadvancedevaluationin the table below
factstradefloor.factsadvancedtrustin the table below
fair_valuetradefloor._coreadvancedmodel utilityin the table below
FairValuetradefloor._coreadvancedmodelin the table below
Filltradefloor._coreadvancedmarketreference
Fingerprinttradefloor.fingerprintadvancedevaluationreference
fingerprinttradefloor.fingerprintadvancedevaluationreference
FingerprintComparisontradefloor.fingerprintadvancedevaluationreference
Firingtradefloor.interventionsadvancedscenariosreference
Fliptradefloor.boundaryadvancedcounterfactualsreference
fliptradefloor.boundaryadvancedcounterfactualsreference
flow_impacttradeflooradvancedexecutionreference
FlowImpacttradeflooradvancedexecutionreference
GameRngtradefloor._coreadvancedutilityin the table below
gymtradefloor.gymrecommendedintegrationreference
HiddenStatetradefloor.sandboxadvancedevaluationreference
Historytradefloor.harnessadvancedevaluationreference
Instrumenttradefloor._corerecommendedmarketreference
integrationstradefloor.integrationsrecommendedintegrationreference
Interventiontradefloor.interventionsadvancedscenariosreference
interventionstradefloor.interventionsadvancedscenariosreference
Invariancetradefloor.counterfactualadvancedintegrationreference
invariancetradefloor.counterfactualadvancedintegrationreference
JSONRenderertradefloor.renderadvancedintegrationreference
langgraphtradefloor.integrations.langgraphadvancedintegrationreference
leaderboardtradefloor.harnessadvancedevaluationreference
Limittradefloor.portfoliorecommendedexecutionreference
losstradefloor.lossadvancedtrustin the table below
Macrotradefloor._corerecommendedmarketreference
manifesttradefloor.manifestadvancedreproducibilityreference
map_boundariestradefloor.boundaryadvancedcounterfactualsreference
market_statustradefloor._coreadvancedutilityin the table below
MarketViewtradefloor.sandboxadvancedevaluationreference
MatchResulttradefloor._coreadvancedmarketreference
mcptradefloor.mcprecommendedintegrationreference
model_presettradefloor._coreadvancedmodelreference
ModelParamstradefloor._corerecommendedmodelreference
Newstradefloor._coreadvancedmarketreference
NewsImpacttradefloor._coreadvancedmarketreference
Nodetradefloor.explainadvancedtrustreference
noisetradefloor.noiseadvancedreproducibilityin the table below
Observationtradefloor.harnessrecommendedevaluationreference
openai_agentstradefloor.integrations.openai_agentsadvancedintegrationreference
oracle_is_ceilingtradefloor.baselinesadvancedevaluationreference
OrderBooktradefloor._coreadvancedmarketreference
OrderErrortradefloor._corerecommendederrorsreference
Populationtradefloor.populationadvancedevaluationin the table below
populationtradefloor.populationadvancedevaluationin the table below
Portfoliotradefloor.portfolioadvancedevaluationreference
PortfolioViewtradefloor.sandboxadvancedevaluationreference
Positiontradefloor.portfolioadvancedevaluationin the table below
preset_namestradefloor._corerecommendedmodelreference
preset_recordtradefloor.recordsrecommendedmodelreference
preset_recordstradefloor.recordsadvancedmodelreference
PriceLeveltradefloor._coreadvancedmarketreference
pydantic_aitradefloor.integrations.pydantic_aiadvancedintegrationreference
ranktradefloor.rankingrecommendedevaluationreference
Rankingtradefloor.rankingrecommendedevaluationreference
RATE_SECTORtradeflooradvancedmarketreference
rate_specstradeflooradvancedmarketreference
RATE_TICKERStradeflooradvancedmarketreference
reference_agentstradefloor.baselinesrecommendedevaluationreference
rendertradefloor.renderadvancedintegrationreference
Renderertradefloor.renderadvancedintegrationreference
replaytradefloor.replayrecommendedreproducibilityreference
Resampletradefloor.counterfactualadvancedcounterfactualsreference
resampletradefloor.counterfactualadvancedcounterfactualsreference
revealtradefloor.fingerprintadvancedtrustreference
run_manytradefloorrecommendedmarketreference
run_scenariotradefloor.scenariorecommendedscenariosreference
RunManifesttradefloor.manifestrecommendedreproducibilityreference
sandboxtradefloor.sandboxadvancedevaluationreference
SandboxErrortradefloor.sandboxadvancederrorsreference
Scenariotradefloor.scenariorecommendedscenariosreference
ScenarioValidationErrortradefloor.interventionsrecommendederrorsreference
Scorecardtradefloor.harnessrecommendedevaluationreference
sealed_batterytradefloor.fingerprintadvancedevaluationreference
sectorstradefloor._coreadvancedutilityin the table below
spectradefloor.specadvancedevaluationreference
SPEC_VERSIONtradefloor.specadvancedevaluationin the table below
StrategySpectradefloor.specadvancedevaluationreference
sweeptradefloor.sweepadvancedevaluationin the table below
SweepCosttradefloor._coreadvancedmarketreference
TARGETStradefloor.boundaryadvancedscenariosreference
tcatradefloor.tcarecommendedexecutionreference
TextRenderertradefloor.renderadvancedintegrationreference
TickResulttradefloor._coreadvancedmarketreference
TradingEnvtradefloor.gymrecommendedintegrationreference
Universetradefloorrecommendedmarketreference
UNSUPPORTED_TARGETStradefloor.interventionsadvancedscenariosreference
ValidationErrortradefloor._corerecommendederrorsreference
Verificationtradefloor.manifestadvancedreproducibilityreference
versiontradefloor._coreadvancedutilityin the table below
__version__tradeflooradvancedutilityin the table below
versus_buy_and_holdtradefloor.baselinesrecommendedevaluationreference
Worldtradefloor.counterfactualrecommendedcounterfactualsreference
yaml_subsettradefloor.yaml_subsetinternal-transitionutilityin the table below

Exports without a reference page

Exports with no section elsewhere, and exports not meant for new code, with their signature, import path and tier. All of them still import from tradefloor. A deprecated symbol emits a DeprecationWarning that names the module to import it from, and leaves the top level no earlier than the next minor release. An internal-transition symbol leaves on that schedule too, with no warning, because the package itself imports it.

SignatureImportTierPurpose
__version__: str = '0.11.0'tradeflooradvancedThe installed package version, as a string. It is what a RunManifest records and what a published result cites.
tradefloor.atlastradefloor.atlasadvancedAtlas: a map of how the model responds across its parameter space.
externalities(world: 'World', days: 'int' = 1) -> 'Externality'tradefloor.externalityadvancedFork a cohort, remove each agent in turn, and measure what changed.
Externality(*, labels, matrix, diagonal, diagonal_bps, cohort_pnl, trades, traded, exposure, agreement, days, fork_day, fork_step, held_at_fork, levels=None, live=False) -> 'None'tradefloor.externalityadvancedOne cohort's agents, measured against the cohorts without each of them. Members: COLUMNS, agreement, as_dict, caveats, cohort_pnl, days, diagonal, diagonal_bps, effect_on, exposure, fork_day, fork_step, held_at_fork, labels, levels, live, matrix, render, table, traded, trades.
tradefloor.externalitytradefloor.externalityadvancedWhat each agent in a cohort did to each other agent, under the same draws.
tradefloor.factstradefloor.factsadvancedStylised facts: what these markets look like, measured, next to real ones.
fair_value(*, eps=None, sector, revenue_growth=None, federal_funds_rate=0.0, corporate_bond_yield=None, qe_pe_boost=None, book_value_per_share=None, neutral_discount_rate=None, qe_assets_ratio=None, qe_pe_gain=None, qe_pe_stock_gain=None, rate_pe_sensitivity=None, fair_value_book_floor=None, model=None)tradefloor._coreadvancedFair value per share from fundamentals and the macro state.
FairValuetradefloor._coreadvancedA fair-value result and its decomposition. Members: book_value_path, fair_value, qe_adjustment, rate_adjustment, sector_anchor_pe, target_pe.
GameRng(seed, sequence)tradefloor._coreadvancedDeterministic seeded random number generator (PCG32 + Box-Muller). Members: next_bool, next_float, next_int, next_normal.
tradefloor.losstradefloor.lossadvancedThe calibration objectives: band distance, and a residual scoring rule.
market_status(hour, minute, day_of_week)tradefloor._coreadvancedWhich session a moment falls in.
tradefloor.noisetradefloor.noiseadvancedThe draw stream as an addressable, editable object.
Population(participants: 'Iterable[Participant]', *, name: 'str' = 'custom') -> 'None'tradefloor.populationadvancedA declarative, fingerprinted set of background traders. Members: as_dict, crowded, fingerprint, from_dict, name, named, participants, standard.
tradefloor.populationtradefloor.populationadvancedBackground traders that share the market with your agents.
Position(ticker: 'str') -> 'None'tradefloor.portfolioadvancedA holding in one instrument. Members: avg_cost, market_value, quantity, realised, ticker, unrealised.
sectors()tradefloor._coreadvancedThe twelve sector keys, in contractual declaration order.
SPEC_VERSION: int = 1tradeflooradvancedThe StrategySpec schema version. A spec written against an older number still loads. One written against a newer number does not, so a manifest that records it says whether this install can replay the run.
sweep(seeds: 'Iterable[int]', *, universe: 'Sequence[Instrument]', days: 'int' = 1, ticks_per_day: 'int' = 390, macro: 'Macro | None' = None, scenario: 'Any' = None, collect: 'str' = 'bars', grain: 'str | None' = None, minutes: 'int | None' = None, start: 'tuple[int, int, int]' = (9, 30, 3), workers: 'int' = 1, model: 'str | ModelParams | None' = None) -> 'Iterator[tuple[int, Any]]'tradefloor.sweepadvancedYield (seed, table) for each seed, one at a time.
version()tradefloor._coreadvancedThe compiled core's version, as a string. It reports the same value as __version__ and is kept for callers written before that attribute existed.
tradefloor.yaml_subsettradefloor.yaml_subsetinternal-transitionA reader for the boring part of YAML, and nothing else.

Atlas surveys the model's parameter space. It reports which parameters move which outputs, what shape each effect has, and which trades are available at once. It's meant for people who calibrate the model, and these docs don't have a tutorial for it.