ADR 009 — MiFID II RTS 6 + SEC 15c3-5 Conformance
Status: Accepted (QuantBot Platform v0.2.0) Date: 2026-05-24 LEGAL REVIEW REQUIRED. This ADR + the code it documents are an engineering crosswalk, NOT legal advice. Any production deployment trading European or US equities (or directly-affected derivatives) requires sign-off from the firm's compliance counsel and the CEO's annual certification.
Context
Algorithmic trading in EU markets is governed by Commission Delegated Regulation (EU) 2017/589 — MiFID II Regulatory Technical Standards on the organisational requirements of investment firms engaged in algorithmic trading ("RTS 6"). US market access is governed by SEC Rule 15c3-5 (17 CFR § 240.15c3-5).
Both regimes require pre-trade risk controls, kill functionality, real- time reconciliation, conformance testing, stress testing, and annual validation. The QuantBot Platform must:
- Enforce every named control before an order leaves the bot.
- Generate the annual validation report mechanically.
- Document the required attestations the firm's officers must sign.
Decision
- Two-tier risk: Layer-1 in-bot
PreTradeRiskEnginefor the latency-sensitive fast path; Layer-2 out-of-band FastAPI service for the broker-dealer-controlled aggregate-credit check (§ 240.15c3-5(d)). - Hard vs soft block: policy verdicts carry
severity = "block"(hard — order rejected) orseverity = "warn"(soft — informational only, may be overridden). Mirrors the ESMA Supervisory Briefing §72 (hard) vs §75/§76 (soft) distinction. - Crosswalk: every policy in
alphaswarm_bots/risk/policies.pycarries acitationstring. Thealphaswarm_bots/risk/reg/rts6.pyandrule_15c3_5.pymodules list the mapping by class name. - Kill switch (RTS 6 Art. 12): three-scope (
bot/fleet/platform) implementation inalphaswarm_bots/risk/kill_switch_v2.py, backed by Redis + aKillSwitchCRD. Cancellation is immediate; affected bots transition toDrainingand (optionally) flatten positions. - Real-time reconciliation (Art. 17(3)):
ExecutionAdapter.reconcile()is called on every reconnect; drop-copy ingest is the canonical real-time path; mismatches elevate toOrderStatus.DISPUTEDand quarantine the strategy from new entries. - Real-time alerts (Art. 16(5)) — "within 5 seconds":
Prometheus Alertmanager rules with
interval: 15sandfor: 0son critical signals (prometheus-rules.yaml). - Conformance testing (Art. 6):
alphaswarm_bots/risk/reg/conformance.pyships a synthetic test harness; CLIalphaswarm-bots conformance <slug>and RESTPOST /bots/{ref}/conformancerun it on demand. - Stress testing (Art. 10) — "twice the volume of the highest
volume...during the previous six months":
alphaswarm_bots/risk/reg/stress.pyreads the peak rate frombot_eventsand replays at 2x through the engine. CLIalphaswarm-bots stress <slug>and RESTPOST /bots/{ref}/stress. - Annual validation (Art. 9 + § 240.15c3-5(e)):
alphaswarm_bots/risk/reg/validation_report.pygenerates a YAML artifact with empty signature slots for risk management, internal audit, and the CEO. The generator runs daily as a Celery task; the artifact itself requires manual sign-off before submission.
Attestation slots (left blank by the generator)
The validation report has three signature slots:
- Risk management function (RTS 6 Art. 9(2)): drafts the report.
- Internal audit (RTS 6 Art. 9(3)): audits the report.
- CEO certification (SEC 15c3-5(e)): annual certification that the firm's risk management controls comply with paragraphs (b) and (c) of the rule.
The generator does NOT auto-sign these slots; that is operational, not mechanical.
Consequences
- + Every block has a regulatory citation.
- + Conformance + stress + annual validation are reproducible CI artifacts.
- − This is an engineering crosswalk; legal counsel must validate the mappings against the specific firm's regulatory perimeter.
- − Cross-asset firms (equity + futures + crypto) may need additional policies beyond what we ship out of the box.
References
- Commission Delegated Regulation (EU) 2017/589 (MiFID II RTS 6)
- 17 CFR § 240.15c3-5 (SEC Rule 15c3-5)
- ESMA Supervisory Briefing on Algorithmic Trading (26 Feb 2026)
- alphaswarm_bots/risk/