A Python tool to find optimal bonus bet hedging opportunities across multiple sportsbooks using real-time odds from The Odds API.
This tool helps you maximize the value of sportsbook bonus bets (also called free bets, risk-free bets, or second-chance bets) by finding the best hedging opportunities. It:
- Fetches live odds from multiple sportsbooks
- Identifies opportunities where you can place a bonus bet on one book and hedge it on another
- Calculates guaranteed profit and efficiency for each opportunity
- Python 3.8 or higher
- The Odds API key (get one free here)
- Clone this repository:
git clone https://github.com/louaih/bonus-hedge.git
cd bonus-hedge- Install required packages:
pip install requestspython3 main.py \
--api-key YOUR_API_KEY \
--bonus-book fanduel \
--books draftkings \
--sports nba \
--stake 250Event: Dallas Mavericks @ Los Angeles Lakers
Bonus: fanduel | Dallas Mavericks @ +260
Hedge: draftkings | Los Angeles Lakers @ -305
Hedge stake: $489.51
Locked profit: $160.49
Efficiency: 64.20%
| Parameter | Required | Description | Default |
|---|---|---|---|
--api-key |
✅ | Your The Odds API key | - |
--bonus-book |
✅ | Sportsbook where you have the bonus bet | - |
--books |
✅ | Comma-separated list of books to hedge on | - |
--sports |
❌ | Comma-separated list of sports to check | nba,ncaab |
--stake |
❌ | Bonus bet amount in dollars | 250 |
--min-eff |
❌ | Minimum efficiency threshold (0.0 to 1.0) | 0.0 |
US Region:
fanduel- FanDueldraftkings- DraftKingscaesars- Caesars (formerly William Hill)betrivers- BetRiversfanatics- Fanaticsbetmgm- BetMGM
US2 Region:
ballybet- Bally Betespnbet- ESPN BETbetparx- BetParxfliff- Fliffhardrockbet- Hard Rock Bet
nba- NBA Basketballncaab- NCAA Basketballncaaf- NCAA Footballnfl- NFL Footballmlb- MLB Baseballnhl- NHL Hockeyeurobasketball- Euroleague Basketball
- Region Detection: The tool automatically detects which API regions to query based on the sportsbooks you specify
- Odds Fetching: Fetches real-time odds from both regions if needed (e.g., if you want to hedge Bally Bet with FanDuel)
- Opportunity Scanning: Compares all odds to find the best hedging opportunities
- Profit Calculation: Uses the formula for guaranteed profit to calculate your locked-in return
- Best Selection: Returns the opportunity with the highest efficiency
Efficiency is calculated as: guaranteed_profit / bonus_stake
For example, if you have a $250 bonus bet:
- 100% efficiency = You keep the full $250 as profit
- 75% efficiency = You keep $187.50 as profit
- 50% efficiency = You keep $125 as profit
Typical bonus bet conversions achieve 70-90% efficiency depending on the odds available.
- Check multiple sports - More sports = more opportunities
- Time it right - Odds change frequently; run the tool when you're ready to place bets
- Lower your minimum - Setting
--min-eff 0.0shows all opportunities, even less efficient ones - Include multiple books - More hedge options = better chances of finding optimal lines
- Act quickly - Odds can change rapidly, place your bets as soon as you find a good opportunity
- Try lowering
--min-effto0.0 - Add more sports to
--sports - Add more sportsbooks to
--books - Check
debug.logto see which books and events were found
- Verify your API key is correct
- Check your API usage limits at The Odds API dashboard
- Each run uses 2 API calls per sport per region
All debug information is automatically saved to debug.log including:
- API requests and responses
- Region selection logic
- Available bookmakers for each event
- Full list of opportunities considered
This is helpful for troubleshooting or understanding why certain opportunities were or weren't found.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter issues:
- Check the
debug.logfile for detailed information - Feed debug info into LLM
- Make branch and paste changes
- Submit a PR
If you have questions: open an issue
- Powered by The Odds API
- Inspired by the sports betting arbitrage community