Algorithmic Trading Platform

Contracts / Interface

Overview

Order fill produced by ExecutionSimulator and published to the EventBus. Consumed by OrderManagementSystem, PositionManager, and RiskManagementEngine. Defined in src/domain/__init__.py.

Contract

Consumers

  • PositionManager
  • AuditLog
  • IOrderRepository

Types

NameBaseConstraints / ValuesDescription
ExecutiondataclassOrder fill event published by ExecutionSimulator after a successful fill.
Referenced By 1

Contracts

Documents

Execution Data Contract table repo://graph/nodes/b35acfc0b468db55c944e3b3eb823fd5/artifacts/execution-data-contract.md

Execution Data Contract

Order fill produced by ExecutionSimulator and published to the EventBus.

Consumed by OrderManagementSystem, PositionManager, and RiskManagementEngine.

Source: src/domain/__init__.py@dataclass class Execution

Fields

Field Type Required Default Description
order_id str ID of the originating order
symbol str Ticker symbol (e.g. AAPL, MSFT)
side Side BUY or SELL
qty float Filled quantity (shares)
price float Fill price per share
commission float 0.0 Broker commission charged
timestamp datetime now() UTC timestamp of fill
exec_id str uuid4() Unique execution identifier

Consumers

Component Usage
OrderManagementSystem Updates order status to FILLED / PARTIALLY_FILLED
PositionManager Updates position qty, avg_cost, unrealized P&L
RiskManagementEngine Updates exposure and realized P&L tracking

Notes

  • Execution is immutable once published to the EventBus
  • exec_id is auto-generated and globally unique
  • commission defaults to 0.0 in paper trading (simulated) mode
  • Side enum: BUY = "BUY", SELL = "SELL"

Execution Class Diagram diagram repo://graph/nodes/b35acfc0b468db55c944e3b3eb823fd5/artifacts/execution-class-diagram.md

Execution Class Diagram