How It Works
A complete technical overview of the BetterBot prediction engine and position sizing.
Overview
BetterBot is an AI-powered prediction engine that analyzes sporting events and takes positions on Kalshi, a CFTC-regulated designated contract market. The system operates a fully automated daily pipeline: it discovers upcoming events, gathers research from dozens of sources, runs a structured multi-phase analysis, takes calibrated positions, and commits the entire result on-chain.
Analysis Pipeline
The analysis pipeline executes no more than 48 hours before an event's scheduled start time. For most events, predictions are generated same-day. The pipeline follows a fixed sequence:
- Event Discovery — Upcoming events are ingested from multiple data sources including official league APIs, Highlightly, and ESPN. The system identifies all scheduled events that don't yet have predictions.
- Research Gathering — For each event, the system generates sport-specific search queries and fetches articles from across the web.
- Statistical Injection — Historical performance data, calibration offsets, and league-level base rates are computed and injected as context.
- LLM Inference — A structured multi-phase analysis is executed against the gathered research and statistics.
- Calibration — Raw predictions are adjusted based on historical calibration data and uncertainty factors.
- Execution — Qualifying forecasts are sized and the positions are opened on Kalshi.
Sport Archetypes
Each sport has a unique analytical archetype that governs how predictions are structured. Archetypes encode domain knowledge about what matters most in each sport: which factors carry the most predictive weight, what base rates to expect, and how much parity exists in the league.
For example, basketball archetypes emphasize talent gaps and pace/efficiency matchups with a 60% historical home-win rate. Ice hockey archetypes account for extreme parity (home ice advantage is only ~52%) and prioritize possession metrics, goaltender form, and back-to-back scheduling penalties. Baseball archetypes lead with starting pitcher matchups, which account for 20-30% of outcome variance, while soccer archetypes must handle three-outcome markets where draws occur 15-20% of the time.
Beyond sport-level defaults, individual leagues can have their own overrides. These capture regional factors, competition-specific rules, and cultural context that affects prediction accuracy.
Research & Data Gathering
Before any prediction is made, the system pre-gathers research for each event. This is a multi-phase process designed to surface the most relevant, high-quality information available.
The system generates 10-16 sport-specific search queries per event, covering injury reports, expert previews, head-to-head history, recent scheduling, and archetype-specific factors. Queries are executed across multiple search backends including Google, Brave, Yahoo, Yandex, Mojeek, and Wikipedia. URLs are deduplicated and full article text is extracted.
Sources are enforced by tier. Tier 1 sources (official statistics, verified box scores) and Tier 2 sources (expert analysis from ESPN, The Athletic, and similar outlets) are prioritized. Prediction market prices, bookmaker lines and betting commentary are explicitly excluded from the research corpus to prevent circular reasoning.
Statistical data is injected separately from article research. This includes league-wide historical averages, team-level recent performance metrics, head-to-head records, and calibration bin offsets computed from the system's own prediction history.
Prediction Framework
Every prediction follows a mandatory structured analytical framework with ten distinct phases. The framework is designed to enforce disciplined reasoning, prevent common cognitive biases, and produce calibrated probability estimates.
Contextual Anchoring
The analysis begins by establishing the event's temporal context, the sport and league domain, and the relevant base rates. This anchors all subsequent reasoning to empirical starting points rather than narrative.
Question Decomposition
The core prediction question is broken down into sub-questions. Key entities (teams, players), criteria, constraints, and hidden variables are identified explicitly so nothing is assumed.
Candidate Enumeration
All plausible outcomes are listed with explicit inclusion reasons. For two-outcome sports this means home win and away win. For soccer and similar sports, draw is included as a third candidate.
Scoring Criteria
Four to seven weighted, measurable criteria are defined for the specific matchup. Criteria weights are sport-specific: basketball might weight star player availability at 25% and pace/efficiency at 20%, while baseball weights starting pitcher quality at 20-30% and bullpen state at 15-20%. Weights must sum to 100%.
Research Synthesis
The pre-gathered research findings are extracted and organized by team. Findings are ordered by impact, with the highest-impact factor leading: starting pitcher for baseball, possession metrics for hockey, QB status for football. Source tiers are enforced and contradictions are flagged.
Cross-Validation
Contradictions between findings are surfaced and resolved. The system explicitly checks for recency bias, narrative bias, and whether home/away advantage is being appropriately weighted.
Weighted Scoring
Each candidate is scored 1-10 on each criterion. Scores are weighted by the criteria weights defined earlier to produce a composite score per candidate. Every score must cite specific evidence.
Probability Computation
Weighted scores are converted to raw probability estimates. An uncertainty penalty (0-15 points, sport-specific) is applied based on factors like unconfirmed injuries, weak source quality, and unresolved contradictions. Calibration offsets from historical performance data are then applied to produce the final calibrated probability.
Final Ranking & Upset Assessment
All candidates are ranked by probability (summing to 100%). The most plausible upset scenario is identified, and volatility factors are documented. This ensures the system explicitly considers downside risk rather than anchoring only to the most likely outcome.
Confidence Assessment
The final phase assesses evidence quality (what percentage of findings came from Tier 1-2 sources), identifies key uncertainties, and establishes a shelf life for the prediction — conditions under which the analysis should be revised before the event.
Calibration & Uncertainty
Raw probability outputs from the prediction framework are adjusted through two mechanisms: uncertainty penalties and calibration offsets.
Uncertainty penalties reduce confidence when the evidence base is weak. The system tracks specific uncertainty signals — unconfirmed injuries, low source quality, contradictions between findings, and missing data — and applies sport-specific penalty schedules. For example, an unconfirmed starting pitcher in baseball adds a larger penalty than in basketball, where no single player carries as much outcome variance.
Calibration offsets are computed from the system's own prediction history. Predictions are bucketed by probability range (e.g., 60-65%, 65-70%), and the observed accuracy in each bin is compared to the predicted probability. If the system historically forecasts 70% but is right only 62% of the time in that range, a negative offset is applied to future predictions in the same bin. This self-correcting mechanism ensures long-term calibration.
Error Analysis
After events settle, every incorrect prediction is run through an automated error analysis pipeline. The system categorizes the primary error source — whether the miss was due to insufficient data, a key injury not captured, an incorrect weighting of factors, or genuine unpredictability.
Error categories are tracked by league and over time, producing a diagnostic profile of where the system is weakest. These findings feed back into the calibration system: if a particular type of error recurs in a league, future predictions in that league receive adjusted uncertainty penalties. The goal is continuous improvement — every loss teaches the system something about its own blind spots.
Reinforcement Learning
The system uses a reinforcement learning layer to continuously refine its probability estimates beyond what static calibration can achieve. This works through an A/B testing framework: each prediction is deterministically assigned to either a treatment or control group using a stable hash of the event.
The treatment group receives a policy-selected probability adjustment (a small positive or negative shift), while the control group uses the baseline calibrated output. Over time, the system compares outcomes between the two groups to learn which adjustments improve accuracy. Successful adjustments are reinforced; unsuccessful ones are discarded.
This creates a feedback loop where the system's own track record drives incremental improvements. The adjustments are small and conservative — the RL layer fine-tunes rather than overrides the core prediction framework.
Position Sizing
Position sizing determines which forecasts receive capital and how much. It operates through a series of gates and formulas designed to allocate capital proportionally to estimated edge while managing downside risk. No position is placed without passing every gate.
Kelly Criterion
Position sizing is based on the Kelly criterion, a formula that maximizes long-term growth rate by sizing positions proportionally to edge. The system uses a fractional Kelly approach at one-third sizing for safety.
The one-third fraction is a deliberate safety margin. Full Kelly sizing is mathematically optimal but assumes perfect probability estimates. Since all estimates contain error, fractional Kelly reduces volatility at the cost of slightly slower growth. This is the standard approach in professional quantitative trading.
When the raw Kelly fraction is negative, the system has no edge over the market price and no position is opened. When positive but very small, a floor mechanism ensures minimum capital allocation across all qualifying events.
Gating Conditions
Before any position is opened, the forecast must pass a series of gates. Every gate must be satisfied — failing any single one blocks the position.
Correctness Gate
The forecast is graded by a calibrated estimate of how likely THIS pick is to win, learned from the system's own settled results, and that estimate is what must clear the bar. The model's stated confidence is not the gate: it is a number the model asserts about itself, with no measured relationship to whether the pick lands.
The bar is the league's own quantile — the cutoff that admits a fixed fraction of its recent forecasts — rather than a constant. A fixed threshold silently changes how many positions qualify whenever the distribution of scores shifts, which is easy to misread as a change in model quality. Holding the fraction fixed instead keeps before and after comparable. Leagues without enough history under the current model fall back to a static floor.
Everything here is scoped to the current model regime. A model change clears the record it earned, and a league proves itself again from scratch.
Market Price Availability
A valid market price from Kalshi must exist. If the market is at 100 (certain outcome) or 0 (impossible outcome), no edge exists and the position is blocked.
Minimum Size & Expected Profit
The computed position must meet a $1.00 minimum size. Additionally, the expected profit must exceed $2.00 for standard positions (or $0.25 for floor positions) to ensure they are worth the transaction cost.
League Weighting
Capital is not distributed equally across leagues. Each league receives a weight based on a blend of two signals: historical accuracy and current-day confidence levels.
The 70/30 split between accuracy and confidence means historical performance matters most, but today's prediction quality provides a real-time signal. The Bayesian shrinkage pulls small-sample leagues toward the baseline, preventing a league with 3 predictions and 100% accuracy from receiving outsized allocation.
Additional multipliers adjust league weights based on track record:
- Leagues with fewer than 3 settled predictions receive a 50% weight penalty
- Leagues with a perfect (100%) win rate receive a 2x weight bonus
- Leagues with negative edge (losing money against the market) receive a sigmoid penalty that rapidly reduces allocation
- Individual team performance modifies league weight up to ±50% based on that team's historical edge
Size Calculation
The final position size for each event is computed through a multi-step process that combines the Kelly fraction with league weighting and capital scaling.
The floor mechanism ensures that every qualifying event receives at least a minimum allocation. Without it, a single high-edge event could absorb all available capital. The floor reserves 30% of the budget to be spread across all events.
Capital scaling uses a square root function so that position sizes grow with the account balance but sub-linearly. A $400 account commits ~41% more per position than a $200 account, not 100% more. This prevents over-concentration as the vault grows.
No three-outcome correction is applied. A Kalshi contract pays if and only if the forecast wins, so the position is binary in every sport — a soccer draw is simply part of the losing side — and Kelly's binary assumption already holds.
Risk Caps
Multiple layers of hard caps prevent any single position from concentrating too much risk, regardless of how high the estimated edge is.
Edge Tier Caps
Positions are capped as a percentage of account balance by the size of the fee-inclusive edge. The tier once also required a confidence threshold; that arm was removed, because it scored the cap against a number with no measured relationship to correctness and so gated it on noise.
Performance-Based Caps
A separate cap layer limits exposure by how the league's own SETTLED POSITIONS have done, not by how many of its forecasts named the winner. Forecast accuracy is the wrong population for a ceiling on money: it counts every game the system declined to back, and declining is the gate working.
These are anchors, interpolated between rather than steps, so a single settled game cannot move the whole book's exposure across a boundary. The rate is read as the lower bound of a posterior rather than as a point estimate: twelve positions won at 75% must not buy the ceiling two hundred at 75% buys, not because the 75% is doubted but because twelve barely constrain it. A league with no settled positions is treated as untested rather than as proven bad — every model change resets the record for every league at once, and starting them all at the floor would starve them of the results they need to earn a larger size back.
The final position size is the minimum of the Kelly-computed amount, the edge tier cap, and the performance cap. This means the most restrictive constraint always wins. A huge market disagreement does not justify large positions in a league whose positions do not win.
On-Chain Verification
Every slate is committed on-chain before any orders are placed. Each forecast is serialized into a canonical JSON preimage and hashed with SHA-256; the day's hashes are combined into a single Merkle root, and that root is posted to Solana in one memo transaction. Because the commitment is one root, the whole slate fits in one transaction regardless of how many positions the bot intends to open.
Nothing about the slate is published while it is running — not the preimages, not the hashes, not which events are in it. A slate is released only once every event in it has resolved, and it is released whole: the root is the root of every leaf, so a verifier handed a subset could not rebuild it.
Anyone can then recompute each SHA-256 hash from the published preimage, rebuild the Merkle root from those hashes, and compare it to the root on chain — confirming no forecast was altered after the fact. The block timestamp is public from the moment the root lands, so the commitment can be checked to predate the games it describes. Commitments currently anchor to Solana devnet.
Whitepapers
The two models behind the forecasts are documented in full, with their architecture, validation protocol and the published literature they rest on. Both are permanently archived and citable.
Calibrated Gradient-Boosted Tree Ensembles for Market-Blind Sports Outcome Forecasting
Architecture, validation protocol and evidential basis for the gradient-boosted form model — the ensemble behind the forecasts, and why it is trained without ever reading a market price.
DOI 10.13140/RG.2.2.30619.63521 →
A Multi-Sport Monte Carlo Simulation Engine Grounded in the Peer-Reviewed Sports Analytics Canon
Architecture, foundations and validation of the simulation engines, and the published research each sport's parameters are derived from rather than fitted to.
DOI 10.13140/RG.2.2.10486.97605 →