Overview
The Kelly criterion is a mathematical formula for optimal bet sizing in scenarios with known edge. It maximizes long-term logarithmic growth of capital while minimizing risk of ruin. The Polymarket Bot implements a fractional Kelly strategy to reduce variance and account for model uncertainty.Mathematical Foundation
Full Kelly Formula
For a binary outcome (win/lose) with:p= probability of winningq= probability of losing =1 - pb= net odds received on a win (profit / wager)
Simplified Form for Prediction Markets
Polymarket markets use decimal odds where:- You pay
qper share - Winning shares pay
$1.00 - Net profit per share =
1 - q
b = (1 - q) / q, and substituting into the Kelly formula:
src/risk/position-sizer.js:74
The formula
f* = (p - q) / (1 - q) assumes you’re betting on the outcome priced at q. For NO bets (betting against the outcome), both p and q are inverted to 1 - p and 1 - q respectively.Why Fractional Kelly?
Full Kelly (usingf* directly) maximizes long-term growth rate but has significant drawbacks:
- High variance: Full Kelly can recommend very large bets (up to 100% of bankroll)
- Model error sensitivity: Small errors in
pestimation lead to substantial overbet - Drawdown magnitude: Aggressive sizing causes deeper and longer drawdowns
α × f* where α < 1) trades some growth rate for:
- Lower variance
- Reduced sensitivity to model error
- Shallower drawdowns
- More psychologically tolerable equity curves
Growth Rate Comparison
Forα = 0.5 (half Kelly), the growth rate is approximately 75% of full Kelly, but the variance is only 25% of full Kelly. This is a favorable tradeoff for most scenarios.
Implementation Details
Side Determination
The bot determines which side of the market to bet based on the model’s prediction:- If
p ≥ 0.5: Bet YES (the outcome will occur) - If
p < 0.5: Bet NO (the outcome will not occur)
src/risk/position-sizer.js:68
Probability Inversion for NO Bets
When betting NO, the effective probabilities are inverted:src/risk/position-sizer.js:69-70
Edge Calculation
The Kelly fraction is only positive when an edge exists:f* ≤ 0, there is no edge, and the system returns a zero bet:
src/risk/position-sizer.js:77-79
Fractional Alpha Selection
The bot uses a Brier-tiered alpha system that maps model accuracy to fractional Kelly values:| Brier Score | Alpha | Kelly Fraction |
|---|---|---|
< 0.18 (excellent) | 0.40 | 40% of full Kelly |
0.18 - 0.22 (good) | 0.25 | 25% of full Kelly |
0.22 - 0.26 (moderate) | 0.20 | 20% of full Kelly |
> 0.26 (low accuracy) | 0.10 | 10% of full Kelly |
< 100 predictions | 0.00 | No trading |
Rationale
Lower Brier scores indicate better calibration and accuracy. The system uses higher alpha values when the model has proven accuracy, and conservative values when accuracy is unproven or degraded.Example Calculations
Example 1: YES Bet with Edge
Given:- Model prediction:
p = 0.65 - Market price:
q = 0.52 - Bankroll:
$10,000 - Brier score:
0.20→ α = 0.25 (Tier 3)
Example 2: NO Bet with Edge
Given:- Model prediction:
p = 0.30(70% chance outcome does NOT occur) - Market price:
q = 0.45 - Bankroll:
$10,000 - Brier score:
0.19→ α = 0.25 (Tier 3)
Example 3: No Edge (Market Efficient)
Given:- Model prediction:
p = 0.55 - Market price:
q = 0.56(market implies higher probability) - Bankroll:
$10,000 - Brier score:
0.18→ α = 0.40 (Tier 4)
f* < 0 → No edge → Bet $0 (no trade)
Example 4: Drawdown Adjustment (Yellow Mode)
Given:- Model prediction:
p = 0.68 - Market price:
q = 0.50 - Bankroll:
$9,200(down from HWM of $10,500) - Drawdown:
(10,500 - 9,200) / 10,500 = 12.38%→ Yellow mode - Brier score:
0.17→ α_base = 0.40 (Tier 4) - Yellow adjustment:
alphaMultiplier = 0.5
Risk of Ruin
One of the Kelly criterion’s key properties is that it never risks total ruin (assumingf* < 1 and infinite divisibility of capital). The bankroll approaches zero asymptotically but never reaches it.
However, practical constraints introduce ruin risk:
- Minimum bet size:
minBetUsdcreates a floor below which trading stops - Model error: Incorrect
pestimates can lead to overbetting - Non-ergodic outcomes: Sequential betting can amplify losses during streaks
Expected Growth Rate
For a single bet, the expected logarithmic growth is:α × f*) reduces the growth rate but also reduces variance, making the actual realized growth more stable.
Assumptions and Limitations
Assumptions
- Independent outcomes: Each bet is independent (no correlation)
- Known probabilities:
pis accurately estimated - Binary payoffs: Win or lose, no partial outcomes
- Infinite divisibility: Can bet any fraction of bankroll
- No fees: Original Kelly assumes zero transaction costs
Polymarket Adjustments
- 3% fee on wins: Accounted for in
recordTrade()(see Drawdown Tracking) - Minimum bet size:
minBetUsdcreates discrete rather than continuous sizing - Maximum bet cap:
maxBetPctprevents single bets from dominating bankroll - Model uncertainty: Brier-tiered alpha adjusts for estimation error
Practical Considerations
When Kelly Fails
- Model miscalibration: If
psystematically overestimates probabilities, Kelly will overbet - Correlated outcomes: Betting on related markets violates independence assumption
- Non-stationary edge: If
paccuracy degrades over time, historical Brier may lag reality - Black swans: Extreme outcomes outside the model’s training distribution
Optimal vs. Practical Kelly
Theoretical optimal Kelly assumes:- Perfect knowledge of
p - Zero fees
- Continuous betting
- No psychological constraints
- Fractional Kelly (α = 0.10 to 0.40)
- Fee adjustments in payout calculation
- Minimum bet floors and maximum bet caps
- Drawdown-based risk reduction
Related
- Position Sizing - Implementation of fractional Kelly with Brier tiers
- Drawdown Tracking - Risk reduction during losses
Further Reading
- Kelly, J. L. (1956). “A New Interpretation of Information Rate”. Bell System Technical Journal.
- Thorp, E. O. (1969). “Optimal Gambling Systems for Favorable Games”. Review of the International Statistical Institute.
- MacLean, L. C., Thorp, E. O., & Ziemba, W. T. (2011). The Kelly Capital Growth Investment Criterion. World Scientific.