Monday, 14 December 2015

This week, I've mostly been doing....

....matched betting.
It's a quick and easy way of getting some cash in, for Xmas. The concept is quite straight-forward but it's one of those deals that sounds almost too good to be true.

After all, we all know that if you gamble, you'll lose your money, then your friends and family, then your home... and when you're living on the streets drinking rainwater from out of your shoes, you'll lose the shirt off your back. And then they'll take your shoes.

Make no mistake gambling is bad. Very bad.
Many, many years ago I wrote a football database and with a few friends we committed to each putting £5 into a pot every week and seeing if we could get one over on the bookies. In six months, we'd doubled our money. That was great! But then, as often happens, the lure of easy money makes you want to win more, and do it more often, and do it more quickly.

And that's when gambling really hurts. Because eventually, with big stakes, trying to hit big money, there comes a run of losses that just wipes out everything. Luckily I've never had it happen to me, but I've seen a few people get into trouble through it (my friends and I took our profits after six months and promised never to gamble again!)

But matched betting is different. Even though, it still took nearly two months of Matt persuading me that it was 100% risk free, before I took the plunge and gave it a go. Here's how it works:

Online bookmakers offer free bets to new customers.
You need to place a bet with the bookie (as a new customer) to be given the free bet. Sometimes you only get a free bet if your first bet loses. But that's ok. Believe it or not, we actually want our bets to lose!

And that's where the key to this counter-intuitive swindle lies - we want to lose at the bookies.
But we don't want to lose overall.

Then you take the free bet, and turn it into cash that you can withdraw (and spend on stuff like a few pints down the pub, or a meal out-  or do lots of free bet offers, save the cash and buy a laser cutter!)

So we sign up as a new customer at the bookies and put a bet on (say, Arsenal to win) at the maximum price they're offering a free bet for (after all, there's no point taking only £10 if they're offering up to £50). That means sometimes putting £50 on the result of a football match.

That can be pretty terrifying.
There's no way I could afford to throw away £50 if Arsenal let me down. So I head over to Betfair and "lay" Arsenal to win. What this means is that for the length of this one match, I'm acting like a bookie myself, offering my own odds for Arsenal to win. If someone takes my bet, and Arsenal win, I have to pay out. But  - here's the clever bit - if Arsenal don't win (i.e. they lose or it's a draw) I get paid £50 from Betfair. So if Arsenal win, I get some winnings at the bookie and have to pay out on Betfair. If Arsenal lose, I lose my money at the bookies, but get the same value in winnings at Betfair.

So I offer as much money as necessary and at odds as close as I can to the original bookmaker, on Betfair, for Arsenal to not win. Now, whatever the result of the game, the winnings from one bet cover the loses on the other. (actually, unless the lay odds are less than the original bookie's odds - something which can happen, but it's very rare - there's a tiny loss involved, because Betfair charge a 5% commission).

Let's say, for example, I've put £50 at evens on Arsenal to win at As a new customer, he's offering a free bet to the same value if my first bet loses. Now I head over to Betfair and I offer to accept £50 at evens for anyone wanting to back Arsenal (actually, I'd probably offer 21/20 or something just a little bit more than the original bookies, but let's keep things simple). To place this bet at Betfair, I need to put £50 up for offer (the taker gets their original £50 stake but I need to pay their winnings at 1/1).

You can imagine that at higher odds, you need to "lay" more on Betfair (a £50 lay bet at 4/1 on Betfair requires 4x£50 = £200 to be put up for offer - this is called the "liability").

Once both bets are placed, there's nothing much more to do. There's no point watching the game and cheering Arsenal on, because you've also backed them to lose (well, to not win which includes the draw as an outcome). Similarly, if you've backed a horse, there's no point tuning in to Channel 4 racing to scream at it to get over the line, because - on Betfair - you've effectively backed every other horse in the race to win as well! Before the event starts, you already know the (financial) outcome. So there's nothing to get excited about - no euphoria when you win and no despair when you lose. It's just another event happening in an already busy day. And that's the difference between matched betting and gambling.

Nothing is ever at risk.
Whatever the outcome of the event (be it football, horse racing or whatever) you neither win nor lose (except, perhaps, a small known loss because of commission). As Matt put it "you give some money out, some guys kick a football around, and when they're done, you get your money back". (of course this is a simplification as it doesn't account for any difference in odds, nor the commission on Befair if the bet loses at the bookies, and wins at Betfair). But you get the idea.

So what's the point?
Remember Honest Dave?
He was offering us a free bet up to the value our first stake. That's why we put £50 and not a tenner on Arsenal. As it's the 2015 season at the time of writing, you probably already know the outcome - Arsenal, indeed, fail to win (despite the odds suggesting they would) and Honest Dave takes the £50. He doesn't need to know we backed the opposite result on Betfair!

In Betfair, our bet for Arsenal to not win comes good, and covers the loss paid to Honest Dave.

Now Dave thinks we're ripe for the picking - a "mug punter" who throws money on their favourite football team. So - just like a drug dealer offering a free gateway drug to get you hooked - he says "go on, have another go. Here's your £50 back to try again".

Cheers Dave.
So we take his £50 and repeat the process.
We already know that whatever the outcome, our stake money either appears at the bookies as winnings or - if the original bet loses - in our Betfair account (since we backed the bet to lose).
The important difference this second time around is that we don't actually have any losses to cover if the bet loses at the bookies.

If the free bet wins at the bookies, Dave keeps the £50 stake (normally, when betting at the bookies, you get your stake back - but if it's offered as a free bet, the bookie keeps it) but he does pay out the winnings. The "lay bet" at Betfair is calculated such that it always costs less (if it loses) than the bookie will pay out in winnings.

If the free bet loses at the bookies, well, there's no real harm done. Dave offered you £50 and simply took it back. But over at Betfair, our "lay bet" has come good. We have more cash than we started with, despite "losing" the bet.

And that's how matched betting works. It's heavily reliant on Betfair.
And it's heavily reliant on finding matches between bookmakers odds and Betfair "lay stakes".
And finding these matches can be slow and laborious (even when using a website like, they're not always bang up to date). So what we decided we needed was a way of (semi) automating things.

The Betfair website is simple and easy to use, but to match odds against bookmakers requires a lot of flicking between screens

Luckily, Betfair offers a completely free (for personal use) API for programatically accessing their betting exchange. Which means we can build some software to do a lot of the work for us. For nerds who know how to program, and who are interested in free money, this is perfect!

The best time to find "good matches" between the bookies website(s) and Betfair is in the ten minutes or so before the event begins. This is when all the "betting traders" are doing their thing, trying to make money from mug punters and other bookmakers, who have been offering different odds on the same event. Prices on Betfair change far more frequently than they do on bookmakers websites.

What we decided we needed was a website where we could be automatically notified when a horse (or football team, or whatever) reached a specific price on the Betfair exchange. This allows us to pre-calculate what we think an acceptable loss for a matched-bet would be, and work out how much, and at what odds, we should be prepared to "lay" a bet on Betfair, in order to accept an offer from an online bookmaker.

Using the Betfair API, we were able to quickly produce a webpage that displayed the current prices on the Betfair exchange.

And a quick bit of javascript later, and we're able to not only enter the current "back price" at the online bookies, but have the display automatically update when "good matches" become available.

Here I've set my "warning threshold" to 0.1 which means that when the Betfair exchange lay price is just 0.1 above the bookies prices, I'll be given a visual cue. 

Here I've placed a bet at 4.5 (in fractional format, 7/2) on Amenable, and laid the bet off with Betfair for £25.28 at 4.5 as well (the early indicator on our web page gave us time to flick over to the Betfair website and place the bet while the exchange odds were very favourable, and within the few seconds before William Hill reduced their odds offered). 

Whatever the outcome of this race, it's set to lose me 98p. There's no point getting excited about the race - whichever horse wins, I know I'm going to be 98p down. So while the race is running, I'm off messing about with guitars and board games and soldering and stuff. The actual race is of no importance now - I just need to wait for the race to complete.

Once the race has been run - and irrespective of the outcome - I get a free bet, to the value of £25. So while I know I'm 98p down after the first race, I can expect to get about 75% of the value of the free bet, using matched betting (you'll need to Google "matched betting" if you want a full explanation of why this is).

So I repeat the process, only this time, using the £25 free bet stake the Mr Hill so kindly offered. "Big Storm Coming" looks like a good horse to use the free bet on. Not that I know anything about his form, whether he's a stallion or a nag. I know nothing about the horse. What I do see is that the numbers look good.

I put my free £25 on Big Storm Coming on the William Hill website and head over to Betfair.

Normally I try to find matches where the back offer and lay odds are as close together as possible. But because I'm a bit impatient, and don't want to sit glued to the computer screen until the race actually runs, I take the 7.8 odds on "Big Storm Coming" on Betfair.

(this odds calculator is available at but matched betting websites all over the 'net carry similar versions which pretty much do the same thing)

I lay £20.97 at odds of 7.8 and I know that - whatever the outcome of the race - I'll be £19.90 up after it. That's all there is to it. The race isn't for a couple of hours yet; had I waited, I'm sure I could have got a closer match (and taken more from the free bet offer). But nearly £20 for a couple of minutes clicking about isn't a bad return!

Rinse and repeat a few times with different bookmakers and that's Xmas Dinner paid for this year!