Overview
Kelly betting strategies implement the Kelly criterion for optimal bet sizing that maximizes long-term capital growth. The framework provides multiple Kelly implementations for different market types and risk profiles.Kelly betting automatically calculates optimal position sizes based on your predicted probability, current market odds, and available capital.
BettingStrategy Base Class
All betting strategies inherit from theBettingStrategy base class.
Base Parameters
Maximum amount to allocate to a single position. This caps the Kelly recommendation to prevent over-betting.
SimpleBinaryKellyBettingStrategy
Basic Kelly criterion implementation for binary markets. Calculates optimal bet size using the standard Kelly formula.Usage
Parameters
Maximum amount to bet on a single position. The Kelly formula will recommend a bet size, but it will be capped at this amount.Example values:
USD(2.5)- Fixed maximum of $2.50 per betUSD(5.0)- Fixed maximum of $5.00 per bet
How It Works
The simple Kelly strategy uses this formula:FullBinaryKellyBettingStrategy
Advanced Kelly implementation that accounts for price impact (slippage) when placing large orders. Recommended for markets with variable liquidity.Usage
Parameters
Maximum amount to bet on a single position
Maximum acceptable price impact (slippage) as a decimal fraction.Common values:
0.1(10%) - Very conservative, suitable for low-liquidity markets0.3(30%) - Moderate risk tolerance0.6(60%) - Aggressive, accepts significant slippage0.7(70%) - Very aggressiveNone- No limit on price impact
max_price_impact=0.5, if the market price is 0.60, you’ll accept prices up to 0.90 (60% + 50% of 60%).Whether to automatically take profits by selling positions when profitable.
True- Automatically realize gains when positions become profitableFalse- Hold positions until market resolution for potentially larger final payout
Real-World Examples
DeployablePredictionProphetGPT4oAgent
DeployablePredictionProphetGPT4oAgent
Standard configuration with moderate price impact tolerance:Location:
prediction_market_agent/agents/prophet_agent/deploy.py:122DeployableKnownOutcomeAgent
DeployableKnownOutcomeAgent
Aggressive betting on high-confidence predictions:Location:
prediction_market_agent/agents/known_outcome_agent/deploy.py:31DeployablePredictionProphetGPT4oAgent_C (No Profit Taking)
DeployablePredictionProphetGPT4oAgent_C (No Profit Taking)
Holds positions until market resolution:Use case: Testing whether holding positions to resolution increases profits via larger final payouts.Location:
prediction_market_agent/agents/prophet_agent/deploy.py:324DeployablePredictionProphetGPTo1PreviewAgent
DeployablePredictionProphetGPTo1PreviewAgent
Configuration for o1-preview agent with moderate price impact:Location:
prediction_market_agent/agents/prophet_agent/deploy.py:611SimpleCategoricalKellyBettingStrategy
Kelly betting for markets with more than two outcomes. Supports single-outcome betting or multi-categorical strategies.Usage
Parameters
Maximum amount to bet on a single outcome
Allow placing bets on multiple outcomes within the same market.
True- Can bet on multiple outcomes if Kelly recommends itFalse- Only bet on the single most favorable outcome
Allow betting against outcomes (shorting).
True- Can take short positions on overpriced outcomesFalse- Only take long positions
Enable multi-categorical betting mode.
True- Use multi-categorical Kelly formulaFalse- Treat each outcome independently
For most use cases, set
allow_multiple_bets=False and allow_shorting=False for simpler, more conservative betting.FullCategoricalKellyBettingStrategy
Advanced Kelly betting for categorical markets with price impact consideration.Usage
Parameters
Maximum amount to bet on a single outcome
Maximum acceptable price impact as a decimal fraction (see FullBinaryKellyBettingStrategy for details)
Allow betting on multiple outcomes in the same market
Allow betting against outcomes (shorting)
Enable multi-categorical betting mode
Real-World Examples
DeployablePredictionProphetGPT4oAgentCategorical
DeployablePredictionProphetGPT4oAgentCategorical
Conservative categorical betting with low price impact tolerance:Location:
prediction_market_agent/agents/prophet_agent/deploy.py:164DeployablePredictionProphetGemini20Flash
DeployablePredictionProphetGemini20Flash
Aggressive categorical betting accepting high price impact:Location:
prediction_market_agent/agents/prophet_agent/deploy.py:366DeployableOlasEmbeddingOAAgent
DeployableOlasEmbeddingOAAgent
Balanced configuration for embedding-based agent:Location:
prediction_market_agent/agents/prophet_agent/deploy.py:571The framework automatically falls back to tiny bets on non-Omen markets where full Kelly isn’t properly implemented yet.
Integration with Agents
Override theget_betting_strategy() method in your DeployableTraderAgent:
market parameter, allowing you to:
- Adjust bet sizes based on market liquidity
- Use different strategies for different market types
- Scale bets with your current trading balance
- Apply custom risk management rules
Helper Utilities
get_maximum_possible_bet_amount
Utility function for dynamic bet sizing based on available balance:- Calculates 95% of trading balance (reserves 5% for fees)
- Ensures result is at least
min_amount - Caps result at
max_amount - Returns the bounded value
Best Practices
Start Conservative
Start Conservative
Begin with conservative settings and gradually increase risk as you validate performance:
Match Strategy to Market Type
Match Strategy to Market Type
Use appropriate strategies for binary vs categorical markets:
Consider Market Liquidity
Consider Market Liquidity
Adjust price impact tolerance based on liquidity:
Use Fractional Kelly for Safety
Use Fractional Kelly for Safety
Bet a fraction of the Kelly recommendation to reduce variance:
See Also
Max Expected Value
Alternative strategy focused on expected value
Max Accuracy
Strategies optimized for prediction accuracy
Betting Strategies Concept
Learn about betting strategy fundamentals
Agent Architecture
Understand how agents use betting strategies