Algorithmic Trading Platform

Contracts / Interface

Overview

Audit record produced by any component and consumed by AuditLog. Provides a tamper-evident trail of all significant platform events. Defined in src/domain/__init__.py.

Contract

Consumers

  • AuditLog
  • IAuditRepository

Types

NameBaseConstraints / ValuesDescription
AuditEventdataclassImmutable audit record appended by any component for compliance and traceability.
Referenced By 1

Contracts

Documents

AuditEvent Data Contract table repo://graph/nodes/6255db8194544c9cd26396fa03cc24be/artifacts/auditevent-data-contract.md

AuditEvent Data Contract

Audit record produced by any platform component and persisted by AuditLogEventHistory.

Every domain event that flows through the EventBus is wrapped in an AuditEvent for immutable logging.

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

Fields

Field Type Required Default Description
event_type str Event category (e.g. "ORDER_CREATED", "EXECUTION_FILLED", "RISK_REJECTED")
source_component str Name of the component that produced the event
payload dict Serialized domain object (e.g. serialized Order, Execution, Signal)
timestamp datetime now() UTC timestamp of the audit record
audit_id str uuid4() Unique audit record identifier

Event Types

event_type Source Component Payload Type
ORDER_CREATED OrderManagementSystem Order
ORDER_CANCELLED OrderManagementSystem Order
EXECUTION_FILLED ExecutionSimulator Execution
RISK_APPROVED RiskManagementEngine RiskDecision
RISK_REJECTED RiskManagementEngine RiskDecision
SIGNAL_GENERATED StrategyEngine Signal
POSITION_UPDATED PositionManager Position

Consumers

Component Usage
AuditLogEventHistory Persists every AuditEvent to immutable append-only storage

Notes

  • AuditEvent is immutable once written — no updates or deletes
  • payload is a serialized dict (JSON-compatible) of the originating domain object
  • audit_id provides a globally unique handle for each audit record
  • The audit log is the authoritative source of truth for all platform activity

AuditEvent Class Diagram diagram repo://graph/nodes/6255db8194544c9cd26396fa03cc24be/artifacts/auditevent-class-diagram.md

AuditEvent Class Diagram