Glossary
Moneyline (h2h)
A straight bet on which team wins. No point spread β€” just pick the winner. Called "head-to-head" (h2h) by The Odds API. At odds of 2.50, a $10 bet pays $25 if the team wins.
Spread
A handicap bet. The favourite must win by more than the spread (e.g. -6.5 points) for the bet to pay. Levels the playing field between mismatched teams.
Total (Over/Under)
Bet on whether the combined score of both teams will be over or under a set number (e.g. Over 210.5). Doesn't matter who wins.
Outright
Bet on who wins an entire tournament (golf major, Grand Tour). Higher odds, longer timeframe. One pick from a large field.
Decimal Odds
The total payout per $1 staked. Odds of 2.50 means $2.50 back on a $1 bet ($1.50 profit). All odds in Punt Lab are decimal. Implied probability = 1 / odds.
Implied Probability
What the odds "say" about the likelihood of an outcome. Odds of 2.00 = 50% implied probability. Odds of 4.00 = 25%. The bookmaker's estimate of the true chance.
Edge
The percentage by which the best available odds exceed the market consensus. A 7% edge means you're getting paid 7% more than the market thinks the outcome is worth. See "Edge Calculation" below.
Consensus Odds
The average price across all tracked bookmakers for a given outcome. Represents the "market view" of the true probability. More bookmakers = more reliable consensus.
Paper Bet
A simulated bet tracked for performance analysis without real money. Validates the strategy before going live. Auto-settled on moneyline markets when events complete.
Value Bet
A bet where the odds offered are higher than the "true" probability of the outcome. The system detects these by comparing individual bookmakers against market consensus.
Edge Calculation β€” How Value Is Detected

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

BookmakerOddsImplied Prob
Sportsbet2.1047.6%
TAB2.0548.8%
Neds2.1546.5%
Ladbrokes2.3542.6%
Unibet2.0848.1%
1
Consensus odds = average of all bookmakers
(2.10 + 2.05 + 2.15 + 2.35 + 2.08) / 5 = 2.146
2
Consensus implied probability = 1 / 2.146 = 46.6%
The market thinks Lakers win roughly 47% of the time.
3
Best odds implied probability = 1 / 2.35 = 42.6%
Ladbrokes is pricing them at only 43% β€” they're the outlier.
4
EV (Expected Value) = true_prob Γ— offered_odds - 1
= 0.466 Γ— 2.35 - 1 = +9.5%
For every $1 bet at Ladbrokes, you expect $0.095 profit on average.
5
Kelly stake (half-Kelly, $100 bankroll): $5.40
The maths says bet ~5% of bankroll on this one.
βœ… BET β€” true prob 47%, +9.5% EV, Kelly says $5.40 β†’ likely winner that's overpaying

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.

Actionable Signals β€” When to Bet

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.

βœ… BET Place this bet. The outcome is likely to win AND the bookmaker is overpaying. Paper bet button appears with Kelly-recommended stake. Click to track it.
🟑 LEAN Real edge, higher variance. Genuine value exists on an underdog or outright contender. Paper bet button appears but consider smaller stakes or waiting for tipster/AI confirmation.
πŸ‘ MONITOR Don't bet. Positive EV detected but doesn't meet placement criteria. No bet button. May strengthen as kickoff approaches or with corroborating signals. Watch it, don't act.

Signal Criteria β€” Full Thresholds

SignalTruth SourceMin EVMin True ProbMin Kelly StakeBet Button?
βœ… BETBetfair3%25%$1Yes
βœ… BETConsensus5%30%$1.50Yes
🟑 LEANEither3%10%$0.50Yes
🟑 LEANEither (outright)3%2%$0.50Yes
πŸ‘ MONITOREither>0%anyanyNo

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 β€” External Intelligence

Tipster signals are ingested from external sources β€” Telegram channels, Twitter accounts, paid tipster services β€” and tracked for performance.

How It Works

  1. Ingest β€” Tips arrive via POST /api/tipster-signals with source name, raw text, and optionally parsed outcome/odds
  2. Match β€” Tips can be linked to existing events (event_id) and may create value bets with source = 'tipster'
  3. Boost β€” When a tipster signal aligns with a scanner-detected edge, the priority score gets a confidence boost
  4. Track β€” Each tipster source builds a track record (wins, losses, ROI) over time on the Tipsters page
  5. 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.

Bankroll Management & Bet Sizing

The system manages bet sizing through Kelly Criterion with multiple safety guardrails. Paper bankroll starts at $1,000.

How Bet Sizing Works

  1. Kelly Criterion β€” calculates the mathematically optimal fraction of bankroll to wager based on edge and odds
  2. Half-Kelly (default) β€” uses 50% of full Kelly. Sacrifices ~25% of growth rate but halves variance. Industry standard for model-based betting.
  3. 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.
  4. Limits applied β€” per-bet cap, total exposure cap, per-event cap, minimum bet check

Safety Limits

LimitDefaultWhat it does
Kelly fractionΒ½ (50%)How aggressive the sizing is. ΒΌ = conservative, Β½ = standard pro.
Per-bet cap5%No single bet can exceed 5% of bankroll ($50 on $1,000).
Total exposure cap15%All open bets combined can't exceed 15% of bankroll ($150 on $1,000).
Per-event cap10%Max exposure on any single event = 2x per-bet cap. Prevents concentration.
Min bet$1Bets below $1 are skipped (not worth tracking).
Drawdown pause30%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.

Market Timing & Deadlines

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.

Architecture

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.

Sports Coverage
SportMarketsCreditsThresholdSeason
🏈 NFLMoneyline, Spread, Total35%Sep β€” Feb
πŸ€ NBAMoneyline, Spread, Total35%Oct β€” Jun
🦘 AFLMoneyline, Spread, Total35%Mar β€” Sep
πŸ‰ NRLMoneyline, Spread, Total35%Mar β€” Oct
β›³ Golf MajorsOutright winner110%Apr, May, Jun, Jul
🚴 Cycling (Monuments + Grand Tours + Worlds)Outright winner (via Betfair)0*5%Mar–Oct
Data Pipeline
Every 30 min Odds Scanner

Pulls odds for all in-season sports, stores snapshots, runs value detection + priority scoring, expires stale bets.

Every 6 hours Stats Scanner

Fetches team standings for NFL, NBA, AFL, NRL from API-Sports. Stored as JSON for agent context.

Every 10 min Score Scanner

Pulls live scores (free, no credits), updates events, auto-settles moneyline paper bets.

What's Live Now

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.

Strategy Layers β€” Current & Planned
Live

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.

Live

Layer 2: Priority Scoring

Composite 0–100 score combining edge size, time urgency, market depth, and external confidence signals.

Ready

Layer 3: Tipster Signals

Ingest external picks from Telegram, Twitter, and paid services. Track source performance. Boost priority when tipsters corroborate scanner edges.

Planned

Layer 4: OpenClaw AI Analysis

LLM-powered contextual research β€” injuries, form, weather, news. Sets model_prob and confidence scores. Validates or overrides scanner signals.

Future

Layer 5: Automated Execution

When converging signals exceed confidence thresholds, auto-place paper bets (and eventually live bets via exchange APIs).

AI Analysis Layers

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).

Known Gaps & Future Enhancements
Gap

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.

Gap

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.

Gap

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.