Some years ago, I was eager to deepen my knowledge of cloud computing. To put this learning into practice, I decided to build a real-world product that would put my skills to the test.
I wanted to create something that leveraged my front-end expertise, cloud-based hosting, data processing, and any other technologies I could pick up along the way.
One day, while watching the Grand National, a question struck me: is it possible to bet on all outcomes and guarantee a profit?
Let’s examine the phrase “The house always wins.” Imagine you’re at a prestigious horse racing event, playing the role of the punter. You approach a bookmaker to place bets on a race. The bookmaker provides a list of horses and their odds—the payout you’d receive relative to your bet if a particular horse wins.
If you took a fixed amount, say £10, and spread it across all horses in proportion to their odds, you could guarantee the same return no matter which horse wins. For example, if there are two horses, each with odds of 3:1, betting £5 on each would guarantee you £15 back, leaving a tidy £5 profit. This is known as dutch betting.
But let’s be realistic. In practice, your return will always be less than your initial stake because bookmakers set the odds to guarantee their own profit. In our example, the bookmaker would adjust the odds to maximize their profits and minimize their risk.
What if we flipped the script? Suppose you, the punter, visit 10 different bookmakers with your £10 and place dutched bets using the best odds from each. Could you guarantee a profit in some races?
This is where arbitrage comes in—a common investment strategy to lock in returns.
So, the question becomes: are there reliable sources online that aggregate odds from all bookmakers for upcoming races?
Bookmakers compete with each other, so some may offer more attractive odds on certain horses. This could tip the balance in your favor.
We started by searching for websites that display real-time odds from multiple bookmakers. We used a well-established odds comparison site (no names mentioned).
These sites typically list all upcoming races and odds from various bookmakers. Like search engines, we began by scraping the pageWe started with a Python function using the mechanise and Beautiful Soup libraries.
Mechanise emulates a browser, letting us programmatically access the site, while Beautiful Soup parses the HTML to extract the relevant data., extracting all races and their links, and storing them in a databaseA NoSQL database is a lightweight, fast choice for storing these values..
We set up a timer to scrape the page every hourUsing a CRON trigger, we run the Python function every hour to scrape the page.. The database is updated to remove completed races and keep only upcoming ones
We modified the Python function to loop through and store only upcoming races, using the race link as the partition key..
With our list regularly updated, we examined each race page.
Odds are usually displayed in columns for each bookmaker. We wrote another scraper to extract the best odds for each horseUsing the same approach, we wrote a Python function with mechanise and Beautiful Soup.
Mechanise downloads the HTML, and Beautiful Soup parses the odds for each horse. We then keep only the highest odds for each horse..
As part of this process, we also wrote a dutching algorithmWe pass the best odds into a Python function that calculates the dutching amounts and returns the guaranteed return. to see if a guaranteed return was possible. If so, we’d send ourselves an email notification.
After running this for a few weeks, we received several notifications. The average returns were small (about 1–5%) but scalable.
When checking a notification immediately, we noticed that odds fluctuate rapidly. A profitable race typically remains so for only 5 minutes before the market corrects itself. After that, the opportunity disappears.
To summarize:
In conclusion, you can make a guaranteed profit, but you must act quickly when an opportunity arises.
Based on our tests, we outlined a brief for a tool to help place bets quickly when a guaranteed return is detected.
Many odds comparison sites offer a quick bet option, which is crucial for acting fast. Not all bookmakers participate, but even focusing only on those that do still yields frequent profitable opportunities.
Upon notification, here’s what’s needed to act swiftly:
To meet these needs, we recommend:
We started by building a web app with unique URLs for each race, allowing users to view the scraped data.
Mobile optimization is key, since notifications can arrive at any time. A mobile-friendly app gives users the best chance to act quickly before odds change.
Leveraging the pre existing work from our theoretical tests, we can make a simple change to the notification email itself. We can modify this in a way that will present us with a link to view the opportunity in the web app.
After simulating the web app on days over a 3 month period, we found that on 40 of those days we had guaranteed return opportunities. There were about 7 days where we had negative returns - we can put this down to the fluctuations in the racing odds during the simulated placements of the bets.
Overall, throughout this period there was a 41% increase in the simulated total balance.
So, what’s the catch? If we were to put this in practice, and assuming we continue to get a stream of guaranteed bets the earrings could be staggering.
Let's take this opportunity to say that the house doesn’t always win. After debunking the phrase “the house always wins”, we can bring a new phrase in “The house has lost enough”. Similar to a patron in a local bar who's had one too many, the house will decide it’s time for you to take your gains and encourage you to move on.
After a little digging for more information, there's various approaches bookmakers adopt to deter any punters making calculated bets, one of them being just to simply analyse your bet stats and and then limiting your bet amount. With this in mind, it flips our MVP on its head somewhat and becomes more a game of playing a game of cat and mouse with the bookmakers.
Ad-hoc planning, prototyping, building, testing, maintanance and team managment in all aspects of web development. No upfront commitment and an initial free consultation, checkout our process & lets chat and see how we can help.