Algorithmic Trading Platform

Contracts / Interface

Overview

Pre-trade risk check result produced by RiskManagementEngine and published to the EventBus. Consumed by OrderManagementSystem. Defined in src/domain/__init__.py.

Contract

Consumers

  • OrderManagementSystem
  • AuditLog

Types

NameBaseConstraints / ValuesDescription
RiskDecisiondataclassPre-trade risk check result published by RiskManagementEngine.
Referenced By 1

Contracts

Documents

RiskDecision Data Contract table repo://graph/nodes/90c9c6b4b26b928d401b4955a5165442/artifacts/riskdecision-data-contract.md

RiskDecision Data Contract

Pre-trade risk check result produced by RiskManagementEngine and published to the EventBus.

Consumed by OrderManagementSystem.

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

Fields

Field Type Required Default Description
signal_ref str signal_id of the Signal being evaluated
approved bool True if signal passed all risk checks; False if rejected
reason str Human-readable explanation of the decision
checks_passed list[str] [] Names of risk rules that passed
checks_failed list[str] [] Names of risk rules that failed
timestamp datetime now() UTC timestamp of decision
decision_id str uuid4() Unique decision identifier

Consumers

Component Usage
OrderManagementSystem Creates an Order only if approved == True; logs rejection otherwise

Notes

  • decision_id is referenced by Order.risk_ref to trace which risk decision approved the order
  • checks_passed and checks_failed are lists of rule names (e.g. "max_position_size", "daily_loss_limit")
  • A rejected decision (approved == False) terminates the signal lifecycle — no order is created

RiskDecision Class Diagram diagram repo://graph/nodes/90c9c6b4b26b928d401b4955a5165442/artifacts/riskdecision-class-diagram.md

RiskDecision Class Diagram