From b442ef5f34bd7afff4964dd22febec9e59e6b1fb Mon Sep 17 00:00:00 2001 From: bxvtr Date: Sun, 1 Mar 2026 10:47:43 +0100 Subject: [PATCH 1/3] Chore: update naming from platform to framework --- .devcontainer/devcontainer.json | 2 +- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- CHANGELOG.md | 2 +- README.md | 23 +++++++------- examples/local/backtest.py | 4 +-- examples/local/local.json | 10 +++---- examples/strategies/debug_strategy.py | 4 +-- pyproject.toml | 30 +++++++++---------- scripts/check.sh | 4 +-- .../test_cancel_non_existing_rejected.py | 12 ++++---- .../test_duplicate_new_rejected.py | 12 ++++---- .../test_inflight_blocks_replace.py | 10 +++---- .../test_replace_noop_handled.py | 10 +++---- .../models/test_models_against_schemas.py | 6 ++-- .../test_new_queued_on_rate_limit.py | 10 +++---- .../test_queue_cancel_dominates_new.py | 10 +++---- .../state_transitions/test_new_to_working.py | 4 +-- .../test_replace_to_replaced.py | 4 +-- .../test_terminal_clears_inflight.py | 4 +-- .../test_working_to_filled.py | 4 +-- trading_platform/__init__.py | 24 +++++++-------- .../backtest/adapters/execution.py | 4 +-- trading_platform/backtest/adapters/venue.py | 2 +- .../backtest/engine/hft_engine.py | 14 ++++----- .../backtest/engine/strategy_runner.py | 22 +++++++------- .../backtest/orchestrator/planner.py | 8 ++--- .../backtest/orchestrator/planner_models.py | 2 +- .../backtest/orchestrator/s3_manifest.py | 4 +-- .../backtest/orchestrator/segmenter.py | 2 +- .../backtest/orchestrator/summary.py | 2 +- .../backtest/runtime/entrypoint.py | 12 ++++---- .../runtime/experiment_finalize_entrypoint.py | 6 ++-- .../backtest/runtime/mlflow_segment_logger.py | 2 +- .../backtest/runtime/run_sweep.py | 16 +++++----- .../runtime/segment_finalize_entrypoint.py | 8 ++--- trading_platform/core/domain/state.py | 12 ++++---- trading_platform/core/events/event_bus.py | 2 +- .../core/events/sinks/null_event_bus.py | 2 +- trading_platform/core/ports/venue_policy.py | 6 ++-- trading_platform/core/risk/risk_config.py | 2 +- trading_platform/core/risk/risk_engine.py | 14 ++++----- trading_platform/strategies/base.py | 8 ++--- 42 files changed, 169 insertions(+), 172 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 1747ef4..c2abb25 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "Trading Platform Dev", + "name": "Trading Framework Dev", "build": { "dockerfile": "Dockerfile", "context": ".." diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 3170a90..7428e03 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -9,7 +9,7 @@ Clear and concise description of the issue. ## Environment -- Trading Platform version: +- Trading Framework version: - Python version: - Execution mode (local / cloud): - Strategy used: diff --git a/CHANGELOG.md b/CHANGELOG.md index 8df99b5..5f62df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ and this project adheres to Semantic Versioning. ## [0.1.0] - 2026-02-17 -Initial public release of the trading platform backtest core. +Initial public release of the trading framework backtest core. ### Added diff --git a/README.md b/README.md index 0412026..ebcabd9 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,12 @@ -# Trading Platform +# Trading Framework -![CI](https://github.com/trading-engineering/trading-platform/actions/workflows/tests.yaml/badge.svg) +![CI](https://github.com/trading-engineering/trading-framework/actions/workflows/tests.yaml/badge.svg) ![Python](https://img.shields.io/badge/python-3.11+-blue) ![License](https://img.shields.io/badge/license-MIT-green) -Deterministic, event-driven trading framework built on top of -[hftbacktest](https://github.com/nkaz001/hftbacktest), extending it with -risk management, explicit order state machines, queue semantics and -research orchestration. - -Designed for realistic backtesting and production-ready architecture. +Deterministic, event-driven core framework for trading engineering, +built on top of [hftbacktest](https://github.com/nkaz001/hftbacktest), and extended with +explicit risk management, order state machines, queue semantics, and research orchestration. --- @@ -19,7 +16,7 @@ This project wraps the open-source `hftbacktest` engine and extends it into a structured trading framework. While `hftbacktest` provides a high-performance event-driven simulation -core, this platform adds the missing layers required for realistic +core, this framework adds the missing layers required for realistic research and strategy development: - Explicit order state machine @@ -99,8 +96,8 @@ No S3, cloud storage or live connectivity required. A reproducible development environment is provided via a dev container. ```bash -git clone https://github.com/trading-engineering/trading-platform -cd trading-platform +git clone https://github.com/trading-engineering/trading-framework +cd trading-framework ``` Open in an IDE supporting Dev Containers (e.g. VS Code), reopen in @@ -151,7 +148,7 @@ These enable: Entrypoints are located in: ``` -trading_platform/backtest/runtime/ +trading_framework/backtest/runtime/ ``` Infrastructure and orchestration configuration are intentionally kept separate from the core trading framework. @@ -160,7 +157,7 @@ Cloud execution currently relies on [Oracle Cloud Infrastructure](https://cloud. The storage integration is implemented through an S3-compatible adapter in the I/O layer located in: ``` -trading_platform/backtest/io/ +trading_framework/backtest/io/ ``` The runtime entrypoints are designed primarily for [Kubernetes](https://kubernetes.io)-based workloads orchestrated via [Argo Workflows](https://argoproj.github.io/workflows). diff --git a/examples/local/backtest.py b/examples/local/backtest.py index 47932ac..0f9bf26 100644 --- a/examples/local/backtest.py +++ b/examples/local/backtest.py @@ -14,9 +14,9 @@ sys.path.insert(0, str(PROJECT_ROOT)) if TYPE_CHECKING: - from trading_platform import BacktestResult + from trading_framework import BacktestResult -from trading_platform import ( +from trading_framework import ( HftBacktestConfig, HftBacktestEngine, HftEngineConfig, diff --git a/examples/local/local.json b/examples/local/local.json index 07e397b..71ff72b 100644 --- a/examples/local/local.json +++ b/examples/local/local.json @@ -5,9 +5,9 @@ "engine": { "initial_snapshot": null, "data_files": [ - "/workspaces/trading-platform/tests/data/parts/part-000.npz", - "/workspaces/trading-platform/tests/data/parts/part-001.npz", - "/workspaces/trading-platform/tests/data/parts/part-002.npz" + "/workspaces/trading-framework/tests/data/parts/part-000.npz", + "/workspaces/trading-framework/tests/data/parts/part-001.npz", + "/workspaces/trading-framework/tests/data/parts/part-002.npz" ], "instrument": "BTC_USDC-PERPETUAL", @@ -32,8 +32,8 @@ "roi_lb": 40000, "roi_ub": 80000, - "stats_npz_path": "/workspaces/trading-platform/tests/data/results/stats.npz", - "event_bus_path": "/workspaces/trading-platform/tests/data/results/events.json" + "stats_npz_path": "/workspaces/trading-framework/tests/data/results/stats.npz", + "event_bus_path": "/workspaces/trading-framework/tests/data/results/events.json" }, "risk": { diff --git a/examples/strategies/debug_strategy.py b/examples/strategies/debug_strategy.py index 09c0ee9..4789159 100644 --- a/examples/strategies/debug_strategy.py +++ b/examples/strategies/debug_strategy.py @@ -3,7 +3,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from trading_platform import ( + from trading_framework import ( EngineContext, GateDecision, MarketEvent, @@ -11,7 +11,7 @@ StrategyState, ) -from trading_platform import ( +from trading_framework import ( NewOrderIntent, OrderIntent, Price, diff --git a/pyproject.toml b/pyproject.toml index ab03218..8cacf36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,9 +3,9 @@ requires = ["setuptools>=69", "wheel"] build-backend = "setuptools.build_meta" [project] -name = "trading-platform" +name = "trading-framework" version = "0.1.0" -description = "Trading platform." +description = "Trading Framework." readme = "README.md" requires-python = ">=3.11" authors = [{ name = "tradingeng@protonmail.com" }] @@ -43,7 +43,7 @@ dev = [ # Explicit package discovery # -------------------------------------------------- [tool.setuptools.packages.find] -include = ["trading_platform*"] +include = ["trading_framework*"] # -------------------------------------------------- # Pytest @@ -79,39 +79,39 @@ ignore_errors = true # Import Linter # -------------------------------------------------- [tool.importlinter] -root_package = "trading_platform" +root_package = "trading_framework" include_external_packages = true # Core stays pure [[tool.importlinter.contracts]] name = "Core must be pure" type = "forbidden" -source_modules = ["trading_platform.core"] +source_modules = ["trading_framework.core"] forbidden_modules = [ - "trading_platform.live", - "trading_platform.backtest", - "trading_platform.strategies" + "trading_framework.live", + "trading_framework.backtest", + "trading_framework.strategies" ] # Strategies use core only [[tool.importlinter.contracts]] name = "Strategies may depend on core only" type = "forbidden" -source_modules = ["trading_platform.strategies"] +source_modules = ["trading_framework.strategies"] forbidden_modules = [ - "trading_platform.live", - "trading_platform.backtest" + "trading_framework.live", + "trading_framework.backtest" ] # Environments must not mix [[tool.importlinter.contracts]] name = "Live and backtest must not mix" type = "forbidden" -source_modules = ["trading_platform.live"] -forbidden_modules = ["trading_platform.backtest"] +source_modules = ["trading_framework.live"] +forbidden_modules = ["trading_framework.backtest"] [[tool.importlinter.contracts]] name = "Backtest must not depend on live" type = "forbidden" -source_modules = ["trading_platform.backtest"] -forbidden_modules = ["trading_platform.live"] +source_modules = ["trading_framework.backtest"] +forbidden_modules = ["trading_framework.live"] diff --git a/scripts/check.sh b/scripts/check.sh index a3c3493..8065fcb 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -5,10 +5,10 @@ echo "🔍 Running import-linter..." lint-imports --verbose echo "⚡ Running ruff (check only)..." -ruff check trading_platform examples tests +ruff check trading_framework examples tests echo "🧠 Running mypy..." -mypy trading_platform examples tests +mypy trading_framework examples tests echo "🧪 Running pytest..." pytest diff --git a/tests/semantics/gate_risk_invariants/test_cancel_non_existing_rejected.py b/tests/semantics/gate_risk_invariants/test_cancel_non_existing_rejected.py index 031b747..a1a7a23 100644 --- a/tests/semantics/gate_risk_invariants/test_cancel_non_existing_rejected.py +++ b/tests/semantics/gate_risk_invariants/test_cancel_non_existing_rejected.py @@ -8,15 +8,15 @@ from __future__ import annotations -from trading_platform.core.domain.reject_reasons import RejectReason -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.reject_reasons import RejectReason +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( CancelOrderIntent, NotionalLimits, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_cancel_for_non_existing_order_is_rejected() -> None: diff --git a/tests/semantics/gate_risk_invariants/test_duplicate_new_rejected.py b/tests/semantics/gate_risk_invariants/test_duplicate_new_rejected.py index 5641531..0435d79 100644 --- a/tests/semantics/gate_risk_invariants/test_duplicate_new_rejected.py +++ b/tests/semantics/gate_risk_invariants/test_duplicate_new_rejected.py @@ -8,18 +8,18 @@ from __future__ import annotations -from trading_platform.core.domain.reject_reasons import RejectReason -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.reject_reasons import RejectReason +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( NewOrderIntent, NotionalLimits, OrderStateEvent, Price, Quantity, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_duplicate_new_is_rejected_when_working_order_exists() -> None: diff --git a/tests/semantics/gate_risk_invariants/test_inflight_blocks_replace.py b/tests/semantics/gate_risk_invariants/test_inflight_blocks_replace.py index 70cef8a..e898a64 100644 --- a/tests/semantics/gate_risk_invariants/test_inflight_blocks_replace.py +++ b/tests/semantics/gate_risk_invariants/test_inflight_blocks_replace.py @@ -11,17 +11,17 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( NotionalLimits, OrderStateEvent, Price, Quantity, ReplaceOrderIntent, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_inflight_blocks_new_intent_and_queues_it() -> None: diff --git a/tests/semantics/gate_risk_invariants/test_replace_noop_handled.py b/tests/semantics/gate_risk_invariants/test_replace_noop_handled.py index d87e248..bb21f9b 100644 --- a/tests/semantics/gate_risk_invariants/test_replace_noop_handled.py +++ b/tests/semantics/gate_risk_invariants/test_replace_noop_handled.py @@ -8,17 +8,17 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( NotionalLimits, OrderStateEvent, Price, Quantity, ReplaceOrderIntent, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_replace_without_effective_change_is_handled_noop() -> None: diff --git a/tests/semantics/models/test_models_against_schemas.py b/tests/semantics/models/test_models_against_schemas.py index b33b681..afc8f03 100644 --- a/tests/semantics/models/test_models_against_schemas.py +++ b/tests/semantics/models/test_models_against_schemas.py @@ -22,7 +22,7 @@ from referencing import Registry, Resource from referencing.jsonschema import DRAFT202012 -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.types import ( FillEvent, MarketEvent, OrderIntent, @@ -43,8 +43,8 @@ def load_schema(name: str) -> dict: """ global SCHEMA_REGISTRY - root = Path(__file__).parent.parent.parent.parent # /workspaces/trading-platform - name = "trading_platform/core/schemas/" + name + root = Path(__file__).parent.parent.parent.parent # /workspaces/trading-framework + name = "trading_framework/core/schemas/" + name schema_path = root / name with schema_path.open("r", encoding="utf-8") as f: diff --git a/tests/semantics/queue_semantics/test_new_queued_on_rate_limit.py b/tests/semantics/queue_semantics/test_new_queued_on_rate_limit.py index bba46a8..c3c8a55 100644 --- a/tests/semantics/queue_semantics/test_new_queued_on_rate_limit.py +++ b/tests/semantics/queue_semantics/test_new_queued_on_rate_limit.py @@ -8,17 +8,17 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( NewOrderIntent, NotionalLimits, OrderRateLimits, Price, Quantity, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_new_is_queued_when_rate_limit_blocks() -> None: diff --git a/tests/semantics/queue_semantics/test_queue_cancel_dominates_new.py b/tests/semantics/queue_semantics/test_queue_cancel_dominates_new.py index 84ea6ba..5a92fab 100644 --- a/tests/semantics/queue_semantics/test_queue_cancel_dominates_new.py +++ b/tests/semantics/queue_semantics/test_queue_cancel_dominates_new.py @@ -9,8 +9,8 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( CancelOrderIntent, NewOrderIntent, NotionalLimits, @@ -18,9 +18,9 @@ Price, Quantity, ) -from trading_platform.core.events.sinks.null_event_bus import NullEventBus -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RiskEngine +from trading_framework.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RiskEngine def test_cancel_dominates_queued_new() -> None: diff --git a/tests/semantics/state_transitions/test_new_to_working.py b/tests/semantics/state_transitions/test_new_to_working.py index db3c364..7d2a756 100644 --- a/tests/semantics/state_transitions/test_new_to_working.py +++ b/tests/semantics/state_transitions/test_new_to_working.py @@ -8,8 +8,8 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.events.sinks.null_event_bus import NullEventBus def test_new_transitions_to_working() -> None: diff --git a/tests/semantics/state_transitions/test_replace_to_replaced.py b/tests/semantics/state_transitions/test_replace_to_replaced.py index 7e07703..5d09ba3 100644 --- a/tests/semantics/state_transitions/test_replace_to_replaced.py +++ b/tests/semantics/state_transitions/test_replace_to_replaced.py @@ -8,8 +8,8 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.events.sinks.null_event_bus import NullEventBus def test_replace_transitions_to_replaced() -> None: diff --git a/tests/semantics/state_transitions/test_terminal_clears_inflight.py b/tests/semantics/state_transitions/test_terminal_clears_inflight.py index 208e162..c577f86 100644 --- a/tests/semantics/state_transitions/test_terminal_clears_inflight.py +++ b/tests/semantics/state_transitions/test_terminal_clears_inflight.py @@ -7,8 +7,8 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.events.sinks.null_event_bus import NullEventBus def test_terminal_clears_inflight() -> None: diff --git a/tests/semantics/state_transitions/test_working_to_filled.py b/tests/semantics/state_transitions/test_working_to_filled.py index 0de52db..8c54f93 100644 --- a/tests/semantics/state_transitions/test_working_to_filled.py +++ b/tests/semantics/state_transitions/test_working_to_filled.py @@ -7,8 +7,8 @@ from __future__ import annotations -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.events.sinks.null_event_bus import NullEventBus +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.events.sinks.null_event_bus import NullEventBus def test_working_transitions_to_filled() -> None: diff --git a/trading_platform/__init__.py b/trading_platform/__init__.py index d98bf36..d3975c7 100644 --- a/trading_platform/__init__.py +++ b/trading_platform/__init__.py @@ -1,4 +1,4 @@ -"""Public API for the trading_platform package. +"""Public API for the trading_framework package. Only symbols imported here are considered part of the stable, supported external interface. @@ -11,13 +11,13 @@ # ---------------------------------------------------------------------- # Backtest Engine API # ---------------------------------------------------------------------- -from trading_platform.backtest.engine.engine_base import BacktestResult -from trading_platform.backtest.engine.hft_engine import ( +from trading_framework.backtest.engine.engine_base import BacktestResult +from trading_framework.backtest.engine.hft_engine import ( HftBacktestConfig, HftBacktestEngine, HftEngineConfig, ) -from trading_platform.core.domain.slots import ( +from trading_framework.core.domain.slots import ( SlotKey, stable_slot_order_id, ) @@ -25,8 +25,8 @@ # ---------------------------------------------------------------------- # Domain Types (used by strategies) # ---------------------------------------------------------------------- -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( MarketEvent, NewOrderIntent, OrderIntent, @@ -35,19 +35,19 @@ ReplaceOrderIntent, RiskConstraints, ) -from trading_platform.core.ports.engine_context import EngineContext +from trading_framework.core.ports.engine_context import EngineContext # ---------------------------------------------------------------------- # Config API (used by consumers) # ---------------------------------------------------------------------- -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import GateDecision +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import GateDecision # ---------------------------------------------------------------------- # Strategy Interface # ---------------------------------------------------------------------- -from trading_platform.strategies.base import Strategy -from trading_platform.strategies.strategy_config import StrategyConfig +from trading_framework.strategies.base import Strategy +from trading_framework.strategies.strategy_config import StrategyConfig # ---------------------------------------------------------------------- # Public API definition @@ -90,6 +90,6 @@ # ---------------------------------------------------------------------- try: - __version__ = version("trading-platform") + __version__ = version("trading-framework") except PackageNotFoundError: __version__ = "0.0.0" diff --git a/trading_platform/backtest/adapters/execution.py b/trading_platform/backtest/adapters/execution.py index 3b40b96..206f5e7 100644 --- a/trading_platform/backtest/adapters/execution.py +++ b/trading_platform/backtest/adapters/execution.py @@ -9,9 +9,9 @@ if TYPE_CHECKING: from hftbacktest import ROIVectorMarketDepthBacktest - from trading_platform.core.domain.types import OrderIntent + from trading_framework.core.domain.types import OrderIntent -from trading_platform.core.domain.reject_reasons import RejectReason +from trading_framework.core.domain.reject_reasons import RejectReason class ExecutionAdapter(Protocol): diff --git a/trading_platform/backtest/adapters/venue.py b/trading_platform/backtest/adapters/venue.py index 1c0d32a..09c524d 100644 --- a/trading_platform/backtest/adapters/venue.py +++ b/trading_platform/backtest/adapters/venue.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: from hftbacktest import ROIVectorMarketDepthBacktest -from trading_platform.core.ports.venue_adapter import VenueAdapter +from trading_framework.core.ports.venue_adapter import VenueAdapter @dataclass(frozen=True) diff --git a/trading_platform/backtest/engine/hft_engine.py b/trading_platform/backtest/engine/hft_engine.py index abf74aa..ca2f535 100644 --- a/trading_platform/backtest/engine/hft_engine.py +++ b/trading_platform/backtest/engine/hft_engine.py @@ -13,18 +13,18 @@ ) if TYPE_CHECKING: - from trading_platform.core.risk.risk_config import RiskConfig + from trading_framework.core.risk.risk_config import RiskConfig -from trading_platform.backtest.adapters.execution import HftBacktestExecutionAdapter -from trading_platform.backtest.adapters.venue import HftBacktestVenueAdapter -from trading_platform.backtest.engine.engine_base import ( +from trading_framework.backtest.adapters.execution import HftBacktestExecutionAdapter +from trading_framework.backtest.adapters.venue import HftBacktestVenueAdapter +from trading_framework.backtest.engine.engine_base import ( BacktestConfig, BacktestEngine, BacktestResult, ) -from trading_platform.backtest.engine.strategy_runner import HftStrategyRunner -from trading_platform.strategies.base import Strategy -from trading_platform.strategies.strategy_config import StrategyConfig +from trading_framework.backtest.engine.strategy_runner import HftStrategyRunner +from trading_framework.strategies.base import Strategy +from trading_framework.strategies.strategy_config import StrategyConfig # pylint: disable=too-many-instance-attributes diff --git a/trading_platform/backtest/engine/strategy_runner.py b/trading_platform/backtest/engine/strategy_runner.py index cd4116d..6f9ace1 100644 --- a/trading_platform/backtest/engine/strategy_runner.py +++ b/trading_platform/backtest/engine/strategy_runner.py @@ -7,8 +7,8 @@ from pathlib import Path from typing import TYPE_CHECKING, Any -from trading_platform.core.domain.state import StrategyState -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.state import StrategyState +from trading_framework.core.domain.types import ( BookLevel, BookPayload, MarketEvent, @@ -16,17 +16,17 @@ Price, Quantity, ) -from trading_platform.core.events.event_bus import EventBus -from trading_platform.core.events.sinks.file_recorder import FileRecorderSink -from trading_platform.core.events.sinks.sink_logging import LoggingEventSink -from trading_platform.core.ports.venue_adapter import VenueAdapter -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.core.risk.risk_engine import RejectedIntent, RiskEngine +from trading_framework.core.events.event_bus import EventBus +from trading_framework.core.events.sinks.file_recorder import FileRecorderSink +from trading_framework.core.events.sinks.sink_logging import LoggingEventSink +from trading_framework.core.ports.venue_adapter import VenueAdapter +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.core.risk.risk_engine import RejectedIntent, RiskEngine if TYPE_CHECKING: - from trading_platform.backtest.adapters.execution import HftBacktestExecutionAdapter - from trading_platform.backtest.engine.hft_engine import HftEngineConfig - from trading_platform.strategies.base import Strategy + from trading_framework.backtest.adapters.execution import HftBacktestExecutionAdapter + from trading_framework.backtest.engine.hft_engine import HftEngineConfig + from trading_framework.strategies.base import Strategy MAX_TIMEOUT_NS = 1 << 62 # Effectively "wait forever" without a heartbeat diff --git a/trading_platform/backtest/orchestrator/planner.py b/trading_platform/backtest/orchestrator/planner.py index d5327bd..7fa8676 100644 --- a/trading_platform/backtest/orchestrator/planner.py +++ b/trading_platform/backtest/orchestrator/planner.py @@ -3,14 +3,14 @@ from typing import TYPE_CHECKING, Any if TYPE_CHECKING: - from trading_platform.backtest.orchestrator.manifest import DataFileMeta, DatasetManifest + from trading_framework.backtest.orchestrator.manifest import DataFileMeta, DatasetManifest -from trading_platform.backtest.orchestrator.planner_models import ( +from trading_framework.backtest.orchestrator.planner_models import ( ExperimentPlan, SegmentPlan, ) -from trading_platform.backtest.orchestrator.segmenter import segment_files -from trading_platform.backtest.orchestrator.sweeps import ( +from trading_framework.backtest.orchestrator.segmenter import segment_files +from trading_framework.backtest.orchestrator.sweeps import ( expand_parameter_grid, expand_ranges, ) diff --git a/trading_platform/backtest/orchestrator/planner_models.py b/trading_platform/backtest/orchestrator/planner_models.py index c56abb5..4e7c7b8 100644 --- a/trading_platform/backtest/orchestrator/planner_models.py +++ b/trading_platform/backtest/orchestrator/planner_models.py @@ -11,7 +11,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from trading_platform.backtest.orchestrator.sweeps import SweepPlan + from trading_framework.backtest.orchestrator.sweeps import SweepPlan @dataclass(frozen=True, slots=True) diff --git a/trading_platform/backtest/orchestrator/s3_manifest.py b/trading_platform/backtest/orchestrator/s3_manifest.py index f35beda..86c49bd 100644 --- a/trading_platform/backtest/orchestrator/s3_manifest.py +++ b/trading_platform/backtest/orchestrator/s3_manifest.py @@ -2,8 +2,8 @@ import json -from trading_platform.backtest.io.s3_adapter import OCIObjectStorageS3Shim -from trading_platform.backtest.orchestrator.manifest import DataFileMeta, DatasetManifest +from trading_framework.backtest.io.s3_adapter import OCIObjectStorageS3Shim +from trading_framework.backtest.orchestrator.manifest import DataFileMeta, DatasetManifest class S3DatasetManifest(DatasetManifest): diff --git a/trading_platform/backtest/orchestrator/segmenter.py b/trading_platform/backtest/orchestrator/segmenter.py index 293bfbe..b560b77 100644 --- a/trading_platform/backtest/orchestrator/segmenter.py +++ b/trading_platform/backtest/orchestrator/segmenter.py @@ -10,7 +10,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from trading_platform.backtest.orchestrator.manifest import DataFileMeta + from trading_framework.backtest.orchestrator.manifest import DataFileMeta def segment_files( diff --git a/trading_platform/backtest/orchestrator/summary.py b/trading_platform/backtest/orchestrator/summary.py index 076eda9..6b1c01d 100644 --- a/trading_platform/backtest/orchestrator/summary.py +++ b/trading_platform/backtest/orchestrator/summary.py @@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, List if TYPE_CHECKING: - from trading_platform.backtest.orchestrator.planner_models import ExperimentPlan + from trading_framework.backtest.orchestrator.planner_models import ExperimentPlan # --------------------------------------------------------------------------- diff --git a/trading_platform/backtest/runtime/entrypoint.py b/trading_platform/backtest/runtime/entrypoint.py index 4a4a2ba..0348153 100644 --- a/trading_platform/backtest/runtime/entrypoint.py +++ b/trading_platform/backtest/runtime/entrypoint.py @@ -8,16 +8,16 @@ from typing import TYPE_CHECKING, Any if TYPE_CHECKING: - from trading_platform.backtest.orchestrator.planner_models import ExperimentPlan + from trading_framework.backtest.orchestrator.planner_models import ExperimentPlan -from trading_platform.backtest.orchestrator.planner import plan_experiment -from trading_platform.backtest.orchestrator.s3_manifest import S3DatasetManifest -from trading_platform.backtest.orchestrator.summary import ( +from trading_framework.backtest.orchestrator.planner import plan_experiment +from trading_framework.backtest.orchestrator.s3_manifest import S3DatasetManifest +from trading_framework.backtest.orchestrator.summary import ( print_experiment_summary, summarize_experiment, ) -from trading_platform.backtest.orchestrator.sweeps import RangeSpec -from trading_platform.backtest.runtime.context import SweepContext +from trading_framework.backtest.orchestrator.sweeps import RangeSpec +from trading_framework.backtest.runtime.context import SweepContext # --------------------------------------------------------------------------- # Helpers diff --git a/trading_platform/backtest/runtime/experiment_finalize_entrypoint.py b/trading_platform/backtest/runtime/experiment_finalize_entrypoint.py index 7891cb9..bbf5e13 100644 --- a/trading_platform/backtest/runtime/experiment_finalize_entrypoint.py +++ b/trading_platform/backtest/runtime/experiment_finalize_entrypoint.py @@ -8,9 +8,9 @@ from datetime import datetime, timezone from pathlib import Path -from trading_platform.backtest.io.s3_adapter import OCIObjectStorageS3Shim -from trading_platform.backtest.runtime.context import ExperimentContext -from trading_platform.backtest.runtime.prometheus_metrics import PrometheusMetricsClient +from trading_framework.backtest.io.s3_adapter import OCIObjectStorageS3Shim +from trading_framework.backtest.runtime.context import ExperimentContext +from trading_framework.backtest.runtime.prometheus_metrics import PrometheusMetricsClient LOGGER = logging.getLogger(__name__) diff --git a/trading_platform/backtest/runtime/mlflow_segment_logger.py b/trading_platform/backtest/runtime/mlflow_segment_logger.py index 3622be5..c484d6d 100644 --- a/trading_platform/backtest/runtime/mlflow_segment_logger.py +++ b/trading_platform/backtest/runtime/mlflow_segment_logger.py @@ -7,7 +7,7 @@ import mlflow if TYPE_CHECKING: - from trading_platform.backtest.runtime.context import SegmentContext + from trading_framework.backtest.runtime.context import SegmentContext LOGGER = logging.getLogger(__name__) diff --git a/trading_platform/backtest/runtime/run_sweep.py b/trading_platform/backtest/runtime/run_sweep.py index e1c6c42..f159faa 100644 --- a/trading_platform/backtest/runtime/run_sweep.py +++ b/trading_platform/backtest/runtime/run_sweep.py @@ -4,7 +4,7 @@ import importlib.metadata import json import os -import platform +import framework import shutil import sys import tomllib @@ -13,15 +13,15 @@ from pathlib import Path from typing import Any -from trading_platform.backtest.engine.hft_engine import ( +from trading_framework.backtest.engine.hft_engine import ( HftBacktestConfig, HftBacktestEngine, HftEngineConfig, ) -from trading_platform.backtest.io.s3_adapter import OCIObjectStorageS3Shim -from trading_platform.backtest.runtime.context import SweepContext -from trading_platform.core.risk.risk_config import RiskConfig -from trading_platform.strategies.strategy_config import StrategyConfig +from trading_framework.backtest.io.s3_adapter import OCIObjectStorageS3Shim +from trading_framework.backtest.runtime.context import SweepContext +from trading_framework.core.risk.risk_config import RiskConfig +from trading_framework.strategies.strategy_config import StrategyConfig class SweepMaterializer: @@ -223,7 +223,7 @@ def _resolve_project_metadata(cls) -> dict[str, str | None]: pyproject_path ) - distribution_name = name_from_pyproject or "trading-platform" + distribution_name = name_from_pyproject or "trading-framework" version: str | None source: str @@ -281,7 +281,7 @@ def write( }, "environment": { "python": sys.version.split()[0], - "platform": platform.platform(), + "framework": framework.framework(), "container_image": os.environ.get("IMAGE_TAG"), }, "artifacts": { diff --git a/trading_platform/backtest/runtime/segment_finalize_entrypoint.py b/trading_platform/backtest/runtime/segment_finalize_entrypoint.py index a62b857..f8cd9be 100644 --- a/trading_platform/backtest/runtime/segment_finalize_entrypoint.py +++ b/trading_platform/backtest/runtime/segment_finalize_entrypoint.py @@ -6,10 +6,10 @@ from datetime import datetime, timezone from pathlib import Path -from trading_platform.backtest.io.s3_adapter import OCIObjectStorageS3Shim -from trading_platform.backtest.runtime.context import SegmentContext -from trading_platform.backtest.runtime.mlflow_segment_logger import MlflowSegmentLogger -from trading_platform.backtest.runtime.prometheus_metrics import PrometheusMetricsClient +from trading_framework.backtest.io.s3_adapter import OCIObjectStorageS3Shim +from trading_framework.backtest.runtime.context import SegmentContext +from trading_framework.backtest.runtime.mlflow_segment_logger import MlflowSegmentLogger +from trading_framework.backtest.runtime.prometheus_metrics import PrometheusMetricsClient LOGGER = logging.getLogger(__name__) diff --git a/trading_platform/core/domain/state.py b/trading_platform/core/domain/state.py index c005595..32b5123 100644 --- a/trading_platform/core/domain/state.py +++ b/trading_platform/core/domain/state.py @@ -15,10 +15,10 @@ from dataclasses import dataclass from typing import TYPE_CHECKING, Callable, Iterable -from trading_platform.core.domain.order_state_machine import is_valid_transition -from trading_platform.core.domain.slots import SlotKey, stable_slot_order_id -from trading_platform.core.domain.types import OrderStateEvent -from trading_platform.core.events.events import ( +from trading_framework.core.domain.order_state_machine import is_valid_transition +from trading_framework.core.domain.slots import SlotKey, stable_slot_order_id +from trading_framework.core.domain.types import OrderStateEvent +from trading_framework.core.events.events import ( DerivedFillEvent, DerivedPnLEvent, ExposureDerivedEvent, @@ -26,8 +26,8 @@ ) if TYPE_CHECKING: - from trading_platform.core.domain.types import FillEvent, NewOrderIntent, OrderIntent - from trading_platform.core.events.event_bus import EventBus + from trading_framework.core.domain.types import FillEvent, NewOrderIntent, OrderIntent + from trading_framework.core.events.event_bus import EventBus # --------------------------------------------------------------------------- diff --git a/trading_platform/core/events/event_bus.py b/trading_platform/core/events/event_bus.py index 8f53632..7a5fc34 100644 --- a/trading_platform/core/events/event_bus.py +++ b/trading_platform/core/events/event_bus.py @@ -5,7 +5,7 @@ from typing import Any, Iterable -from trading_platform.core.events.event_sink import EventSink +from trading_framework.core.events.event_sink import EventSink class EventBus: diff --git a/trading_platform/core/events/sinks/null_event_bus.py b/trading_platform/core/events/sinks/null_event_bus.py index cd25000..1816fe9 100644 --- a/trading_platform/core/events/sinks/null_event_bus.py +++ b/trading_platform/core/events/sinks/null_event_bus.py @@ -2,7 +2,7 @@ from typing import Any -from trading_platform.core.events.event_bus import EventBus +from trading_framework.core.events.event_bus import EventBus class _NullSink: diff --git a/trading_platform/core/ports/venue_policy.py b/trading_platform/core/ports/venue_policy.py index 575b9bb..f2717b2 100644 --- a/trading_platform/core/ports/venue_policy.py +++ b/trading_platform/core/ports/venue_policy.py @@ -12,11 +12,11 @@ from dataclasses import dataclass from typing import TYPE_CHECKING -from trading_platform.core.domain.reject_reasons import RejectReason -from trading_platform.core.domain.types import NewOrderIntent, OrderIntent +from trading_framework.core.domain.reject_reasons import RejectReason +from trading_framework.core.domain.types import NewOrderIntent, OrderIntent if TYPE_CHECKING: - from trading_platform.core.domain.state import StrategyState + from trading_framework.core.domain.state import StrategyState @dataclass(slots=True) diff --git a/trading_platform/core/risk/risk_config.py b/trading_platform/core/risk/risk_config.py index 4729e70..20e4629 100644 --- a/trading_platform/core/risk/risk_config.py +++ b/trading_platform/core/risk/risk_config.py @@ -6,7 +6,7 @@ from pydantic import BaseModel, ConfigDict, Field, model_validator -from trading_platform.core.domain.types import ( +from trading_framework.core.domain.types import ( MaxLoss, NotionalLimits, OrderRateLimits, diff --git a/trading_platform/core/risk/risk_engine.py b/trading_platform/core/risk/risk_engine.py index 37d0c18..e869e7a 100644 --- a/trading_platform/core/risk/risk_engine.py +++ b/trading_platform/core/risk/risk_engine.py @@ -7,17 +7,17 @@ from dataclasses import dataclass from typing import TYPE_CHECKING -from trading_platform.core.domain.reject_reasons import RejectReason -from trading_platform.core.domain.types import NewOrderIntent, OrderIntent, RiskConstraints -from trading_platform.core.events.events import RiskDecisionEvent -from trading_platform.core.ports.venue_policy import VenuePolicy +from trading_framework.core.domain.reject_reasons import RejectReason +from trading_framework.core.domain.types import NewOrderIntent, OrderIntent, RiskConstraints +from trading_framework.core.events.events import RiskDecisionEvent +from trading_framework.core.ports.venue_policy import VenuePolicy if TYPE_CHECKING: from risk.risk_config import RiskConfig - from trading_platform.core.domain.state import StrategyState - from trading_platform.core.domain.types import QuoteLimits - from trading_platform.core.events.event_bus import EventBus + from trading_framework.core.domain.state import StrategyState + from trading_framework.core.domain.types import QuoteLimits + from trading_framework.core.events.event_bus import EventBus # --------------------------------------------------------------------------- diff --git a/trading_platform/strategies/base.py b/trading_platform/strategies/base.py index 67eaec0..e72693f 100644 --- a/trading_platform/strategies/base.py +++ b/trading_platform/strategies/base.py @@ -11,10 +11,10 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from trading_platform.core.domain.state import StrategyState - from trading_platform.core.domain.types import MarketEvent, OrderIntent, RiskConstraints - from trading_platform.core.ports.engine_context import EngineContext - from trading_platform.core.risk.risk_engine import GateDecision + from trading_framework.core.domain.state import StrategyState + from trading_framework.core.domain.types import MarketEvent, OrderIntent, RiskConstraints + from trading_framework.core.ports.engine_context import EngineContext + from trading_framework.core.risk.risk_engine import GateDecision class Strategy(ABC): From 4f84b0307781fc4ff89742daff9f7a2fa632929c Mon Sep 17 00:00:00 2001 From: bxvtr Date: Sun, 1 Mar 2026 10:07:21 +0000 Subject: [PATCH 2/3] Renaming folder --- {trading_platform => trading_framework}/__init__.py | 0 {trading_platform => trading_framework}/backtest/__init__.py | 0 .../backtest/adapters/__init__.py | 0 .../backtest/adapters/execution.py | 0 .../backtest/adapters/venue.py | 0 .../backtest/engine/__init__.py | 0 .../backtest/engine/engine_base.py | 0 .../backtest/engine/hft_engine.py | 0 .../backtest/engine/strategy_runner.py | 0 {trading_platform => trading_framework}/backtest/io/__init__.py | 0 {trading_platform => trading_framework}/backtest/io/s3_adapter.py | 0 .../backtest/orchestrator/__init__.py | 0 .../backtest/orchestrator/manifest.py | 0 .../backtest/orchestrator/planner.py | 0 .../backtest/orchestrator/planner_models.py | 0 .../backtest/orchestrator/s3_manifest.py | 0 .../backtest/orchestrator/segmenter.py | 0 .../backtest/orchestrator/summary.py | 0 .../backtest/orchestrator/sweeps.py | 0 .../backtest/runtime/__init__.py | 0 .../backtest/runtime/context.py | 0 .../backtest/runtime/entrypoint.py | 0 .../backtest/runtime/experiment_finalize_entrypoint.py | 0 .../backtest/runtime/mlflow_segment_logger.py | 0 .../backtest/runtime/prometheus_metrics.py | 0 .../backtest/runtime/run_sweep.py | 0 .../backtest/runtime/segment_finalize_entrypoint.py | 0 .../backtest/sinks/__init__.py | 0 {trading_platform => trading_framework}/backtest/sinks/logging.py | 0 .../backtest/sinks/research_recorder.py | 0 {trading_platform => trading_framework}/core/__init__.py | 0 {trading_platform => trading_framework}/core/domain/__init__.py | 0 .../core/domain/order_state_machine.py | 0 .../core/domain/reject_reasons.py | 0 {trading_platform => trading_framework}/core/domain/slots.py | 0 {trading_platform => trading_framework}/core/domain/state.py | 0 {trading_platform => trading_framework}/core/domain/types.py | 0 {trading_platform => trading_framework}/core/events/__init__.py | 0 {trading_platform => trading_framework}/core/events/event_bus.py | 0 {trading_platform => trading_framework}/core/events/event_sink.py | 0 {trading_platform => trading_framework}/core/events/events.py | 0 .../core/events/sinks/file_recorder.py | 0 .../core/events/sinks/null_event_bus.py | 0 .../core/events/sinks/sink_logging.py | 0 {trading_platform => trading_framework}/core/ports/__init__.py | 0 .../core/ports/engine_context.py | 0 .../core/ports/venue_adapter.py | 0 .../core/ports/venue_policy.py | 0 {trading_platform => trading_framework}/core/risk/__init__.py | 0 {trading_platform => trading_framework}/core/risk/risk_config.py | 0 {trading_platform => trading_framework}/core/risk/risk_engine.py | 0 .../core/schemas/common.schema.json | 0 .../core/schemas/fill_event.schema.json | 0 .../core/schemas/market_event.schema.json | 0 .../core/schemas/order_intent.schema.json | 0 .../core/schemas/order_state_event.schema.json | 0 .../core/schemas/risk_constraints.schema.json | 0 {trading_platform => trading_framework}/live/__init__.py | 0 {trading_platform => trading_framework}/live/adapters/__init__.py | 0 .../live/adapters/deribit/__init__.py | 0 {trading_platform => trading_framework}/live/runtime/__init__.py | 0 {trading_platform => trading_framework}/live/sinks/__init__.py | 0 {trading_platform => trading_framework}/strategies/__init__.py | 0 {trading_platform => trading_framework}/strategies/base.py | 0 .../strategies/strategy_config.py | 0 65 files changed, 0 insertions(+), 0 deletions(-) rename {trading_platform => trading_framework}/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/adapters/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/adapters/execution.py (100%) rename {trading_platform => trading_framework}/backtest/adapters/venue.py (100%) rename {trading_platform => trading_framework}/backtest/engine/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/engine/engine_base.py (100%) rename {trading_platform => trading_framework}/backtest/engine/hft_engine.py (100%) rename {trading_platform => trading_framework}/backtest/engine/strategy_runner.py (100%) rename {trading_platform => trading_framework}/backtest/io/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/io/s3_adapter.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/manifest.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/planner.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/planner_models.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/s3_manifest.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/segmenter.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/summary.py (100%) rename {trading_platform => trading_framework}/backtest/orchestrator/sweeps.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/context.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/entrypoint.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/experiment_finalize_entrypoint.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/mlflow_segment_logger.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/prometheus_metrics.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/run_sweep.py (100%) rename {trading_platform => trading_framework}/backtest/runtime/segment_finalize_entrypoint.py (100%) rename {trading_platform => trading_framework}/backtest/sinks/__init__.py (100%) rename {trading_platform => trading_framework}/backtest/sinks/logging.py (100%) rename {trading_platform => trading_framework}/backtest/sinks/research_recorder.py (100%) rename {trading_platform => trading_framework}/core/__init__.py (100%) rename {trading_platform => trading_framework}/core/domain/__init__.py (100%) rename {trading_platform => trading_framework}/core/domain/order_state_machine.py (100%) rename {trading_platform => trading_framework}/core/domain/reject_reasons.py (100%) rename {trading_platform => trading_framework}/core/domain/slots.py (100%) rename {trading_platform => trading_framework}/core/domain/state.py (100%) rename {trading_platform => trading_framework}/core/domain/types.py (100%) rename {trading_platform => trading_framework}/core/events/__init__.py (100%) rename {trading_platform => trading_framework}/core/events/event_bus.py (100%) rename {trading_platform => trading_framework}/core/events/event_sink.py (100%) rename {trading_platform => trading_framework}/core/events/events.py (100%) rename {trading_platform => trading_framework}/core/events/sinks/file_recorder.py (100%) rename {trading_platform => trading_framework}/core/events/sinks/null_event_bus.py (100%) rename {trading_platform => trading_framework}/core/events/sinks/sink_logging.py (100%) rename {trading_platform => trading_framework}/core/ports/__init__.py (100%) rename {trading_platform => trading_framework}/core/ports/engine_context.py (100%) rename {trading_platform => trading_framework}/core/ports/venue_adapter.py (100%) rename {trading_platform => trading_framework}/core/ports/venue_policy.py (100%) rename {trading_platform => trading_framework}/core/risk/__init__.py (100%) rename {trading_platform => trading_framework}/core/risk/risk_config.py (100%) rename {trading_platform => trading_framework}/core/risk/risk_engine.py (100%) rename {trading_platform => trading_framework}/core/schemas/common.schema.json (100%) rename {trading_platform => trading_framework}/core/schemas/fill_event.schema.json (100%) rename {trading_platform => trading_framework}/core/schemas/market_event.schema.json (100%) rename {trading_platform => trading_framework}/core/schemas/order_intent.schema.json (100%) rename {trading_platform => trading_framework}/core/schemas/order_state_event.schema.json (100%) rename {trading_platform => trading_framework}/core/schemas/risk_constraints.schema.json (100%) rename {trading_platform => trading_framework}/live/__init__.py (100%) rename {trading_platform => trading_framework}/live/adapters/__init__.py (100%) rename {trading_platform => trading_framework}/live/adapters/deribit/__init__.py (100%) rename {trading_platform => trading_framework}/live/runtime/__init__.py (100%) rename {trading_platform => trading_framework}/live/sinks/__init__.py (100%) rename {trading_platform => trading_framework}/strategies/__init__.py (100%) rename {trading_platform => trading_framework}/strategies/base.py (100%) rename {trading_platform => trading_framework}/strategies/strategy_config.py (100%) diff --git a/trading_platform/__init__.py b/trading_framework/__init__.py similarity index 100% rename from trading_platform/__init__.py rename to trading_framework/__init__.py diff --git a/trading_platform/backtest/__init__.py b/trading_framework/backtest/__init__.py similarity index 100% rename from trading_platform/backtest/__init__.py rename to trading_framework/backtest/__init__.py diff --git a/trading_platform/backtest/adapters/__init__.py b/trading_framework/backtest/adapters/__init__.py similarity index 100% rename from trading_platform/backtest/adapters/__init__.py rename to trading_framework/backtest/adapters/__init__.py diff --git a/trading_platform/backtest/adapters/execution.py b/trading_framework/backtest/adapters/execution.py similarity index 100% rename from trading_platform/backtest/adapters/execution.py rename to trading_framework/backtest/adapters/execution.py diff --git a/trading_platform/backtest/adapters/venue.py b/trading_framework/backtest/adapters/venue.py similarity index 100% rename from trading_platform/backtest/adapters/venue.py rename to trading_framework/backtest/adapters/venue.py diff --git a/trading_platform/backtest/engine/__init__.py b/trading_framework/backtest/engine/__init__.py similarity index 100% rename from trading_platform/backtest/engine/__init__.py rename to trading_framework/backtest/engine/__init__.py diff --git a/trading_platform/backtest/engine/engine_base.py b/trading_framework/backtest/engine/engine_base.py similarity index 100% rename from trading_platform/backtest/engine/engine_base.py rename to trading_framework/backtest/engine/engine_base.py diff --git a/trading_platform/backtest/engine/hft_engine.py b/trading_framework/backtest/engine/hft_engine.py similarity index 100% rename from trading_platform/backtest/engine/hft_engine.py rename to trading_framework/backtest/engine/hft_engine.py diff --git a/trading_platform/backtest/engine/strategy_runner.py b/trading_framework/backtest/engine/strategy_runner.py similarity index 100% rename from trading_platform/backtest/engine/strategy_runner.py rename to trading_framework/backtest/engine/strategy_runner.py diff --git a/trading_platform/backtest/io/__init__.py b/trading_framework/backtest/io/__init__.py similarity index 100% rename from trading_platform/backtest/io/__init__.py rename to trading_framework/backtest/io/__init__.py diff --git a/trading_platform/backtest/io/s3_adapter.py b/trading_framework/backtest/io/s3_adapter.py similarity index 100% rename from trading_platform/backtest/io/s3_adapter.py rename to trading_framework/backtest/io/s3_adapter.py diff --git a/trading_platform/backtest/orchestrator/__init__.py b/trading_framework/backtest/orchestrator/__init__.py similarity index 100% rename from trading_platform/backtest/orchestrator/__init__.py rename to trading_framework/backtest/orchestrator/__init__.py diff --git a/trading_platform/backtest/orchestrator/manifest.py b/trading_framework/backtest/orchestrator/manifest.py similarity index 100% rename from trading_platform/backtest/orchestrator/manifest.py rename to trading_framework/backtest/orchestrator/manifest.py diff --git a/trading_platform/backtest/orchestrator/planner.py b/trading_framework/backtest/orchestrator/planner.py similarity index 100% rename from trading_platform/backtest/orchestrator/planner.py rename to trading_framework/backtest/orchestrator/planner.py diff --git a/trading_platform/backtest/orchestrator/planner_models.py b/trading_framework/backtest/orchestrator/planner_models.py similarity index 100% rename from trading_platform/backtest/orchestrator/planner_models.py rename to trading_framework/backtest/orchestrator/planner_models.py diff --git a/trading_platform/backtest/orchestrator/s3_manifest.py b/trading_framework/backtest/orchestrator/s3_manifest.py similarity index 100% rename from trading_platform/backtest/orchestrator/s3_manifest.py rename to trading_framework/backtest/orchestrator/s3_manifest.py diff --git a/trading_platform/backtest/orchestrator/segmenter.py b/trading_framework/backtest/orchestrator/segmenter.py similarity index 100% rename from trading_platform/backtest/orchestrator/segmenter.py rename to trading_framework/backtest/orchestrator/segmenter.py diff --git a/trading_platform/backtest/orchestrator/summary.py b/trading_framework/backtest/orchestrator/summary.py similarity index 100% rename from trading_platform/backtest/orchestrator/summary.py rename to trading_framework/backtest/orchestrator/summary.py diff --git a/trading_platform/backtest/orchestrator/sweeps.py b/trading_framework/backtest/orchestrator/sweeps.py similarity index 100% rename from trading_platform/backtest/orchestrator/sweeps.py rename to trading_framework/backtest/orchestrator/sweeps.py diff --git a/trading_platform/backtest/runtime/__init__.py b/trading_framework/backtest/runtime/__init__.py similarity index 100% rename from trading_platform/backtest/runtime/__init__.py rename to trading_framework/backtest/runtime/__init__.py diff --git a/trading_platform/backtest/runtime/context.py b/trading_framework/backtest/runtime/context.py similarity index 100% rename from trading_platform/backtest/runtime/context.py rename to trading_framework/backtest/runtime/context.py diff --git a/trading_platform/backtest/runtime/entrypoint.py b/trading_framework/backtest/runtime/entrypoint.py similarity index 100% rename from trading_platform/backtest/runtime/entrypoint.py rename to trading_framework/backtest/runtime/entrypoint.py diff --git a/trading_platform/backtest/runtime/experiment_finalize_entrypoint.py b/trading_framework/backtest/runtime/experiment_finalize_entrypoint.py similarity index 100% rename from trading_platform/backtest/runtime/experiment_finalize_entrypoint.py rename to trading_framework/backtest/runtime/experiment_finalize_entrypoint.py diff --git a/trading_platform/backtest/runtime/mlflow_segment_logger.py b/trading_framework/backtest/runtime/mlflow_segment_logger.py similarity index 100% rename from trading_platform/backtest/runtime/mlflow_segment_logger.py rename to trading_framework/backtest/runtime/mlflow_segment_logger.py diff --git a/trading_platform/backtest/runtime/prometheus_metrics.py b/trading_framework/backtest/runtime/prometheus_metrics.py similarity index 100% rename from trading_platform/backtest/runtime/prometheus_metrics.py rename to trading_framework/backtest/runtime/prometheus_metrics.py diff --git a/trading_platform/backtest/runtime/run_sweep.py b/trading_framework/backtest/runtime/run_sweep.py similarity index 100% rename from trading_platform/backtest/runtime/run_sweep.py rename to trading_framework/backtest/runtime/run_sweep.py diff --git a/trading_platform/backtest/runtime/segment_finalize_entrypoint.py b/trading_framework/backtest/runtime/segment_finalize_entrypoint.py similarity index 100% rename from trading_platform/backtest/runtime/segment_finalize_entrypoint.py rename to trading_framework/backtest/runtime/segment_finalize_entrypoint.py diff --git a/trading_platform/backtest/sinks/__init__.py b/trading_framework/backtest/sinks/__init__.py similarity index 100% rename from trading_platform/backtest/sinks/__init__.py rename to trading_framework/backtest/sinks/__init__.py diff --git a/trading_platform/backtest/sinks/logging.py b/trading_framework/backtest/sinks/logging.py similarity index 100% rename from trading_platform/backtest/sinks/logging.py rename to trading_framework/backtest/sinks/logging.py diff --git a/trading_platform/backtest/sinks/research_recorder.py b/trading_framework/backtest/sinks/research_recorder.py similarity index 100% rename from trading_platform/backtest/sinks/research_recorder.py rename to trading_framework/backtest/sinks/research_recorder.py diff --git a/trading_platform/core/__init__.py b/trading_framework/core/__init__.py similarity index 100% rename from trading_platform/core/__init__.py rename to trading_framework/core/__init__.py diff --git a/trading_platform/core/domain/__init__.py b/trading_framework/core/domain/__init__.py similarity index 100% rename from trading_platform/core/domain/__init__.py rename to trading_framework/core/domain/__init__.py diff --git a/trading_platform/core/domain/order_state_machine.py b/trading_framework/core/domain/order_state_machine.py similarity index 100% rename from trading_platform/core/domain/order_state_machine.py rename to trading_framework/core/domain/order_state_machine.py diff --git a/trading_platform/core/domain/reject_reasons.py b/trading_framework/core/domain/reject_reasons.py similarity index 100% rename from trading_platform/core/domain/reject_reasons.py rename to trading_framework/core/domain/reject_reasons.py diff --git a/trading_platform/core/domain/slots.py b/trading_framework/core/domain/slots.py similarity index 100% rename from trading_platform/core/domain/slots.py rename to trading_framework/core/domain/slots.py diff --git a/trading_platform/core/domain/state.py b/trading_framework/core/domain/state.py similarity index 100% rename from trading_platform/core/domain/state.py rename to trading_framework/core/domain/state.py diff --git a/trading_platform/core/domain/types.py b/trading_framework/core/domain/types.py similarity index 100% rename from trading_platform/core/domain/types.py rename to trading_framework/core/domain/types.py diff --git a/trading_platform/core/events/__init__.py b/trading_framework/core/events/__init__.py similarity index 100% rename from trading_platform/core/events/__init__.py rename to trading_framework/core/events/__init__.py diff --git a/trading_platform/core/events/event_bus.py b/trading_framework/core/events/event_bus.py similarity index 100% rename from trading_platform/core/events/event_bus.py rename to trading_framework/core/events/event_bus.py diff --git a/trading_platform/core/events/event_sink.py b/trading_framework/core/events/event_sink.py similarity index 100% rename from trading_platform/core/events/event_sink.py rename to trading_framework/core/events/event_sink.py diff --git a/trading_platform/core/events/events.py b/trading_framework/core/events/events.py similarity index 100% rename from trading_platform/core/events/events.py rename to trading_framework/core/events/events.py diff --git a/trading_platform/core/events/sinks/file_recorder.py b/trading_framework/core/events/sinks/file_recorder.py similarity index 100% rename from trading_platform/core/events/sinks/file_recorder.py rename to trading_framework/core/events/sinks/file_recorder.py diff --git a/trading_platform/core/events/sinks/null_event_bus.py b/trading_framework/core/events/sinks/null_event_bus.py similarity index 100% rename from trading_platform/core/events/sinks/null_event_bus.py rename to trading_framework/core/events/sinks/null_event_bus.py diff --git a/trading_platform/core/events/sinks/sink_logging.py b/trading_framework/core/events/sinks/sink_logging.py similarity index 100% rename from trading_platform/core/events/sinks/sink_logging.py rename to trading_framework/core/events/sinks/sink_logging.py diff --git a/trading_platform/core/ports/__init__.py b/trading_framework/core/ports/__init__.py similarity index 100% rename from trading_platform/core/ports/__init__.py rename to trading_framework/core/ports/__init__.py diff --git a/trading_platform/core/ports/engine_context.py b/trading_framework/core/ports/engine_context.py similarity index 100% rename from trading_platform/core/ports/engine_context.py rename to trading_framework/core/ports/engine_context.py diff --git a/trading_platform/core/ports/venue_adapter.py b/trading_framework/core/ports/venue_adapter.py similarity index 100% rename from trading_platform/core/ports/venue_adapter.py rename to trading_framework/core/ports/venue_adapter.py diff --git a/trading_platform/core/ports/venue_policy.py b/trading_framework/core/ports/venue_policy.py similarity index 100% rename from trading_platform/core/ports/venue_policy.py rename to trading_framework/core/ports/venue_policy.py diff --git a/trading_platform/core/risk/__init__.py b/trading_framework/core/risk/__init__.py similarity index 100% rename from trading_platform/core/risk/__init__.py rename to trading_framework/core/risk/__init__.py diff --git a/trading_platform/core/risk/risk_config.py b/trading_framework/core/risk/risk_config.py similarity index 100% rename from trading_platform/core/risk/risk_config.py rename to trading_framework/core/risk/risk_config.py diff --git a/trading_platform/core/risk/risk_engine.py b/trading_framework/core/risk/risk_engine.py similarity index 100% rename from trading_platform/core/risk/risk_engine.py rename to trading_framework/core/risk/risk_engine.py diff --git a/trading_platform/core/schemas/common.schema.json b/trading_framework/core/schemas/common.schema.json similarity index 100% rename from trading_platform/core/schemas/common.schema.json rename to trading_framework/core/schemas/common.schema.json diff --git a/trading_platform/core/schemas/fill_event.schema.json b/trading_framework/core/schemas/fill_event.schema.json similarity index 100% rename from trading_platform/core/schemas/fill_event.schema.json rename to trading_framework/core/schemas/fill_event.schema.json diff --git a/trading_platform/core/schemas/market_event.schema.json b/trading_framework/core/schemas/market_event.schema.json similarity index 100% rename from trading_platform/core/schemas/market_event.schema.json rename to trading_framework/core/schemas/market_event.schema.json diff --git a/trading_platform/core/schemas/order_intent.schema.json b/trading_framework/core/schemas/order_intent.schema.json similarity index 100% rename from trading_platform/core/schemas/order_intent.schema.json rename to trading_framework/core/schemas/order_intent.schema.json diff --git a/trading_platform/core/schemas/order_state_event.schema.json b/trading_framework/core/schemas/order_state_event.schema.json similarity index 100% rename from trading_platform/core/schemas/order_state_event.schema.json rename to trading_framework/core/schemas/order_state_event.schema.json diff --git a/trading_platform/core/schemas/risk_constraints.schema.json b/trading_framework/core/schemas/risk_constraints.schema.json similarity index 100% rename from trading_platform/core/schemas/risk_constraints.schema.json rename to trading_framework/core/schemas/risk_constraints.schema.json diff --git a/trading_platform/live/__init__.py b/trading_framework/live/__init__.py similarity index 100% rename from trading_platform/live/__init__.py rename to trading_framework/live/__init__.py diff --git a/trading_platform/live/adapters/__init__.py b/trading_framework/live/adapters/__init__.py similarity index 100% rename from trading_platform/live/adapters/__init__.py rename to trading_framework/live/adapters/__init__.py diff --git a/trading_platform/live/adapters/deribit/__init__.py b/trading_framework/live/adapters/deribit/__init__.py similarity index 100% rename from trading_platform/live/adapters/deribit/__init__.py rename to trading_framework/live/adapters/deribit/__init__.py diff --git a/trading_platform/live/runtime/__init__.py b/trading_framework/live/runtime/__init__.py similarity index 100% rename from trading_platform/live/runtime/__init__.py rename to trading_framework/live/runtime/__init__.py diff --git a/trading_platform/live/sinks/__init__.py b/trading_framework/live/sinks/__init__.py similarity index 100% rename from trading_platform/live/sinks/__init__.py rename to trading_framework/live/sinks/__init__.py diff --git a/trading_platform/strategies/__init__.py b/trading_framework/strategies/__init__.py similarity index 100% rename from trading_platform/strategies/__init__.py rename to trading_framework/strategies/__init__.py diff --git a/trading_platform/strategies/base.py b/trading_framework/strategies/base.py similarity index 100% rename from trading_platform/strategies/base.py rename to trading_framework/strategies/base.py diff --git a/trading_platform/strategies/strategy_config.py b/trading_framework/strategies/strategy_config.py similarity index 100% rename from trading_platform/strategies/strategy_config.py rename to trading_framework/strategies/strategy_config.py From 7e0257572e8f3c829b7e8ba3821bb6e88e73bd23 Mon Sep 17 00:00:00 2001 From: bxvtr Date: Sun, 1 Mar 2026 10:12:26 +0000 Subject: [PATCH 3/3] Fix import --- trading_framework/backtest/runtime/run_sweep.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trading_framework/backtest/runtime/run_sweep.py b/trading_framework/backtest/runtime/run_sweep.py index f159faa..9fc9065 100644 --- a/trading_framework/backtest/runtime/run_sweep.py +++ b/trading_framework/backtest/runtime/run_sweep.py @@ -4,7 +4,7 @@ import importlib.metadata import json import os -import framework +import platform import shutil import sys import tomllib @@ -281,7 +281,7 @@ def write( }, "environment": { "python": sys.version.split()[0], - "framework": framework.framework(), + "framework": platform.platform(), "container_image": os.environ.get("IMAGE_TAG"), }, "artifacts": {