A Betfair bot is software that watches an exchange market and places, moves and cancels back and lay orders through the exchange's API, on rules you set in advance, inside your own exchange account. It does what you would do by hand, only faster, so one bad rule can repeat itself dozens of times before anyone looks.
On an exchange the worst case is usually liability, not stake. With illustrative prices, a lay of $28 at $3.50 risks 28 x 2.50 = $70, and a rule that fires 30 times instead of once risks 30 x 70 = $2,100. Every order here is placed before the jump or before the game starts. How betting bots work sets exchange bots beside the other kinds of betting software.
How a Betfair bot places and cancels orders
An API (application programming interface) is a set of requests software can send in place of clicks. Betfair publishes one, and access to it is governed by the exchange's own terms, including how you get a key and any limits or charges. A bot repeats the same cycle:
- Log in. It holds an application key that identifies the software and a login session for your account. Anyone holding both can bet from your account, so keep them out of shared files and code repositories.
- Read the market: the best back and lay prices, the amounts waiting at each and what has traded.
- Place an order naming the market, the runner or team, back or lay, the price and the size.
- Read the reply: a bet id and how much was matched. Any unmatched part waits in the queue at that price.
- Move or cancel. Check how the exchange handles a move: where it is a cancel followed by a new order, a failed new order can leave the cancel standing and no order where the bot thinks it has one.
- Reconcile. It lists its current orders and settled bets from the exchange, and counts its position from that list, not from its own memory.
The three common kinds of exchange bot
| Kind | What it does | Illustrative rule | How it usually fails |
|---|---|---|---|
| Trigger bot | Places one order when set conditions are met | Lay any runner that firms below $3.00 in the last 5 minutes before the jump | Fires more than once, or on the wrong runner |
| Trading bot | Opens a position, then closes it at a target or a stop | Back at $2.50, close with a lay at $2.40, stop out at $2.60 | Left half closed when the deadline arrives |
| BSP bot | Places Betfair Starting Price (BSP) orders before the jump | Lay at the BSP with $100 of liability, only if that price is $8.00 or shorter | Risks its full liability to win a small stake when the price is long |
Trigger bots
A trigger bot waits for a price, a time or a pattern, then sends one order. It is the simplest to write and the easiest to get wrong, because the check that stops it firing twice has to read the exchange's open orders, not just its matched bets.
Trading bots
Automated trading on an exchange runs the same sums as trading by hand. With illustrative prices, a back of $48 at $2.50 closed with a lay of 48 x 2.50 / 2.40 = $50.00 at $2.40 leaves +$2.00 either way before commission. Speed is the bot's advantage, and other software competes for the same small moves. Betfair trading explained covers the trades a bot automates.
BSP bots
A BSP bot places orders before the jump that are matched at the Betfair Starting Price (BSP), which the exchange works out at the jump. Check how your exchange's API sizes a BSP lay: where it takes the order by its liability, the stake you lay changes with the price. With illustrative prices, $100 of liability lays 100 / 4.00 = $25.00 at $5.00, but only 100 / 29.00 = $3.45 at $30.00. Where the order can carry a price limit, $8.00 in the table, it is matched only if the BSP is at or under the limit. Betfair starting price explains how that price is set.
Risk: Betting involves risk. A bot carries out a rule faster; it does not give the rule an edge, and a trade it fails to close before the start stands as an open bet. See responsible gambling for limits and support.
Exchange bots and the before-the-start rule
Section 10B of the Interactive Gambling Act 2001 makes a sports bet in-play when it is placed, made, received or accepted after the event has begun. The Act lets online sports betting go ahead only where the bet is not in-play (s 8A(3)) and the provider holds a state or territory licence (s 15AA). ACMA lists in-play betting on sporting events among the online services banned for people in Australia.
A sports bot therefore needs a hard deadline: every order matched or cancelled before the game starts, set inside the bot rather than left to the exchange.
Runaway liability: what one bad rule costs
Example: illustrative figures. A trigger bot is meant to lay Runner 3 once, for $28 at $3.50, a liability of $70. Its "already laid?" check reads matched bets only, so while the first lay waits unmatched it sees nothing and sends another every 2 seconds.
| Time running | Orders sent | Lay stakes | Liability if all are matched |
|---|---|---|---|
| As intended | 1 | $28 | $70 |
| 1 minute | 30 | 30 x 28 = $840 | 30 x 70 = $2,100 |
| 5 minutes | 150 | 150 x 28 = $4,200 | 150 x 70 = $10,500 |
Liability is held from your exchange balance, so the money in the account is the last cap: with $1,000 in it, 14 of these lays would tie up 14 x 70 = $980 and leave room for no more. A rule that lays "up to $13.50" instead of "up to $3.50" puts 28 x 12.50 = $350 on one $28 lay, five times the intended risk. A bot that sends a liability figure as a stake lays $70 at $3.50, for 70 x 2.50 = $175 of liability instead of $70. Lay betting explained covers how liability is worked out.
Risk: Betting involves risk. A lay's liability can be many times its stake, a bot can repeat a mistake faster than you can see it, and there is no guarantee of profit. See responsible gambling for limits and support.
Bugs and connectivity: how exchange bots fail
Betting bot risks covers the failures every kind of bot shares. These are the ones that bite hardest on an exchange:
- A lost connection with orders open. Orders stay on the exchange whether or not the bot is there to manage them. If the connection drops after the $48 back at $2.50 and before the closing lay, the trade is an open bet: +$72.00 if the runner wins, -$48.00 if it loses, instead of +$2.00 either way.
- No reply in time. A missing reply is not a failed order, and a resend can put the same order on twice; the bet placement API checklist covers duplicates and reconciliation.
- A failed move. Where a move is a cancel then a new order, a bot that does not check the reply can believe it holds an order it no longer has.
- The wrong runner. Exchanges identify runners by their own ids, so a bot that matches by name or saddlecloth number can bet the wrong one after a late change to the field.
- Stale data and the machine. Prices read before a scratching describe a market that has changed, and sleep mode or a power cut stops a bot mid-cycle with orders open.
Controls to insist on before a bot touches real money
With illustrative settings:
| Control | What it stops | Illustrative setting |
|---|---|---|
| Stake cap per order | A mistyped or miscalculated stake | $30 |
| Liability cap per market | Stacked or repeated lays | $200, which refuses a third $70 lay (3 x 70 = $210) |
| Liability cap per day | A bad rule repeating across markets | $500 |
| Order rate limit | Loops that resend every cycle | One new order per runner per 30 seconds |
| Price band | Lays at long prices | Lay only at $8.00 or shorter |
| Deadline | Orders left open at the start | No new orders, and every unmatched order cancelled, 1 minute before the jump or the start |
| Position check | Duplicates from a stale memory | Read open orders from the exchange before each new one |
| Kill switch | A fault you cannot diagnose quickly | One action that stops new orders and cancels every unmatched one |
On an exchange a kill switch that only stops new orders is half a stop: unmatched orders stay in the queue and can still be matched, so insist on one that cancels them too. Test in a dry run, then on the smallest stakes allowed, checking every order against the exchange's own records.
Every licensed online wagering provider in Australia must offer deposit limits under the National Consumer Protection Framework (measure 6): a decrease applies straight away and an increase only after 7 days. On the account a bot uses, a deposit limit caps how much new money a fault can reach. Deposit limits explained shows how to set one.
Risk: Betting involves risk. Automation can bet far more, far faster, than by hand, and software controls can fail or act late, so treat them as a backup to the deposit limit on the account. See responsible gambling for limits and support.
Betfair trading software: what to check before you run any
Tools range from ladder screens that place your own clicks quickly, through tools that close a trade at a target or a stop, to full bots driven by rules or code. Before you run any of them, check:
- A test mode that uses live prices without placing real orders.
- What it does with unmatched orders at your deadline, and whether its stop cancels them.
- How it handles a lost connection or a missing reply, and whether it rebuilds its position from the exchange.
- Logs you can export and match against your exchange account.
- Where it runs, and what happens when that machine sleeps or goes offline.
- Where your login and API key are stored, and who else can reach them.
- Its full cost, plus anything the exchange charges.
Skip a bot until its rule has passed a dry run with live prices, and while you cannot watch its first live sessions. Skip it too if its machine cannot stay on until every order is matched or cancelled, or if you would use it to win back losses.
A seller's results show what happened in their markets under their settings, and past results are no guarantee of future results. Whether the exchange permits a bot on your account is set by its terms; whether running one is lawful where you are is a separate question. B337 does not give legal advice; are betting bots legal in Australia sets out the question, and independent legal advice covers your own case.
Where B337 fits
B337 does not bet on the exchange: there is no back or lay placement on Betfair in the product, so laying, trading and hedging stay yours to do in your own exchange account. Its bot places bets in bookmaker accounts you hold, on rules you set. It uses Betfair as a price reference rather than a place to bet: its racing strategy compares bookmaker win prices with the Betfair price close to the jump. The bot runs on your own computer, which has to be on, awake and online, and bets go on before the jump or before the game starts. If you only want to automate betting on Betfair itself, B337 is a different kind of tool; automated betting with B337 shows how its sessions work.
On the Terminal, racing and sports prices from 40+ bookmakers sit in columns next to Betfair back and lay. A free account opens a limited view of the Terminal with live odds. Bookmaker names are trade marks of their owners. B337 is not affiliated with them.
Risk: Betting involves risk. Many bookmakers restrict or prohibit automated betting and third-party access in their terms. A bookmaker that objects can limit your stakes, void bets or close the account, and that risk sits with you. See responsible gambling for limits and support.