Home/Blog/Bot Risks
Sub Article · Betfair Automation

Betfair Bot Risks: What Can Go Wrong

The honest catalogue of risks every Betfair bot trader should price in before risking real money. Strategy risk, code risk, infrastructure risk, market risk, compliance risk and the discipline risk that nobody admits to. Each risk is paired with a working mitigation and the rough cost of getting it wrong.

Updated 18 May 202613 min readRisk · Compliance

Risk categories at a glance

This sub sits inside the Betfair Automation and Bots pillar. Bot trading risks split into six categories. Each contains the boring failures (slow leaks of money) and the catastrophic failures (account-wiping events). A robust bot prices both.

CategoryWorst-caseTypical-case
StrategyStrategy decays silently, bot bleeds for monthsReturns 30–50% lower than backtest
CodeRunaway loop drains bankroll in minutesOccasional weird bets from partial fills
InfrastructureVPS dies during in-play, position uncovered5–10 unplanned restarts/year
MarketLiquidity vanishes, bot eats spreadSlippage takes 10–20% of paper edge
CompliancePremium Charge eats 60% of profitT&C violations cause account hold
DisciplineTrader over-rides bot during drawdownStrategy abandoned before edge proven

Strategy risk

The risk you'll spend the most time on — but the least time worrying about. A strategy is a hypothesis: "This pattern signals an edge". Hypotheses decay. The market that produced your edge in 2024 evolves. Other traders' bots adapt. Liquidity moves around.

  • Strategy decay. The most insidious. A strategy that returned +£250/month for a year starts returning +£40, then -£10, then -£80. Slow enough that you don't act until three losing months have passed.
  • Backtest overfit. The strategy was tuned on the same data that "proved" it. Out-of-sample it's a coin-flip.
  • Survivorship bias. You forgot to include the markets the strategy would have skipped (or the days the bot was offline). The real average is worse than the backtest.
  • Regime change. A new rule (e.g. Premium Charge change, or a Betfair API tweak) shifts who's trading what. Your strategy was built for the previous regime.
Mitigation · Rolling performance review

Track 30-day rolling P&L and 90-day rolling P&L per strategy. If the 30-day rolling figure falls below 50% of the 90-day, pause the strategy and audit. Cheap circuit-breaker against silent decay. The mechanics of strategy auditing are in system testing.

Code risk

Code bugs are the catastrophic risk. Strategy decay is slow. A bug can drain a bankroll in 90 seconds.

  • Runaway placement loop. A bug causes the bot to place a new bet on every poll instead of every transition. 50 bets in 30 seconds; you wake up to discover £400 of accumulated commission.
  • Partial fill mishandling. You ask to back £50; £14 matches. Your exit lays £50. You're now net lay-side, opposite direction.
  • Float maths errors. You calculate a green-up size in floating-point, place 20.36999998, get an INVALID_BET response, the bet is never placed and your back goes uncovered.
  • Time-zone bugs. Time-to-off calculated in UTC, displayed in BST, off by an hour for half the year.
  • Stale data acted on. A polled book is 3 seconds old; you place at LTP, get matched at a price 4 ticks worse.
  • Race conditions in state. Rule 2 toggles Rule 3 before Rule 3 has finished evaluating; trade is never closed.
Risk · Runaway loops

The biggest single retail-bot loss we know of personally: £1,800 in 11 minutes from a runaway loop placing increasing-size bets on a thin tennis market because of a stake-doubling Martingale bug. The trader had no daily loss limit; the bot ran until the bank ran out. £8/month for a daily kill-switch would have capped the loss at £100.

Infrastructure risk

The bot is a process on a server connected to the internet via an API to a venue. Every link can fail.

  • VPS power/network failure. Your bot dies mid-trade. Unmatched orders sit there. Open positions go un-exited.
  • API rate limiting. You hit Betfair's request-weight limit. Calls start failing. Your bot doesn't know whether the order placed or didn't.
  • Betfair API outage. Rare but real. Last major outage was ~40 minutes; bots had to handle it gracefully.
  • Session expiry. Token expires, bot tries to place a bet, gets NO_SESSION. If the retry logic is wrong, the bet either never goes or goes twice.
  • Clock drift. VPS clock drifts; time-based triggers misfire.
  • Disk full. Logs aren't rotating, disk fills, bot crashes silently.
Mitigation · Watchdog and dead-man's switch

Heartbeat to a file every 60 seconds. A separate watchdog process (or a cron) reads the file. If it's stale by 3 minutes, the watchdog kills any open positions (closes at market) and emails you. Boring engineering, has saved more retail bots than any other single mitigation.

Market risk

  • Slippage. The price you saw on the book isn't the price you got filled at. Average slippage on a £20 retail trade: 0.5–1.5 ticks. Bigger on illiquid markets.
  • Liquidity vanish. The book looks £600 deep at LTP, you place a £200 stake, your size moves the price 3 ticks against you because there were 10 separate £15 lots.
  • News shock. Jockey change, late team news, weather. Bot has no human knowledge of why the price just moved.
  • Race cancellation / void market. Bets get refunded. Most bots handle this fine; some don't, and you discover stale state when you check the books.
  • Going changes / event status changes. Pre-race horse market goes "in-play" suddenly when the off is declared; PERSIST bets match at very different prices.

Compliance risk (Premium Charge, T&Cs)

Betfair's Premium Charge is the single biggest non-strategic risk to a profitable bot. The mechanics are in Betfair Premium Charge; the short version is that accounts with a profit:loss ratio above certain thresholds pay up to 60% of net winnings.

  • Premium Charge. Once your account crosses the threshold (lifetime profit > lifetime gross commission paid, or higher tier triggers), 60% of incremental profit goes to Betfair. Your nominal £400/month becomes £160/month overnight.
  • Account holds and reviews. Sudden change in bet patterns (volume jump, multiple new strategies) can trigger compliance review. Resolved quickly for honest traders; still annoying.
  • T&C violations. Sharing accounts, using accounts in unsupported jurisdictions, using consolidated bot platforms that pool funds.
  • Tax. UK gambling income is tax-free. Other jurisdictions vary. If your bot is meaningfully profitable, talk to a tax adviser — see trading business structuring.

Discipline risk

The risk nobody discusses honestly. A bot enforces rules; the trader can switch the bot off, override its rules, or change parameters in the middle of a drawdown. Drawdowns are when traders abandon edges that would have recovered.

  • Killing a working strategy during drawdown. 30-day loss of £80 on a strategy with long-run +£200/month. Statistically normal variance; emotionally awful.
  • Doubling stakes after losses. Martingale dressed up. Always ends in tears.
  • Adding "fixes" to a working bot mid-month. You see one loss, tweak the strategy, now you don't know if subsequent results come from the original strategy or the change.
  • Running strategies you didn't write. Discipline costs less when you understand the strategy. Renting a black-box bot from BF Bot Manager removes that understanding.

For broader trading discipline, see trading psychology.

The single biggest risk

Not Premium Charge. Not API outages. Not even runaway loops, painful as they are. The biggest single risk is: running a strategy that doesn't have an edge, and the bot lets you do it faster and longer than manual trading ever would.

Manual trading on a bad strategy gets tiring. You quit after a month. Automated trading on a bad strategy keeps grinding. You don't quit until the bank statement forces you to. Three months at -£200/month is -£600 in 90 days you didn't have to lose.

The mitigation isn't technical. It's: validate the strategy manually first; backtest with proper out-of-sample discipline; paper-trade for 30 days; live-small-stake for 30 days. Skip any of these and the bot is amplifying a wrong bet.

This is the same theme as is bot trading worth it — the bot is the executor, the edge is the strategy.

The non-negotiable mitigations

Every working retail bot has at least these:

  1. Max stake per bet — hardcoded cap (e.g. £50).
  2. Max open liability — sum of all matched + unmatched liability across markets, capped at a bankroll percentage (10–20%).
  3. Max bets per market — typically 1 entry, 2 exits.
  4. Daily loss limit — cumulative since midnight; on breach the bot kills itself and emails you.
  5. Price sanity check — refuse to back below 1.20 or above 50.0 unless explicitly allowed.
  6. Heartbeat + watchdog — described above.
  7. Structured logging — every decision recorded with timestamp and reason.
  8. Daily P&L review — non-negotiable. 15 minutes each morning.
  9. Pause on parameter change — when you tweak the strategy, paper-trade the new version for 5 days before risking real stake.

The mechanics overlap with manual trading discipline. The good news is that automation makes them easier to enforce. The bad news is that you have to actually write them in.

Risk · The "I'll add risk controls later" trap

If your bot is risking money without daily loss limit and runaway-loop protection, it doesn't matter how good the strategy is — one bug will erase a year of edge. Build the risk controls before you build the strategy.

FAQ

What's the most common bot loss?

Slow strategy decay. Single trade losses to bugs hurt more in the moment, but cumulative decay losses are bigger over a year.

Will Betfair ban my bot?

No. Betfair officially supports API trading. Premium Charge applies to profitable accounts whether automated or manual. T&C violations (multiple accounts, jurisdiction issues) can cause account holds.

How do I avoid Premium Charge?

The simplest answer is to keep the relevant ratios outside the threshold by occasionally betting at lower-margin markets, or by accepting that beyond a certain profit threshold the marginal return is much smaller. Detail in Premium Charge guide.

What insurance can I get against bot losses?

None. There is no retail insurance for bot trading losses. The "insurance" is engineering — risk controls, watchdogs, kill-switches, daily review.

Is automating a losing strategy ever worth it?

No. The bot is execution; the edge is the strategy. Automating a losing strategy means losing faster and with less effort.

Which risks to prioritise as a new bot trader

If you're starting out, you cannot defend against every risk on day one. The pragmatic order:

  1. Code risk first. Hardcoded stake cap, once-only on entry rules, partial-fill handling. These prevent the catastrophic single-incident losses.
  2. Daily loss limit second. Caps any "I didn't see it coming" bleed at a number you choose. Implementing it takes 30 minutes; not having it can cost £100+ per bad day.
  3. Infrastructure third. VPS, watchdog, heartbeat. A bot that crashes silently bleeds in different ways than a buggy one — the recovery is slower.
  4. Strategy decay fourth. Once the bot is running cleanly, weekly rolling-P&L review catches decay before it's destructive.
  5. Compliance last. Premium Charge becomes relevant only once you're consistently profitable enough to approach the threshold — which is months or years away for most retail traders.

Building all defences at once is paralysing. Build them in this order and you'll have meaningful protection within 30 days of going live.

Anatomy of three real retail bot incidents

Three failure modes that we've seen play out at retail scale:

  1. The runaway scalper. A pre-race scalper on Bet Angel Guardian had a rule with no "once-only" tick. On a low-volume Sunday morning the trigger evaluated true on every poll. The bot placed 47 separate £20 backs at slightly different prices over 90 seconds before the trader noticed. Total slippage and commission cost: £83. The fix is one checkbox in the rule; the cost of not ticking it was a week's edge.
  2. The forgotten persistence flag. A lay-the-draw bot had its entry lay persistence set to PERSIST instead of LAPSE. The match was suspended at half-time for floodlight failure; the unmatched lay sat there. When the match resumed in-play, the price had drifted from 3.80 to 8.40. The lay matched at 8.40. Liability went from £140 to £370 instantly. The fix is one dropdown value; the cost was £230 in unintended liability.
  3. The credential leak. A Python developer pushed their .env file to a public GitHub repo for 40 minutes. A scraper found it. Someone logged in with the credentials and placed losing bets to drain the account. By the time the trader noticed the morning after, £680 was gone. Betfair's fraud team eventually credited some of it back; recovering the rest took six weeks. The fix is one line in .gitignore.

Each of these incidents was preventable by a single piece of defensive engineering. The common thread: the trader knew the defence was good practice but skipped it "just for now". Bots punish "just for now" decisions.

Building a risk budget you can actually use

A risk budget translates abstract risk categories into concrete numbers. For a £5,000 bankroll the budget looks roughly like:

  • Max loss per single trade. 1% bankroll = £50. Hardcoded as max stake.
  • Max loss per market. 2% bankroll = £100. Sum of liability across positions in one market.
  • Max simultaneous liability. 15% bankroll = £750. Across all markets.
  • Max daily loss. 3% bankroll = £150. Auto-shutdown on breach.
  • Max monthly drawdown before review. 10% bankroll = £500. Pause and audit, don't grind.

These numbers should be in the bot's config file, not in your head. The point of a budget isn't sophistication; it's that the bot enforces it when you're emotionally compromised. Trading psychology in trading psychology; the bankroll mechanics in bankroll management.

When something does go wrong: a recovery checklist

If your bot has just done something unexpected:

  1. Stop the bot. First action — disable rules, kill the process. Don't try to debug while it's still trading.
  2. Read your logs. Structured logs (timestamp + event + state) tell you exactly what happened. If you didn't log enough, that's lesson 1 for next time.
  3. Sum the damage. Total stake at risk, total realised loss, max projected loss if positions don't close gracefully.
  4. Close positions manually if needed. Don't trust the bot's exit logic until you understand why the entry was wrong.
  5. Don't trade today. Emotional decisions following a bot incident are worse than the incident.
  6. Write up the incident. What happened, what the cost was, what the fix is. Keep a running incident log.
  7. Fix the bug or add the missing control. Then paper-trade the fix for at least 7 days.
  8. Re-enable in production at half the previous stake. Ear