Sticks Ultimate V6
Automated football betting intelligence system. Poisson xG model, Kelly staking, Claude-powered analysis, gamified progression, and a premium mobile command center.
Architecture
14 Python files → FastAPI server → Next.js mobile app
→ Intelligence engine → Knowledge base (30 files)
→ SQLite databases → Docker deployment
Backend (14 Python files)
| File |
Purpose |
config.py |
API keys from .env |
sticks_doctrine.py |
TPS scoring, risk rules, gamification (6 levels, XP) |
football_stats.py |
API-Football client (Ultra plan, 450 req/min) |
betfair_client.py |
Betfair Exchange client (15 methods) |
models.py |
Poisson xG, value assessment (8% min edge), Kelly staking |
analyzer.py |
TPS edge engine (10 leagues, 30 match limit) |
agents.py |
5 agents: Scout, Analyst, Trader, Risk, Settler |
claude_analyst.py |
Claude qualitative filter (SDK or CLI pipe mode) |
data.py |
Shared data layer (settlement, stats, risk, ESPN) |
intelligence.py |
Intelligence engine (decisions, reviews, archetypes, stage gates) |
api.py |
FastAPI server (9 endpoints, 60s heartbeat) |
collector.py |
Daily odds snapshot collector |
backtester.py |
Historical backtest with real bookmaker odds |
hud.py |
Terminal HUD (legacy, replaced by web app) |
Frontend (18 source files)
| Route |
Screen |
/command |
Home — bank, P&L, positions, opportunities |
/live |
Match board — scores, odds, TPS, picks (tap → detail) |
/match?id=X |
Match detail — full analysis, sub-scores, picks |
/portfolio |
Active positions + settled history with P&L |
/intel |
Agent intelligence feed |
/profile |
Level, XP, daily P&L chart, grade stats, wiki links |
/settings |
Risk limits, markets, model params, system status |
Intelligence System (30 knowledge files)
| Category |
Files |
Purpose |
| Doctrine |
8 |
Core rules, decision/timing/rejection/review/regime/training/unlock doctrine |
| Schemas |
8 |
JSON schemas for decision, review, rejection, timing, archetype, regime, mastery, training |
| Archetypes |
7 |
Bet pattern definitions with trust thresholds |
| Failures |
4 |
Known failure modes with penalties |
| Config |
3 |
Mastery tracks, XP rules, decision template |
Infrastructure
| Service |
Port |
URL |
| API (FastAPI) |
9012 |
sportai.ictedgefund.com/api/* |
| Web (Next.js) |
9013 |
sportai.ictedgefund.com |
| Docs (MkDocs) |
9011 |
docs.sportai.ictedgefund.com |
Databases
| DB |
Contents |
sportai.db |
Fixtures, odds snapshots, decisions, reviews, rejections, timing records |
backtest.db |
1439 historical fixtures, 28 backtest results |
Quick Start
# Docker (recommended)
docker-compose up api web -d
# Local dev
pip install -r requirements.txt
python -m uvicorn api:app --port 9012 &
cd web && npm install && npm run dev
# Daily maintenance
python collector.py # Collect odds snapshots
python backtester.py # Run backtest
# Monitor
curl localhost:9012/api/intelligence # Stage gate progress
curl localhost:9012/api/status # Bankroll + risk status
System Status
- Training Stage: 1 (Observation)
- Decisions recorded: 13 / 100 needed for Stage 2
- Mode: Paper trading
- Bankroll: £115.33 (+15.3%)
- XP: 60 (Scout level)
Key Metrics
- Model: Poisson xG with 50% regression to league average
- Min edge: 8% above bookmaker implied probability
- Staking: Quarter Kelly, max 3% of bankroll
- Risk: Hard stop -£120/day, defensive at -£80, max exposure £800
- Backtest: +3.9% ROI on 28 bets (real bookmaker odds, 2025 season)
Documentation
Features
- Pull-to-refresh on all screens
- Service worker background notifications (bet settlements, risk alerts)
- Bell icon with notification pane and permission toggle
- Today P&L in status bar (calculated from settled bets)
- Staleness indicator (data > 2 min old)
- KO countdown for pending bets, live elapsed for in-play
- Paper/Live mode toggle
- Intelligence dashboard (training stage, CLV metrics, archetypes, reviews)
- Match detail screen with full analysis drill-down
- Settings page with risk limits, markets, model params, system status
- PWA support (add to home screen for native app feel)
- Skeleton loading states on all screens
- 60s auto-refresh via SWR polling