Algorithmic Trading System Architecture

Risk Management API & Infrastructure Overview

This page exists for technical due diligence.

Last updated: 2025-11-16

This project is commercially licensed for production use. See README for terms.

System Overview: Strategy-Agnostic Risk-First Trading Infrastructure

Coerentis is a modular execution and risk framework composed of independently testable subsystems. This strategy-agnostic trading infrastructure enforces deterministic execution constraints and capital protection rules, sitting between trading signal generators and market execution. Unlike alpha-seeking bots or signal sellers, this infrastructure provides transparent, testable safety rails for algorithmic trading systems.

Subsystems & Maturity

Subsystem Description Location Maturity
API Service FastAPI REST API with authentication, rate limiting, structured logging app/ PRODUCTION
Safety Rails / Risk Gates Deterministic hard limits (max drawdown, regime guard, health check) app/core/safety_rails.py PRODUCTION
Simulation Engine Historical simulation and validation tooling live_sim/ BETA
Strategy Plug-in Interface Plugin interface for external trading strategies strategies/ PRODUCTION
Data Adapters Market data fetching and normalization (CoinGecko) data/ BETA
Monitoring / Metrics Health checks, performance metrics, structured logging app/routes/healthz.py, app/routes/metrics.py PRODUCTION
Dashboard Web-based monitoring dashboard dashboard/ BETA
Deployment Templates Infrastructure deployment documentation and templates infra/ UNVERIFIED

Codebase Statistics: Risk Management API & Safety Rails

67
Production Python Files
7
API Endpoints
16
Test Files
3
Safety Rules
Counting Method: File counts derived from repository structure scan (November 2025). Production files counted from boonmindx_capital_shield/ excluding tests, reports, and data files. API endpoints counted from FastAPI route decorators in app/routes/. Test count includes all test_*.py files in tests/ directory. Safety rules counted from app/core/safety_rails.py: max drawdown check, health check, regime guard.

Languages Used

Strategy Plugin Interface

Plugin interface for external trading strategies. Includes one example strategy (demo only, not for production).

Testing & Reliability: Deterministic Risk Controls Validation

Test Framework

pytest - Python testing framework

Test Coverage

Not Covered

Deterministic Behavior

In MOCK mode, the system produces deterministic outputs: same inputs produce same outputs. Safety rail decisions are deterministic and testable. Simulation engine uses deterministic algorithms for historical validation.

Design Principles: Strategy-Agnostic Risk-First Architecture

What This Trading Infrastructure Is and Is Not

Is

  • Risk-first trading infrastructure
  • Execution safety framework
  • Strategy-agnostic capital protection API
  • Deterministic risk enforcement framework
  • Safety gateway between signals and execution
  • Simulation and validation tooling
  • API-first infrastructure for algorithmic trading

Is Not

  • Trading strategy or signal generator
  • Alpha-seeking bot or profit engine
  • Black-box trading system
  • Backtesting platform
  • Live trading execution system
  • Financial advice or investment product