* This blog post is a summary of this video.

I Built an AI Sports Betting Bot and Won $7,000

Table of Contents

Starting with a Simple Arbitrage Betting Bot

To get started, I asked ChatGPT to provide me with a simple arbitrage betting bot coded in Python that fits into a single file. Arbitrage betting involves finding inefficiencies in odds across different sportsbooks and making bets that guarantee a small profit.

ChatGPT provided a basic bot, but it didn't actually work since the sportsbook APIs it referenced were fake. So I searched GitHub and found an existing arbitrage bot by Ryan Kremins that used real sports data from the Odds API. This gave me a working starting point.

Using Math and Data to Find Inefficiencies

The key to arbitrage betting is using math to analyze the odds data and find cases where the implied probabilities don't add up to 100%. This represents an inefficiency in the market that can be exploited for a guaranteed profit. By compiling data from multiple sportsbooks and calculating the implied probabilities mathematically, the bot is able to identify arbitrage opportunities and tell me exactly which bets to make and how much I will profit.

Leveraging Existing Code to Quickly Build a Bot

Rather than build everything from scratch, I leveraged Ryan Kremin's existing Github repository that implemented an arbitrage betting strategy using the Odds API. This saved a ton of time and allowed me to get up and running with a working bot quickly. The power of leveraging existing code libraries cannot be overstated. Standing on the shoulders of open source giants enabled me to skip many tedious steps and get results faster.

Improving the Bot with Sentiment Analysis

Although arbitrage betting is mathematically sound, the profits tend to be small and there's a risk of getting banned from sportsbooks. So I wanted to improve the bot by incorporating sentiment analysis on Twitter data.

The idea is that public sentiment towards a team could provide insights into their likelihood of winning beyond just the odds. I used Tweepy to access the Twitter API and TextBlob to analyze tweet sentiment as positive or negative. The bot now checks if sentiment aligns with its game predictions before placing bets.

Adding Deep Learning Models for More Accurate Predictions

Using Existing GitHub Repositories to Skip Training

For even better predictions, I wanted to augment the arbitrage bot with deep learning models. Manually collecting training data and developing models from scratch would have required massive effort. Instead, I found a GitHub repo by Kyle Scott that had already trained TensorFlow neural networks and XGBoost models on an extensive NBA dataset. By calling these pre-made models, I could skip the arduous model development process while still benefiting from state-of-the-art prediction accuracy.

Combining Multiple Models for Optimal Bets

With all the pieces in place, the final step was to combine signals from multiple models to determine which bets to place:

First, use the deep learning models to predict the probability of each team winning and calculate expected value.

Then, cross-check the favorite team against public Twitter sentiment as another signal.

Finally, have ChatGPT summarize the predictions and sentiment analysis in plain language so I know which teams to confidently bet on.

Integrating the Bot with a Decentralized Sports Betting App

To actually place bets with my strategic predictions, I integrated the bot with dexsports.io, a decentralized crypto-based sports betting platform. By signing in through my MetaMask wallet instead of creating an account, I could bet anonymously from anywhere in the world while keeping control over my funds.

I embedded their web3 betting interface into my site so I could view my bet history, settled bets, profits, and losses all in one place - synchronized between my predictions bot and actual sports wagers.

Testing the Bot and Winning $7,000

When I ran the bot to place bets for a slate of NBA games, it ultimately won me over $7,000 on just two $1,000 wagers! This proves that combining arbitrage strategies, sentiment analysis, deep learning models, and decentralized betting can lead to profitable algorithmic sports betting.

While the results here focused on NBA outcomes, this framework could be adapted to a variety of sports by changing the data sources. The synergistic ensemble approach shows the power of merging multiple techniques to build sophisticated and lucrative AI systems.

FAQ

Q: How does the arbitrage betting bot work?
A: The arbitrage bot looks for inefficiencies in odds across different sports books and bets on all outcomes to lock in a small guaranteed profit.

Q: What is sentiment analysis?
A: Sentiment analysis examines positive and negative opinions on social media to gauge public perception of a team.

Q: What deep learning models were used?
A: The project leveraged existing GitHub repositories with pre-trained TensorFlow and XGBoost models for predicting NBA game outcomes.

Q: How were the models combined?
A: The arbitrage, sentiment analysis, and deep learning models were combined to optimize betting decisions and maximize winnings.

Q: What decentralized app did they use?
A: The bot was integrated with Dexsports.io, a decentralized crypto-based sports betting application.

Q: How much money did the bot make?
A: In live testing, the bot made two $1,000 bets and won $7,000.

Q: Can anyone build this bot?
A: Yes, by following the video and leveraging existing code anyone can build their own sports betting bot.

Q: Is sports betting with bots legal?
A: The legality depends on your jurisdiction, be sure to check your local gambling regulations.

Q: What technologies were used?
A: The project used Python, TensorFlow, XGBoost, Tweepy, TextBlob, React, Firebase, Polygon blockchain, and USDT.

Q: Can this work for other sports?
A: Yes, the models can be retrained to predict outcomes for any sport with adequate data.