Claxton is an automated, deterministic options trading engine built in Python (FastAPI).
It’s designed around a 9-stage pipeline (evaluate → gate → price → execute → monitor → exit) with desk-style guardrails (no market orders by default, kill switch modes, reconciliation, risk caps, etc.).
┌───────────────────────────────┐
│ Dashboard UI (Next.js) │
│ claxton-dashboard │
└───────────────┬───────────────┘
│ REST
▼
┌───────────────────────────────┐
│ Claxton-Quant API (FastAPI) │
│ - Bot loop (entry scan/monitor)
│ - Strategy pipeline (A–I) │
│ - Risk snapshots + caps │
│ - Reconciliation │
│ - Backtest endpoints │
└───────────────┬───────────────┘
│
┌──────────┴──────────┐
│ │
▼ ▼
┌──────────────┐ ┌──────────────┐
│ Broker API │ │ Supabase DB │
│ Tradier (live)│ │ Postgres │
│ + Provider │ │ (settings, │
│ abstraction │ │ trades, audit)
└──────────────┘ └──────────────┘
Related repo (UI): https://github.com/nickgag626/claxton-dashboard
cd claxton-quant-python
python -m venv venv
source venv/bin/activate # or `venv\Scripts\activate` on Windows
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your credentials
python -m api.main
# or: uvicorn api.main:app --reload --port 8000Server runs at: http://localhost:8000
See phased-approach.md for the full list. Common variables:
TRADIER_API_TOKEN,TRADIER_ACCOUNT_ID,TRADIER_BASE_URLSUPABASE_URL,SUPABASE_SERVICE_KEYUSE_STREAMING(WebSocket vs polling)LIVE_TRADING(safety gate)DISALLOW_MARKET_ORDERSTASKS_TOKEN(cron task auth)PORTFOLIO_MAX_ABS_DELTA_SHARES,PORTFOLIO_MAX_ABS_VEGA,PORTFOLIO_MAX_ABS_GAMMA
Source of truth is
api/main.pyand the routers inapi/*.py.
GET /healthGET /api/health/deepGET /api/calendar/status
GET /api/bot/statusPOST /api/bot/startPOST /api/bot/stopPOST /api/bot/scan-entriesGET /api/bot/entry-statusPOST /api/bot/refresh-positions
GET /api/quote/{symbol}GET /api/chain/{symbol}/{expiration}GET /api/expirations/{symbol}
GET /api/account/balanceGET /api/account/positionsGET /api/account/orders
POST /api/engine/evaluatePOST /api/engine/executePOST /api/engine/check-exitsGET /api/cron/check-exits
GET /api/reconcileGET /api/reconcile/statusPOST /api/reconcile/trigger
GET /api/risk/snapshotGET /api/risk/historyGET /api/risk/scenariosPOST /api/risk/capsGET /api/risk/triggers
GET /api/backtest/strategiesPOST /api/backtest/runPOST /api/backtest/sweep
GET /api/iv-surface/{symbol}GET /api/smart-dte/{symbol}
GET /api/mcp/statusPOST /api/mcp/configureGET /api/mcp/scanGET /api/mcp/analyze/{symbol}GET /api/parity/reportPOST /api/parity/run
claxton-quant-python/
├── api/ # FastAPI app + routers
├── services/ # pipeline, broker/provider adapters, execution, monitoring
├── strategies/ # strategy implementations
├── models/ # pydantic/dataclasses models
├── migrations/ # DB migrations/sql
├── tests/
└── phased-approach.md # detailed roadmap + pipeline spec
Phase 2 adds a market-implied probability engine used during scanning to compute:
-
EV_net (USD): probability-weighted return minus friction.
EV_net = (P_win * MaxProfit) - (P_loss * MaxLoss) - TotalFriction- Friction = commissions + slippage/spread penalty (per contract per leg).
- Trades must satisfy EV_net > 0 to pass Stage G.
-
POT (Probability of Touch): trade “stress” indicator.
- Approximation:
POT ≈ 2 × Prob(ITM)(clamped to [0, 1]). - For iron condors:
POT_total = POT_put + POT_call(clamped to 1.0). - A soft warning is emitted when
POT > 0.70to flag high-stress setups.
- Approximation:
- Delta-based strike selection
- Credit/width percentage filters
- Bid/ask spread validation
- DTE range filtering
- Profit target (% of credit)
- Stop loss (% of credit)
- Time stop (DTE threshold)
- Max positions per strategy
- Max risk per trade
- Daily loss limits
- Entry cooldowns
Strategies + global settings are stored in Supabase and read by the bot loop.
- Strategy model definitions:
models/trading.py - Settings + strategy tables: see
phased-approach.mdandmigrations/
Example strategy fields (simplified):
{
"name": "SPY Iron Condor",
"underlying": "SPY",
"min_dte": 30,
"max_dte": 60,
"target_delta": 0.16,
"min_credit": 0.50,
"profit_target_percent": 50.0,
"stop_loss_percent": 200.0,
"time_stop_dte": 7,
"max_positions": 3,
"max_risk_per_trade": 500.0
}The primary UI lives in claxton-dashboard (Next.js). It calls this API over REST.
Example (entry scan):
const res = await fetch(`${API_URL}/api/engine/evaluate`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ strategies: [...] }),
});
const data = await res.json();# Install dependencies
pip install -r requirements.txt
# Run with systemd or supervisor
uvicorn api.main:app --host 0.0.0.0 --port 8000
# Or use gunicorn for production
pip install gunicorn
gunicorn api.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]- pandas/numpy - Much easier data manipulation
- Better quant libraries - ta-lib, backtrader, scipy
- Options pricing - py_vollib, mibian for greeks
- ML capabilities - scikit-learn, tensorflow if needed
- Industry standard - Most quant shops use Python
MIT