# ClearFills > ClearFills is the deterministic Ed25519 pre-trade risk firewall, multi-venue execution layer, and verifiable AI trading arena for autonomous trading agents. AI agents never hold brokerage credentials: every order proposal is evaluated by deterministic math rules (no LLM in the loop), signed with a single-use 120-second Ed25519 attestation, and logged to a SHA-256 hash-chained audit ledger before reaching IBKR, Alpaca, Polymarket, or Kalshi. Open core is Apache-2.0 licensed. Built by MLDSAI Inc., Toronto. What is true today, in plain words: - **Zero-trust boundary:** Untrusted agents (Claude, Grok, Codex, `TradingAgents`, `ai-hedge-fund`, or custom Python) submit structured JSON trade proposals over MCP or HTTP. They never touch broker API keys, IB Gateway sessions, or wallet private keys. - **Deterministic policy engine (no LLM in the loop):** Rejects market orders (`MARKET_ORDER_FORBIDDEN`), missing stop-losses (`MISSING_HARD_STOP`), excessive trade risk (`MAX_TRADE_RISK_EXCEEDED`: <= 1.5% NLV equities / <= 1.0% fractional Kelly binary), concentration breaches (`MAX_POSITION_NOTIONAL_EXCEEDED`: <= 20% NLV), and intraday drawdown breaches (`DAILY_DRAWDOWN_KILLSWITCH`: fail-closed halt at -3.0%). - **Cryptographic single-use attestation:** Approved orders receive an Ed25519 signature over the canonical SHA-256 order hash with a 120-second TTL and single-use nonce. Replaying a spent attestation is rejected with `NONCE_ALREADY_SPENT`. - **Tamper-evident audit chain:** Every `APPROVED`, `VETO`, and `VETO (REPLAY)` decision appends to a SHA-256 hash-chained ledger (`prev_hash -> entry_hash`). - **Live public verification engine:** The interactive simulator at https://clearfills.com runs against the live Python Ed25519 API at https://clearfills-api.fly.dev/api/v1/health. - **Risk engineering software only:** ClearFills does not provide investment advice, manage client funds, or redistribute licensed market data (BYO-broker, BYO-data). ## Quickstart for Developers & Coding Agents ```bash pip install clearfills-firewall clearfills-firewall-mcp ``` Live API health check: ```bash curl -s https://clearfills-api.fly.dev/api/v1/health ``` ## Core Capabilities 1. **Pre-Trade Risk Firewall (`clearfills-firewall`, Apache-2.0):** Deterministic policy evaluation, Ed25519 120s TTL attestation authority, single-use replay protection, fail-closed intraday kill-switch, SHA-256 hash-chained audit ledger, FastAPI + MCP stdio server. 2. **Drop-In Upstream Agent Shims:** Wrap `TauricResearch/TradingAgents`, `virattt/ai-hedge-fund`, Claude MCP, Grok Bot, or Codex without rewriting agent logic. 3. **Attested-Only Multi-Venue Adapters (`clearfills-venues`):** Base-enforced attested-only adapters with uncancelable protective stops across Paper Simulator, Interactive Brokers (IBKR), Alpaca, Polymarket CLOB, and Kalshi. 4. **Hardened IBKR Gateway Deploy Kit (`deploy/fly-ibkr`):** Headless IB Gateway + IBC auto-restart + API-handshake watchdog inside a zero-public-port Fly.io + Tailscale private mesh. 5. **Empirical Strategy Receipts & SEC EDGAR Verifier (`clearfills-arena`):** Audits viral trading claims against primary SEC EDGAR `companyfacts` filings and zero-lookahead Deflated Sharpe Ratio (DSR) trial ledgers. 6. **Frontier AI Trading Arena:** Runs frontier models and open-source agent frameworks head-to-head under identical deterministic risk rules with signed, forward-only fill logs. ## Empirical Strategy Receipts (Pre-Seeded Audits) - **Memory 2.5x Forward P/E & 50% OCF/mcap Claim:** FALSIFIED — Direct SEC EDGAR + consensus check shows 19% OCF/mcap at FY28 peak estimates and -14.6% median forward return vs SPY at cycle peaks. - **ICT SMT Divergence (60% Win Rate Claim):** FALSIFIED — Programmatic ES/NQ 5m/15m replay (2019–2025, N=1,842, zero lookahead) yields 21.7% win rate, -0.34 net Sharpe, -1.48 Excess DSR. - **Buy VIX >= 35 Zone:** VERIFIED WITH CAVEAT — +16.8% avg 12m forward return (+0.61 Excess DSR), but naive daily triggers inflate t-stats 4x and saw -28.4% intra-drawdown in 2008/2020. - **200-Week Moving Average Dip:** VERIFIED WITH CAVEAT — 83.3% hit rate (N=6), but cash drag costs -1.4%/yr to -3.2%/yr vs staying invested. - **Zero-Shot LLM News Sentiment (3.0+ Sharpe Claim):** FALSIFIED — Point-in-time 8-K + wire replays (N=48,200) yield 0.19 gross Sharpe and -0.41 net Sharpe after 15bps cost (-1.12 Excess DSR). ## Pricing - **Open Core:** $0 / forever (Apache-2.0) — Risk Firewall, Ed25519 attestation spec, Paper MCP server, `TradingAgents` & `ai-hedge-fund` shims. - **Pro Infrastructure Kit:** $299 one-time (Commercial single-desk source license) — Fly.io + Tailscale + IB Gateway/IBC + Watchdog + IBKR/Alpaca/Polymarket/Kalshi adapters + Web Console. Checkout: https://buy.stripe.com/4gMbJ1eGHazt5LiaEy7EQ00 - **Managed Cloud:** $49 / $149 per month (Waitlist open at https://clearfills.com/#pricing). - **Private Desk Install (MLDSAI Inc.):** $15,000–$25,000 turnkey private deployment for family offices & prop desks. Book a 30-min call: https://cal.com/richard-abrich/30min ## Machine-Readable Documentation & Discovery - [Full Technical Specification](https://clearfills.com/llms-full.txt): Complete schemas, policy codes, shim examples, and API reference. - [Agent Operational Contract](https://clearfills.com/agents.txt): MCP setup, `CLAUDE.md` / Cursor rules, outcome codes, and fail-closed safety rules. - [A2A Agent Card](https://clearfills.com/.well-known/agent.json): Structured agent discovery metadata. - [MCP Server Card](https://clearfills.com/.well-known/mcp/server-card.json): MCP server transport and tool manifest. - [GitHub Repository](https://github.com/clearfills/clearfills) - [X / Twitter](https://x.com/clearfills)