trading
Kelly Criterion and Fractional Kelly in Prediction Market Betting
- trading
- kalshi

Introduction

In prediction markets, determining the optimal amount to bet can significantly impact your profitability. The Kelly Criterion offers a mathematical framework for maximizing the logarithm of wealth, which is especially useful in environments rife with uncertainty. However, many traders adopt the Fractional Kelly approach to mitigate risk, particularly in volatile markets. This article delves into both concepts, illustrating how they can be effectively applied in prediction market betting, backed by practical examples and Python code.
Understanding the Kelly Criterion
What is the Kelly Criterion?
The Kelly Criterion is a formula used to determine the optimal size of a series of bets. It suggests a proportion of your total capital to wager based on the edge you have and the odds you're facing, intended to maximize your wealth over time. It is expressed mathematically as:
[ f^* = \frac{bp - q}{b} ]
Where:
- ( f^* ) = fraction of your bankroll to bet
- ( b ) = the odds received on the wager (net odds, i.e., the profit from a successful bet)
- ( p ) = probability of winning the bet
- ( q ) = probability of losing the bet (which is ( 1 - p ))
Example of the Kelly Criterion
Assume you are considering a bet on a prediction market where you have identified a 60% chance of an event occurring (say, a specific candidate winning an election), and the odds offered are +150.
Using the formula:
-
Convert odds to probability: For +150 odds, the implied probability ( p ) is calculated as: [ p = \frac{150}{150 + 100} = 0.6 ] Thus, ( q = 1 - p = 0.4 ).
-
Calculate ( f^ )**: [ f^ = \frac{1.5 \cdot 0.6 - 0.4}{1.5} = \frac{0.9 - 0.4}{1.5} = \frac{0.5}{1.5} \approx 0.3333 ]
This means you should bet approximately 33.33% of your bankroll on this particular wager.
Implementing the Kelly Criterion in Python
To help automate this process, let’s implement the Kelly Criterion calculation in Python:

def kelly_criterion(odds, probability_win):
b = odds / 100 # Convert +150 odds to the decimal format
p = probability_win
q = 1 - p
f_star = (b * p - q) / b
return f_star
# Example usage
odds = 150 # +150 odds
probability_win = 0.6 # 60% chance of winning
bet_fraction = kelly_criterion(odds, probability_win)
print(f"Fraction of bankroll to bet: {bet_fraction:.4f}")
This small function takes both the odds and win probability, returning the optimal fraction of the bankroll to wager according to the Kelly Criterion.
The Drawbacks of the Kelly Criterion
While the Kelly Criterion is mathematically sound, it has some drawbacks:
- Overbetting: If the probability estimates are incorrect or the model is off, you risk overbetting and losing substantial capital.
- Volatility: The full Kelly wager can lead to large fluctuations in bankroll size, which may not be tolerable for all traders.
Introduction to Fractional Kelly
What is Fractional Kelly?
To mitigate the risks associated with the full Kelly Criterion, traders often utilize the Fractional Kelly strategy. Instead of betting the entire recommended fraction, a trader can scale down the bet using a multiplier ( f ), where ( f ) is typically between 0 and 1. For example, with a full Kelly bet being 1, a Half Kelly would advise betting 0.5. This reduces risk and smooths out performance over time.
Example of Fractional Kelly
Using the same example as before, if you calculated your optimal bet to be 33.33%, a Half Kelly bet would advise you to wager only 16.67% of your bankroll.
Implementing Fractional Kelly in Python
Here's how you can implement a Fractional Kelly strategy in Python:
def fractional_kelly(odds, probability_win, fraction=0.5):
f_star = kelly_criterion(odds, probability_win)
return f_star * fraction
# Example usage with Half Kelly
fraction = 0.5 # Half Kelly
bet_fraction_fractional = fractional_kelly(odds, probability_win, fraction)
print(f"Fraction of bankroll to bet (Half Kelly): {bet_fraction_fractional:.4f}")
With this function, you can easily adjust the risk level by changing the fraction parameter while benefiting from the framework of the Kelly Criterion.
Practical Application in Prediction Markets
Market Structure
In prediction markets, the liquidity, volatility, and framing of the bets can heavily influence how the Kelly Criterion and its fractional variant should be applied. For example, if you identify a market with low liquidity, you might be more conservative in your estimates for probability ( p ) to reflect the risks posed by sudden market shifts.
Data Workflows
Using a data-driven approach to estimate unbiased probabilities can significantly improve your betting strategy. Here’s a basic workflow:
- Data Collection: Gather historical data on similar events.
- Modeling Probabilities: Use binary classification models (e.g. logistic regression, decision trees) to estimate winning probabilities for future events.
- Calculate Optimal Bets: Once you have a reliable model for ( p ), apply the Kelly Criterion or Fractional Kelly to determine how much to bet on each market event.
- Iterative Learning: Continuously refine your probability estimations based on ongoing results and performance metrics.
Example Python Workflow
Below is a simplified version of what this workflow might look like in Python, tracking game outcomes for a betting scenario.
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
# Simulate some historical data
data = {'event_outcome': [1, 0, 0, 1, 1, 0, 1], 'feature1': np.random.rand(7), 'feature2': np.random.rand(7)}
df = pd.DataFrame(data)
# Split into features and target
X = df[['feature1', 'feature2']]
y = df['event_outcome']
# Train model
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
model = RandomForestClassifier()
model.fit(X_train, y_train)
# Predict probabilities for future events
probabilities = model.predict_proba(X_test)[:, 1]
for odds in [150, 200]: # different betting odds
for prob in probabilities:
bet_fraction = fractional_kelly(odds, prob)
print(f"Odds: {odds}, Probability of Win: {prob:.2f}, Fraction of bankroll to bet: {bet_fraction:.4f}")
This example includes data simulation, model training, and the integration of the Fractional Kelly Criterion into your decision-making process.
Conclusion
The Kelly Criterion, along with its Fractional variant, offers powerful strategies for optimizing bets in prediction markets. By integrating robust data workflows into your betting approach, you can ensure that your probability estimates are reliable, allowing you to apply the Kelly Criterion with confidence. This structured approach not only enhances your potential for profit but also mitigates unnecessary risks associated with overexposure in volatile market conditions.