API/INDEX

API index

Tradefloor's public APIs, grouped by task. Signatures and types are derived from the current package.

The task-based index covers the main APIs. The complete index below lists every supported public symbol.

Integrations

tradefloor.gymTradingEnv, a Gymnasium environment. Extra: pip install "tradefloor[rl]". Reference and contract: RL environment.
tradefloor.edgarSnapshots of SEC filings and Universe.from_edgar. Reference: EDGAR companies.
tradefloor.mcpThe MCP server, command tradefloor-mcp. Extra: pip install "tradefloor[mcp]". Tool reference: The MCP server.
tradefloor.integrations.finrobotRuns a FinRobot agent inside a World behind an observation allowlist. Extra: pip install "tradefloor[finrobot]" (Python 3.11 exactly). Tutorial: Counterfactuals; shipped studies: examples/rate-shock/ and examples/finrobot/.

Complete index

Every symbol in tradefloor.__all__, plus the optional submodules installed through extras, alphabetically. This list is checked against the package. A symbol whose reference column says so is covered by advanced and compatibility exports below.

SYMBOLMODULECATEGORYREFERENCE
Agenttradefloor.harnessevaluationreference
AgentRecordtradefloor.rankingevaluationreference
__version__tradefloorutilityexported; no dedicated reference
agreetradefloor.counterfactualcounterfactualsreference
Agreementtradefloor.counterfactualcounterfactualsreference
apply_mispricingtradefloor._coremodel utilityexported; no dedicated reference
ArrowStreamtradefloor._coredatareference
atlastradefloor.atlasmodel utilityexported; no dedicated reference
baselinestradefloor.baselinesevaluationreference
branchtradefloor.checkpointreproducibilityreference
capture_ratiotradefloor.baselinesevaluationreference
characteristic_root_modulitradefloor._coremodel utilityexported; no dedicated reference
check_ratetradefloor._coremodel utilityexported; no dedicated reference
Checkpointtradefloor.checkpointreproducibilityreference
comparetradefloor.counterfactualcounterfactualsreference
Comparisontradefloor.counterfactualcounterfactualsreference
counterfactualtradefloor.counterfactualcounterfactualsreference
crowd_adjusted_root_modulitradefloor._coremodel utilityexported; no dedicated reference
Divergencetradefloor.counterfactualcounterfactualsreference
edgartradefloor.edgardatareference
Enginetradefloor._coremarketreference
EngineBatchtradefloor._coremarketreference
envelopetradefloor.envelopetrustreference
evaluatetradefloor.harnessevaluationreference
Executiontradefloor.tcaexecutionreference
factstradefloor.factstrustexported; no dedicated reference
fair_valuetradefloor._coremodel utilityexported; no dedicated reference
FairValuetradefloor._coremodelexported; no dedicated reference
Filltradefloor._coremarketreference
Firingtradefloor.interventionsscenariosreference
flow_impacttradefloorexecutionreference
FlowImpacttradefloorexecutionreference
GameRngtradefloor._coreutilityexported; no dedicated reference
gymtradefloor.gymintegrationreference
impulse_responsetradefloor._coremodel utilityexported; no dedicated reference
Instrumenttradefloor._coremarketreference
Interventiontradefloor.interventionsscenariosreference
integrationstradefloor.integrationsintegrationreference
interventionstradefloor.interventionsscenariosreference
leaderboardtradefloor.harnessevaluationreference
losstradefloor.losstrustexported; no dedicated reference
Macrotradefloor._coremarketreference
manifesttradefloor.manifestreproducibilityreference
market_statustradefloor._coreutilityexported; no dedicated reference
MatchResulttradefloor._coremarketreference
MispricingStatetradefloor._coremodelexported; no dedicated reference
mcptradefloor.mcpintegrationreference
model_presettradefloor._coremodelreference
ModelParamstradefloor._coremodelreference
Newstradefloor._coremarketreference
NewsImpacttradefloor._coremarketreference
Observationtradefloor.harnessevaluationreference
OrderBooktradefloor._coremarketreference
OrderErrortradefloor._coreerrorsreference
Portfoliotradefloor.portfolioevaluationexported; no dedicated reference
Positiontradefloor.portfolioevaluationexported; no dedicated reference
PriceLeveltradefloor._coremarketreference
ranktradefloor.rankingevaluationreference
Rankingtradefloor.rankingevaluationreference
reference_agentstradefloor.baselinesevaluationreference
replaytradefloor.replayreproducibilityreference
run_manytradefloormarketreference
run_scenariotradefloor.scenarioscenariosreference
RunManifesttradefloor.manifestreproducibilityreference
Scenariotradefloor.scenarioscenariosreference
ScenarioValidationErrortradefloor.interventionserrorsreference
Scorecardtradefloor.harnessevaluationreference
sector_daily_sigmatradefloor._coremodel utilityexported; no dedicated reference
sectorstradefloor._coreutilityexported; no dedicated reference
spectradefloor.specevaluationreference
SPEC_VERSIONtradefloor.specevaluationexported; no dedicated reference
stationary_sigmatradefloor._coremodel utilityexported; no dedicated reference
step_mispricing_dailytradefloor._coremodel utilityexported; no dedicated reference
StrategySpectradefloor.specevaluationreference
sweeptradefloor.sweepevaluationexported; no dedicated reference
SweepCosttradefloor._coremarketreference
TARGETStradefloor.interventionsscenariosreference
tcatradefloor.tcaexecutionreference
TickResulttradefloor._coremarketreference
Universetradefloormarketreference
TradingEnvtradefloor.gymintegrationreference
UNSUPPORTED_TARGETStradefloor.interventionsscenariosreference
ValidationErrortradefloor._coreerrorsreference
versiontradefloor._coreutilityexported; no dedicated reference
Worldtradefloor.counterfactualcounterfactualsreference
yaml_subsettradefloor.yaml_subsetutilityexported; no dedicated reference

Advanced and compatibility exports

Every symbol below is in tradefloor.__all__ for 0.6.0 and stays there for the life of the release. This section is the canonical reference for the ones without a page of their own: the import path, the signature the package carries, and how much a caller may lean on it. Signatures and one-line purposes are read from the released wheel.

supported meant to be called advanced a real API with a narrow audience compatibility kept so an older caller keeps working legacy a candidate for removal in a later release
SIGNATUREIMPORTSTABILITYPURPOSE
Portfolio(cash: 'float' = 1000000.0, *, max_leverage: 'float | None' = None) -> 'None'tradefloor.portfoliosupportedCash, positions and P&L for one trader. Members: cash, clear_flow, execute, fills, fills_table, gross_exposure, leverage, market_value, marks, max_leverage, net_worth, pending_flow, pnl, positions, realised, stamp, starting_cash, 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.6.0'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)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 objective: band distance, noise-scaled, diagonally weighted.
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: which parameters move which outputs, what shape each effect has, and what trades are available at once. Its audience is whoever calibrates the model, and its tutorial pages were retired because this site is a path for people running the simulator.

All pages