Skip to main content

Overview

Betting strategies determine how much capital to risk on each prediction. The framework provides several pre-built strategies based on the Kelly criterion and other risk management approaches.
Poor bet sizing can lead to ruin even with accurate predictions. The Kelly criterion helps you bet optimally based on your edge and bankroll.

Available Strategies

The prediction-market-agent-tooling library provides these betting strategies:

SimpleBinaryKellyBettingStrategy

Basic Kelly betting for binary markets

FullBinaryKellyBettingStrategy

Advanced Kelly with price impact consideration

SimpleCategoricalKellyBettingStrategy

Kelly betting for categorical markets

MaxAccuracyWithKellyScaledBetsStrategy

Optimizes for prediction accuracy

CategoricalMaxAccuracyBettingStrategy

Accuracy-focused for categorical markets

MaxExpectedValueBettingStrategy

Maximizes expected value

The Kelly Criterion

The Kelly criterion is a formula for optimal bet sizing that maximizes long-term capital growth:
Why Kelly? It mathematically guarantees optimal long-term growth while minimizing risk of ruin. Betting more than Kelly is aggressive, betting less is conservative.

Implementing Betting Strategies

Basic Setup

Override the get_betting_strategy() method in your agent:

SimpleBinaryKellyBettingStrategy

The simplest Kelly-based strategy for binary markets:
USD
required
Maximum amount to bet on a single position

FullBinaryKellyBettingStrategy

Advanced Kelly strategy that accounts for price impact (slippage):
USD
required
Maximum amount to bet on a single position
float
default:"0.1"
Maximum acceptable price impact (slippage) as a fraction.
  • 0.1 = 10% price impact
  • 0.57 = 57% price impact (very aggressive)
  • Higher values allow larger bets but worse prices
Use max_price_impact carefully. On low-liquidity markets, large bets can significantly move prices against you.

SimpleCategoricalKellyBettingStrategy

For markets with more than two outcomes:
bool
default:"True"
Allow betting on multiple outcomes in the same market
bool
default:"False"
Allow betting against outcomes (shorting)
bool
default:"False"
Enable multi-categorical betting mode

MaxAccuracyWithKellyScaledBetsStrategy

Optimizes for accuracy while using Kelly scaling:
This strategy is ideal when you care more about prediction accuracy than maximizing returns. Good for tournaments and reputation building.

CategoricalMaxAccuracyBettingStrategy

Minimalist strategy focusing on accuracy:

Dynamic Bet Sizing

Adjust bet sizes based on market conditions:

The get_maximum_possible_bet_amount Helper

This utility function manages bet sizing within safe bounds:
How it works:
  1. Uses 95% of trading balance (keeps 5% for fees)
  2. Ensures bet is at least min_ amount
  3. Caps bet at max_ amount
  4. Returns the value in between based on available balance

Risk Management Best Practices

Bet a fraction of Kelly to reduce variance:
When to use:
  • You’re uncertain about your edge
  • You want smoother equity curves
  • You’re testing a new agent
Bet the full Kelly amount:
When to use:
  • You’re confident in your predictions
  • You want optimal long-term growth
  • You can handle volatility
Accept higher slippage for larger positions:
When to use:
  • High-liquidity markets
  • Strong conviction trades
  • When opportunity cost is high
Ignore Kelly and bet fixed amounts:
When to use:
  • Learning and experimentation
  • Very uncertain predictions
  • Volume-based strategies (many small bets)

No Betting Strategy (Tiny Bets)

If you don’t override get_betting_strategy(), the base class uses a minimal betting strategy:
The default strategy bets very small amounts. Always implement a proper betting strategy for production agents.

Example: Adaptive Strategy

Combine multiple factors for sophisticated bet sizing:

Testing Betting Strategies

1

Start with Manifold

Test on Manifold Markets (play money) first:
2

Use Conservative Kelly

Start with 25-50% of Kelly recommendation:
3

Monitor Performance

Track your Sharpe ratio, max drawdown, and ROI over time.
4

Increase Gradually

Once proven, increase bet sizes or move to real-money markets.

Advanced: Custom Betting Strategies

Implement your own strategy by extending BettingStrategy:

Next Steps

Agent Architecture

Learn how to implement the betting strategy in your agent

Trade Intervals

Control when your agent trades on the same market