Skip to main content
As prediction markets become regulated financial products, Horizon provides a compliance module that gives hedge funds and institutional traders the infrastructure required for regulatory oversight.

Quick Start

Architecture

The compliance module is Python-only (not on the hot path) and uses a separate SQLite database so compliance data survives strategy changes. All components are thread-safe.

Audit Trail

Every compliance event is recorded with a SHA-256 hash chain. Each event links to its predecessor, creating a tamper-evident log that auditors can verify end-to-end.

Tracked Event Types

Trade Surveillance

Real-time detection of manipulative trading patterns using sliding-window analysis. Runs once per strategy cycle via on_cycle().

Detectors

Accessing Alerts

Human-in-the-Loop Approval

Orders exceeding a notional threshold are held for manual review. The strategy loop is never blocked - pending orders are queued and submitted asynchronously when approved.

Approval Workflow

Notification Callback

Role-Based Access Control (RBAC)

Five hierarchical roles control who can perform compliance-sensitive operations.

Regulatory Limits

Firm-wide limits enforced before order submission, separate from strategy-level RiskConfig.

Kill Switch

Emergency halt with RBAC enforcement. Requires RISK_MANAGER role or higher. Snapshots all open positions at activation time for post-incident review.

Reporting

Generate regulatory-ready reports for internal review and filing.

Daily Trade Report

Position Report

Full Compliance Report

Data Retention

SEC Rule 17a-4 requires 6+ years of record retention. Default is 2,555 days (~7 years).

Pipeline Integration

Use compliance_gate as the first function in your pipeline to automatically enforce compliance on every cycle.
When the kill switch is active, compliance_gate returns None, which halts the pipeline for that cycle. Surveillance runs every cycle. Stale approvals are auto-expired.

Standalone Usage

The compliance module works independently from hz.run():

Configuration Reference

ComplianceConfig

RegulatoryLimitConfig