Algorithmic Trading Platform

Architecture / Component

Overview

Manages the full order lifecycle including submission, tracking, amendment, and cancellation. Routes orders to the Execution Simulator in the prototype.

Referenced By 1

Architecture

Documents

Order Management System README document repo://graph/nodes/736d593c825978b647015a4935d1f2bb/artifacts/oms-readme.md

Order Management System

Responsibilities

Manages the full order lifecycle: creation, tracking, amendment, and cancellation.

  • Subscribes to Signal — caches for direction lookup
  • Subscribes to RiskDecision — creates Order on approval; publishes ORDER_REJECTED audit on rejection
  • Subscribes to Execution — updates order status to FILLED or PARTIALLY_FILLED

Interface

Method Description
get_order(order_id) Look up a single order by ID
amend_order(order_id, qty, limit_price) Change qty/price of a PENDING order
cancel_order(order_id) Cancel a PENDING order

Persistence

Repository Description
MemoryOrderRepository In-memory (Milestone 1, default)
PostgresOrderRepository Database-backed (Milestone 2, injectable)

Event Flow

Signal → OMS (cache)
RiskDecision(approved) → OMS → Order created → published
RiskDecision(rejected) → OMS → AuditEvent(ORDER_REJECTED)
Execution → OMS → Order status updated

Source

src/components/order_management_system.py