Inspiration

Prediction markets (Kalshi, Polymarket) are growing fast, but most teams still trade them like a side project: spreadsheets, Discord alerts, and ad-hoc scripts. Arbitrage windows close in seconds, settlement rules differ by venue, and one mis-sized leg can wipe out a theoretical edge.

We were inspired by a simple question: What would Bloomberg + a prop risk desk look like if it were built for prediction markets from day one? Not another “AI trading bot” that fires orders from a chat window—but a controlled autonomous stack where every action is scored, gated, logged, and replayable.

What we built

APEX Autopilot is an institutional-grade paper-trading platform for cross-platform prediction-market arbitrage. It runs a disciplined L0–L4 pipeline:

Layer Role
L0 — Ingestion Kalshi + Polymarket market data, retries, health checks, cache hydration
L1 — Finance Brain Scoring, spread modeling, confidence calibration
L2 — Agent Panel Multi-agent thesis and verdicts (BUY / SKIP / WAIT) with bounded budgets
L3 — Execution & Risk Dual-leg paper routing through M01–M09 fail-fast gates (paper-only first)
L4 — Observability Audit stream, telemetry, operator-facing events

Operators use a Next.js terminal with Arb Radar, live proposals, intelligence overlays, and system health—designed to feel like a professional trading desk, not a consumer app.

On a typical run we surface 100+ ranked arb opportunities, maintain active proposals, and enforce paper mode at settings and execution layers so experimentation never drifts into accidental live exposure.

How we built it

  1. Backend core (Python 3.11+) — FastAPI API, typed domain models, SQLiteStore for persistence, arb_engine for scanning, settlement_auditor and backtest_engine for validation loops.
  2. Risk-first execution — Sequential gate stack: paper enforcement (M01), edge floors, volume, price sanity, settlement match, daily loss caps, orderbook depth / VWAP slippage, spread width, Kelly + CFTC notional checks.
  3. Intelligence layer — Bright Data–backed source checks and arb intelligence agents that soft-fail when optional services are offline (core scanning keeps running).
  4. Frontend — Next.js dashboard (arb radar, positions, proposals) with Playwright E2E tests to catch regressions.
  5. Operations — Unified start_all.sh startup, pytest suite, 260-day execution runbooks (one-year-daily/), and architecture docs for long-horizon delivery.

We also ship investor materials: pitch brief, PPTX/PDF deck generators, and a full spoken narrative for demos.

What we learned

  • Autonomy without discipline is a liability. Agents inform; gates execute. Rejection reasons must be plain strings, not vibes.
  • Cross-venue arb is a settlement problem, not just a spread problem. Matching Kalshi and Polymarket contracts correctly matters as much as price.
  • Paper-only is a feature for velocity: you can iterate on gates, calibration, and UX before capital and compliance paths.
  • Operator trust is the product. If you cannot replay why a trade was blocked at 2 a.m., the terminal fails regardless of model quality.

Challenges we faced

  1. Fragmented runtimes — Wrong process on port 8000, missing uvicorn on python3, and silent backend failures. We fixed startup with explicit Python discovery and health checks.
  2. Data path confusion — Engine cache vs SQLite arb store (/opportunities vs /api/arb/opportunities). We documented canonical endpoints and aligned the UI.
  3. Optional intelligence dependencies — LLM adapters (e.g. Ollama) and external intel can be down; the system must degrade gracefully without blank dashboards.
  4. Speed vs explainability — Balancing sub-second scans with rich audit logs and gate-level forensics.
  5. Scope discipline — A 260-day roadmap tempts boilerplate; we regenerated early daily runbooks with concrete file/symbol targets and verification commands.

What’s next

Reliability + CI hardening, settlement precision, hosted staging, design-partner pilots, and staged autonomy controls—always behind paper gates until compliance and partner requirements are met.


Built for operators who want speed **and* a paper trail.*

Local demo (for judges who clone the repo):

git clone https://github.com/aaravjj2/Autopilot-public.git cd Autopilot-public bash start_all.sh

Terminal: http://localhost:3000

API health: http://127.0.0.1:8000/health

Arb feed: http://127.0.0.1:8000/api/arb/opportunities

Built With

  • 15
  • 3.11+
  • alpaca
  • api
  • apscheduler
  • bright
  • cache)
  • client
  • clob
  • css
  • cup
  • custom
  • dampening
  • data
  • fastapi
  • kalshi
  • kelly
  • l2
  • llm
  • models
  • next.js
  • openrouter
  • orderbook
  • playwright
  • pluggable
  • poisson
  • polymarket
  • pydantic
  • pytest
  • python
  • python-pptx
  • react
  • redis
  • reportlab
  • sqlite
  • sqlmodel
  • tailwind
  • typescript
  • vix
  • world
  • xgboost
Share this project:

Updates