How It Works
Every 30 minutes, the scanner compares odds across bookmakers for each outcome. When one bookmaker's price significantly exceeds the market average, that's a value bet.
Worked Example
Event: Lakers vs Celtics β Moneyline (h2h) β Lakers to win
| Bookmaker | Odds | Implied Prob |
|---|---|---|
| Sportsbet | 2.10 | 47.6% |
| TAB | 2.05 | 48.8% |
| Neds | 2.15 | 46.5% |
| Ladbrokes | 2.35 | 42.6% |
| Unibet | 2.08 | 48.1% |
(2.10 + 2.05 + 2.15 + 2.35 + 2.08) / 5 = 2.146
The market thinks Lakers win roughly 47% of the time.
Ladbrokes is pricing them at only 43% β they're the outlier.
= 0.466 Γ 2.35 - 1 = +9.5%
For every $1 bet at Ladbrokes, you expect $0.095 profit on average.
The maths says bet ~5% of bankroll on this one.
Why Betfair is "truth"
Betfair is an exchange β prices set by two-sided competition between bettors, including professionals. No bookmaker margin. This makes it the most accurate probability estimate available. We devig Betfair's back odds to remove the small spread, giving us true probabilities. Then we compare every other bookmaker against that truth.
What this does NOT do
EV detection finds bets that are mathematically profitable over many repetitions. A +5% EV bet at 47% true probability will still lose 53% of the time. The edge means your wins will outweigh losses over hundreds of bets. Individual bets can and will lose. The AI analysis layer (OpenClaw) will add game context and form analysis later to further filter.
Every detected opportunity gets one of three clear signals. No bet button appears unless the signal is BET or LEAN. MONITOR signals show the data but intentionally don't let you place β the system is protecting you.
Signal Criteria β Full Thresholds
| Signal | Truth Source | Min EV | Min True Prob | Min Kelly Stake | Bet Button? |
|---|---|---|---|---|---|
| β BET | Betfair | 3% | 25% | $1 | Yes |
| β BET | Consensus | 5% | 30% | $1.50 | Yes |
| π‘ LEAN | Either | 3% | 10% | $0.50 | Yes |
| π‘ LEAN | Either (outright) | 3% | 2% | $0.50 | Yes |
| π MONITOR | Either | >0% | any | any | No |
Consensus-only signals have tighter thresholds because the truth source is less reliable without Betfair. Cards show a β Consensus badge when Betfair is missing.
Why most golf bets are MONITOR
Golf outright markets have 150+ players at extreme odds (41.00+). Even when EV is +23%, the true probability is only 2-3%. Kelly recommends less than the $1 minimum bet on a $1,000 bankroll. The system correctly classifies these as MONITOR β mathematically +EV but not worth placing because you'd need to bet this hundreds of times to see the edge play out, and each individual bet loses ~97% of the time.
Paper Betting
BET and LEAN signals show a "Paper bet" button. Clicking it calls the sizing API which calculates the Kelly-optimal stake based on your paper bankroll ($1,000), subtracts open exposure, and places the bet. The system auto-settles moneyline bets when events complete and updates your bankroll balance.
Tipster signals are ingested from external sources β Telegram channels, Twitter accounts, paid tipster services β and tracked for performance.
How It Works
- Ingest β Tips arrive via
POST /api/tipster-signalswith source name, raw text, and optionally parsed outcome/odds - Match β Tips can be linked to existing events (
event_id) and may create value bets withsource = 'tipster' - Boost β When a tipster signal aligns with a scanner-detected edge, the priority score gets a confidence boost
- Track β Each tipster source builds a track record (wins, losses, ROI) over time on the Tipsters page
- Resolve β Tips are marked won/lost when events complete, feeding back into source reliability
Planned Sources
- Telegram channels (via bot monitoring)
- Twitter/X accounts (via scraping or API)
- Paid tipster services (manual or automated entry)
- Your own manual picks (source = "manual")
Strategy Layering
The system is designed to combine multiple signals. A value bet detected by the scanner, confirmed by a tipster with a 65% win rate, and validated by OpenClaw agent analysis, scores much higher than any single signal alone. This is the core thesis: converging signals from independent sources = higher-conviction bets.
The system manages bet sizing through Kelly Criterion with multiple safety guardrails. Paper bankroll starts at $1,000.
How Bet Sizing Works
- Kelly Criterion β calculates the mathematically optimal fraction of bankroll to wager based on edge and odds
- Half-Kelly (default) β uses 50% of full Kelly. Sacrifices ~25% of growth rate but halves variance. Industry standard for model-based betting.
- Effective bankroll β subtracts all open bet exposure from balance before sizing. If you have $150 in open bets on a $1,000 bankroll, new bets are sized against $850.
- Limits applied β per-bet cap, total exposure cap, per-event cap, minimum bet check
Safety Limits
| Limit | Default | What it does |
|---|---|---|
| Kelly fraction | Β½ (50%) | How aggressive the sizing is. ΒΌ = conservative, Β½ = standard pro. |
| Per-bet cap | 5% | No single bet can exceed 5% of bankroll ($50 on $1,000). |
| Total exposure cap | 15% | All open bets combined can't exceed 15% of bankroll ($150 on $1,000). |
| Per-event cap | 10% | Max exposure on any single event = 2x per-bet cap. Prevents concentration. |
| Min bet | $1 | Bets below $1 are skipped (not worth tracking). |
| Drawdown pause | 30% | If bankroll drops 30% from peak, all betting is paused automatically. |
Unit Tiers
Internally the system calculates exact Kelly stakes, but displays them as unit tiers for simplicity:
- 1 unit β Kelly suggests < 1.5% of bankroll
- 2 units β Kelly suggests 1.5β3% of bankroll
- 3 units β Kelly suggests > 3% of bankroll (strong edge)
Multiple Bankrolls
Paper and real bankrolls are tracked independently with separate settings. Real money bankrolls should use more conservative settings (quarter-Kelly, 3% per-bet cap). Create via POST /api/bankrolls.
Timing matters. Value can appear and disappear as bookmakers adjust their lines. The system tracks:
β± Time to Event
Hours until the event starts. Calculated on every scan. Drives the urgency component of priority scoring. Color-coded in the UI: red <2h, amber <24h, grey >24h.
π First Detected
When the edge was first spotted. A value bet that's been live for 3 days is different from one that appeared 20 minutes ago β long-lived edges may be genuine, flash edges may be errors.
π Odds Movement
Is the edge growing or shrinking? β Rising odds mean the edge is getting better (bookmaker hasn't corrected). β Falling means other bettors or the bookmaker are narrowing it.
π« Auto-Expiry
Value bets automatically expire when the event's commence_time passes or the event completes. No action needed β stale bets are cleaned up every scan.
Decision Timeline
When you see a value bet, the key question is "how long do I have?" The hours_to_event field answers this directly. Markets typically close at or shortly before the event's commence_time. For best execution, place bets while the edge is still live and the event hasn't started.
Punt Lab is a sports betting data pipeline, value detection engine, and tracking dashboard.
API Worker
Cloudflare Worker (Hono). Cron jobs for data collection, REST API, value detection + priority scoring.
Dashboard
Astro SSR on Cloudflare Pages. Events, odds, value bets, P&L, tipster tracking. React chart islands.
D1 Database
Cloudflare D1 (SQLite). Events, odds snapshots, value bets, paper bets, tipster signals, scan state.
OpenClaw Agent
Coming later. LLM agent for contextual analysis, injury/form research, confidence scoring.
| Sport | Markets | Credits | Threshold | Season |
|---|---|---|---|---|
| π NFL | Moneyline, Spread, Total | 3 | 5% | Sep β Feb |
| π NBA | Moneyline, Spread, Total | 3 | 5% | Oct β Jun |
| π¦ AFL | Moneyline, Spread, Total | 3 | 5% | Mar β Sep |
| π NRL | Moneyline, Spread, Total | 3 | 5% | Mar β Oct |
| β³ Golf Majors | Outright winner | 1 | 10% | Apr, May, Jun, Jul |
| π΄ Cycling (Monuments + Grand Tours + Worlds) | Outright winner (via Betfair) | 0* | 5% | MarβOct |
Pulls odds for all in-season sports, stores snapshots, runs value detection + priority scoring, expires stale bets.
Fetches team standings for NFL, NBA, AFL, NRL from API-Sports. Stored as JSON for agent context.
Pulls live scores (free, no credits), updates events, auto-settles moneyline paper bets.
Betfair-first EV Detection
Uses Betfair Exchange as truth source. Devigs odds via Power method. Falls back to consensus devig (5% EV threshold) when Betfair is missing.
Closing Line Value (CLV)
Captures closing Betfair odds when events start. Calculates CLV to validate whether our bets consistently beat the closing line.
Bankroll Management
$1,000 paper bankroll with half-Kelly sizing. Effective bankroll calculation, 5% per-bet cap, 15% exposure cap, 30% drawdown pause.
Performance Analytics
P&L breakdown by sport, bookmaker, and market type. Win rate, ROI, and cumulative P&L charting.
Snapshot Cleanup
Auto-deletes odds snapshots older than 14 days to stay within D1 limits. Keeps latest per bookmaker/outcome for reference.
Line Movement Alerts
New BET-tier signals trigger Telegram alerts (when webhook configured). Detects significant odds movements between scans.
Layer 1: EV-Based Scanner
Betfair-devigged true probabilities. EV = true_prob Γ offered_odds β 1. Consensus fallback when Betfair is missing. BET/LEAN/MONITOR signals.
Layer 2: Priority Scoring
Composite 0β100 score combining edge size, time urgency, market depth, and external confidence signals.
Layer 3: Tipster Signals
Ingest external picks from Telegram, Twitter, and paid services. Track source performance. Boost priority when tipsters corroborate scanner edges.
Layer 4: OpenClaw AI Analysis
LLM-powered contextual research β injuries, form, weather, news. Sets model_prob and confidence scores. Validates or overrides scanner signals.
Layer 5: Automated Execution
When converging signals exceed confidence thresholds, auto-place paper bets (and eventually live bets via exchange APIs).
Three Claude Haiku 4.5 layers augment the math-based value detection. All are opt-in (skip gracefully when ANTHROPIC_API_KEY is not configured). Total cost: ~$3-9/month at expected volume.
Layer 1: Contextual Research (one-way filter)
On every odds scan, Claude reviews BET-tier and high-EV LEAN signals against pre-fetched news context (ESPN JSON + RSS). Returns approve / flag / reject with reasoning.
- Math stays source of truth. LLM can demote but never promote.
- BET + flag β demoted to LEAN (size down)
- BET + reject β demoted to MONITOR (don't place)
- LEAN + reject β demoted to MONITOR
- Applied inline on ValueBetCard β shows AI context box when present
Layer 2: Tipster Parser
When raw tipster text arrives via POST /api/tipster-signals, Claude extracts structured fields: sport, outcome, market, odds, confidence, stake suggestion. Populates the tipster_signals table automatically β no manual data entry needed.
Layer 3: Post-Mortem Analysis
When paper bets settle, Claude reviews each result and logs a learning insight to learning_insights. Over time, surfaces systematic patterns: which sport/market/odds-range combinations are profitable, which aren't, whether BET vs LEAN distinctions are actually predictive.
Guardrails
- Circuit breaker: auto-pause if >50% failure rate over last 20 calls
- Hard cap: 15 enrichments per scan max
- Staleness: re-analyze only if >6 hours old
- Fail-safe: LLM errors never block math signals
- Anti-hallucination: LLM never estimates probabilities (math does that) β only assesses whether context supports the bet thesis
Cost Controls
Uses Haiku 4.5 ($1 / $5 per MTok input/output) with prompt caching (90% discount on repeated system prompts). Batches multiple bets on same event into single call. News pre-fetched from free ESPN/RSS sources, cached in Cloudflare KV with 1h TTL (avoids paid web search tool).
Credit Budget Management
Free tier is 500 credits/month. Currently burning ~600/day with 7 sports at 30-min polling. Need to either upgrade to $30/month tier (20K credits) or implement smart polling β hourly on non-game days, 30-min on game days. Auto-pause off-season sports.
Market Liquidity Signal
No data on bet limits or market volume. A value bet at a bookmaker that limits to $50 is different from one accepting $5,000. Betfair Exchange volume would indicate market confidence, but requires separate Betfair API authentication. Not available through The Odds API.
Contextual Intelligence
No weather, injury, team news, or form context. The scanner detects mathematical value but can't explain why odds differ. A bookmaker may be offering high odds because they know about an injury we don't. OpenClaw agent (Layer 4) will address this, but until then we're betting on maths alone.