Skip to the page
API REFERENCE/API INDEX

API index

tradefloor's public API, grouped by task.

The complete index below lists every supported public symbol.

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 and none of the market's 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__, plus the optional submodules that extras install, in alphabetical order. A symbol with no link in the reference column is covered under advanced and compatibility exports below.

SymbolModuleCategoryReference
Agenttradefloor.harnessevaluationreference
AgentRecordtradefloor.rankingevaluationreference
agreetradefloor.counterfactualcounterfactualsreference
Agreementtradefloor.counterfactualcounterfactualsreference
apply_mispricingtradefloor._coremodel utilityexported, with no page of its own
ArrowStreamtradefloor._coredatareference
atlastradefloor.atlasmodel utilityexported, with no page of its own
baselinestradefloor.baselinesevaluationreference
Batterytradefloor.fingerprintevaluationreference
batterytradefloor.fingerprintevaluationreference
BATTERY_VERSIONtradefloor.fingerprintevaluationreference
bondstradefloormarketreference
boundarytradefloor.boundarycounterfactualsreference
BoundaryMaptradefloor.boundarycounterfactualsreference
branchtradefloor.checkpointreproducibilityreference
callabletradefloor.integrations.callableintegrationreference
Canceltradefloor.portfolioexecutionreference
capture_ratiotradefloor.baselinesevaluationreference
capture_withheldtradefloor.baselinesevaluationreference
Celltradefloor.fingerprintevaluationreference
characteristic_root_modulitradefloor._coremodel utilityexported, with no page of its own
check_ratetradefloor._coremodel utilityexported, with no page of its own
Checkpointtradefloor.checkpointreproducibilityreference
committradefloor.fingerprinttrustreference
commontradefloor.integrations.commonintegrationreference
comparetradefloor.counterfactualcounterfactualsreference
Comparisontradefloor.counterfactualcounterfactualsreference
counterfactualtradefloor.counterfactualcounterfactualsreference
crisis_epicentre_solvetradefloor._coremodel utilityexported, with no page of its own
crowd_adjusted_root_modulitradefloor._coremodel utilityexported, with no page of its own
DayLedgertradefloor.manifestreproducibilityreference
Divergencetradefloor.counterfactualcounterfactualsreference
edgartradefloor.edgardatareference
Enginetradefloor._coremarketreference
EngineBatchtradefloor._coremarketreference
envelopetradefloor.envelopetrustreference
evaluatetradefloor.harnessevaluationreference
Executiontradefloor.tcaexecutionreference
explaintradefloor.explaintrustreference
Explanationtradefloor.explaintrustreference
externalitiestradefloor.externalityevaluationexported, with no page of its own
Externalitytradefloor.externalityevaluationexported, with no page of its own
externalitytradefloor.externalityevaluationexported, with no page of its own
factstradefloor.factstrustexported, with no page of its own
fair_valuetradefloor._coremodel utilityexported, with no page of its own
FairValuetradefloor._coremodelexported, with no page of its own
Filltradefloor._coremarketreference
Fingerprinttradefloor.fingerprintevaluationreference
fingerprinttradefloor.fingerprintevaluationreference
FingerprintComparisontradefloor.fingerprintevaluationreference
Firingtradefloor.interventionsscenariosreference
Fliptradefloor.boundarycounterfactualsreference
fliptradefloor.boundarycounterfactualsreference
flow_impacttradefloorexecutionreference
FlowImpacttradefloorexecutionreference
GameRngtradefloor._coreutilityexported, with no page of its own
gymtradefloor.gymintegrationreference
HiddenStatetradefloor.sandboxevaluationreference
Historytradefloor.harnessevaluationreference
impulse_responsetradefloor._coremodel utilityexported, with no page of its own
Instrumenttradefloor._coremarketreference
integrationstradefloor.integrationsintegrationreference
Interventiontradefloor.interventionsscenariosreference
interventionstradefloor.interventionsscenariosreference
Invariancetradefloor.counterfactualintegrationreference
invariancetradefloor.counterfactualintegrationreference
JSONRenderertradefloor.renderintegrationreference
langgraphtradefloor.integrations.langgraphintegrationreference
leaderboardtradefloor.harnessevaluationreference
Limittradefloor.portfolioexecutionreference
losstradefloor.losstrustexported, with no page of its own
Macrotradefloor._coremarketreference
manifesttradefloor.manifestreproducibilityreference
map_boundariestradefloor.boundarycounterfactualsreference
market_statustradefloor._coreutilityexported, with no page of its own
MarketViewtradefloor.sandboxevaluationreference
MatchResulttradefloor._coremarketreference
mcptradefloor.mcpintegrationreference
MispricingStatetradefloor._coremodelexported, with no page of its own
model_presettradefloor._coremodelreference
ModelParamstradefloor._coremodelreference
Newstradefloor._coremarketreference
NewsImpacttradefloor._coremarketreference
Nodetradefloor.explaintrustreference
noisetradefloor.noisereproducibilityexported, with no page of its own
Observationtradefloor.harnessevaluationreference
openai_agentstradefloor.integrations.openai_agentsintegrationreference
oracle_is_ceilingtradefloor.baselinesevaluationreference
OrderBooktradefloor._coremarketreference
OrderErrortradefloor._coreerrorsreference
Portfoliotradefloor.portfolioevaluationreference
PortfolioViewtradefloor.sandboxevaluationreference
Positiontradefloor.portfolioevaluationexported, with no page of its own
preset_namestradefloor._coremodelreference
preset_recordtradefloor.recordsmodelreference
preset_recordstradefloor.recordsmodelreference
PriceLeveltradefloor._coremarketreference
pydantic_aitradefloor.integrations.pydantic_aiintegrationreference
ranktradefloor.rankingevaluationreference
Rankingtradefloor.rankingevaluationreference
RATE_SECTORtradefloormarketreference
rate_specstradefloormarketreference
RATE_TICKERStradefloormarketreference
reference_agentstradefloor.baselinesevaluationreference
rendertradefloor.renderintegrationreference
Renderertradefloor.renderintegrationreference
replaytradefloor.replayreproducibilityreference
Resampletradefloor.counterfactualcounterfactualsreference
resampletradefloor.counterfactualcounterfactualsreference
revealtradefloor.fingerprinttrustreference
run_manytradefloormarketreference
run_scenariotradefloor.scenarioscenariosreference
RunManifesttradefloor.manifestreproducibilityreference
sandboxtradefloor.sandboxevaluationreference
SandboxErrortradefloor.sandboxerrorsreference
Scenariotradefloor.scenarioscenariosreference
ScenarioValidationErrortradefloor.interventionserrorsreference
Scorecardtradefloor.harnessevaluationreference
sealed_batterytradefloor.fingerprintevaluationreference
sector_daily_sigmatradefloor._coremodel utilityexported, with no page of its own
sectorstradefloor._coreutilityexported, with no page of its own
spectradefloor.specevaluationreference
SPEC_VERSIONtradefloor.specevaluationexported, with no page of its own
stationary_sigmatradefloor._coremodel utilityexported, with no page of its own
step_mispricing_dailytradefloor._coremodel utilityexported, with no page of its own
StrategySpectradefloor.specevaluationreference
sweeptradefloor.sweepevaluationexported, with no page of its own
SweepCosttradefloor._coremarketreference
TARGETStradefloor.boundaryscenariosreference
tcatradefloor.tcaexecutionreference
TextRenderertradefloor.renderintegrationreference
TickResulttradefloor._coremarketreference
TradingEnvtradefloor.gymintegrationreference
Universetradefloormarketreference
UNSUPPORTED_TARGETStradefloor.interventionsscenariosreference
ValidationErrortradefloor._coreerrorsreference
Verificationtradefloor.manifestreproducibilityreference
versiontradefloor._coreutilityexported, with no page of its own
__version__tradefloorutilityexported, with no page of its own
versus_buy_and_holdtradefloor.baselinesevaluationreference
Worldtradefloor.counterfactualcounterfactualsreference
yaml_subsettradefloor.yaml_subsetutilityexported, with no page of its own

Advanced and compatibility exports

Every symbol below is in tradefloor.__all__ and stays there for the life of the release. For a symbol with no page of its own, this table is the reference. It gives the import path, the signature and how far you can rely on the symbol.

supported for normal use advanced a full API that few callers need compatibility kept so older code keeps working legacy may be removed in a later release
SignatureImportStabilityPurpose
Portfolio(cash: 'float' = 1000000.0, *, max_leverage: 'float | None' = None, cash_interest: 'bool' = False, owner: 'str' = 'agent', margin_interest: 'bool' = True) -> 'None'tradefloor.portfoliosupportedCash, positions and P&L for one trader. Members: accrue, cancel, cash, cash_interest, clear_flow, execute, fills, fills_table, gross_exposure, interest, leverage, margin_interest, market_value, marks, max_leverage, net_worth, open_orders, owner, pending_flow, pnl, positions, quantity_of, realised, stamp, starting_cash, submit_limit, sync, unrealised.
Position(ticker: 'str') -> 'None'tradefloor.portfoliosupportedA holding in one instrument. Members: avg_cost, market_value, quantity, realised, ticker, unrealised.
SPEC_VERSION: int = 1tradefloorsupportedThe 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.sweepsupportedYield (seed, table) for each seed, one at a time.
__version__: str = '0.8.7'tradefloorcompatibilityThe installed package version, as a string. It is what a RunManifest records and what a published result cites.
apply_mispricing(fair_value, s)tradefloor._coreadvancedPrice from fair value and mispricing: fair_value * exp(s), floored.
tradefloor.atlastradefloor.atlasadvancedAtlas: a map of how the model responds, instead of a search that guesses.
characteristic_root_moduli(phi=None, theta=None)tradefloor._coreadvancedModuli of the AR(2) characteristic roots.
check_rate(name, fraction)tradefloor._coreadvancedValidate a fractional rate, raising ValueError if it looks wrong.
crowd_adjusted_root_moduli()tradefloor._coreadvancedThe same, with the crowd-feedback term included.
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)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.
impulse_response(horizon_days, phi=None, theta=None)tradefloor._coreadvancedImpulse response of the daily process over horizon_days.
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.
MispricingState(s=0.0, s_prev=None)tradefloor._coreadvancedThe daily log-mispricing state. Members: s, s_prev.
sector_daily_sigma(sector)tradefloor._coreadvancedA sector's long-run daily return standard deviation, as a fraction.
sectors()tradefloor._coreadvancedThe twelve sector keys, in contractual declaration order.
stationary_sigma(innovation_sigma, *, phi=None, theta=None)tradefloor._coreadvancedStandard deviation of the daily mispricing process at rest.
step_mispricing_daily(state, *, innovation=0.0, shock=0.0)tradefloor._coreadvancedOne DAILY step of the mispricing process.
version()tradefloor._corecompatibilityThe 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_subsetadvancedA 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 is meant for people who calibrate the model, and these docs have no tutorial for it.