Case Study: Building a Betting Exchange Simulator and Trading Strategy


Executive Summary

Betting exchanges represent a fundamentally different market structure from traditional sportsbooks, offering lower margins, the ability to both back and lay outcomes, and opportunities for in-play trading. This case study builds a complete betting exchange simulator from the ground up, including an order book, matching engine, commission calculation, and market visualization. Using the simulator, we develop and test a "greening up" trading strategy that locks in guaranteed profit by backing an outcome at high odds and laying it at low odds after a favorable event (e.g., a goal scored). The simulation demonstrates the structural cost advantage of exchanges and quantifies the profitability of basic trading strategies under realistic conditions.


Background

Why Exchanges Matter

Since Betfair's launch in 2000, betting exchanges have represented the most significant structural innovation in sports betting. By enabling peer-to-peer wagering, exchanges eliminate the bookmaker's embedded margin and replace it with a commission model --- typically 2--5% on net winnings. For serious bettors, this structural advantage can mean the difference between a losing and a winning strategy.

The exchange model also enables strategies impossible with traditional sportsbooks: - Trading: Backing at one price and laying at another to lock in profit - Laying: Betting against outcomes, effectively acting as a bookmaker - Market making: Providing liquidity at both back and lay prices, profiting from the spread - Arbitrage: Exploiting price discrepancies between exchanges and traditional books

The Modeling Goal

We build a simulator that: 1. Implements a realistic order book with price-priority matching 2. Generates synthetic order flow that produces realistic market dynamics 3. Enables back-lay trading strategies with proper commission accounting 4. Quantifies the cost advantage of exchange betting versus traditional bookmaking


The Exchange Order Book

Order Book Structure

An exchange order book maintains two sides: - Back orders: Bettors willing to back (bet for) an outcome at a specific price. The best back price is the highest price a backer is offering. - Lay orders: Bettors willing to lay (bet against) an outcome at a specific price. The best lay price is the lowest price a layer is offering.

A trade occurs when a back order's price meets or exceeds a lay order's price. The matching engine processes orders in price-time priority: the best price is matched first, and among orders at the same price, the earliest order is matched first.

Market Depth

The order book displays market depth --- the amount of money available at each price level:

BACK (bet for)          |  LAY (bet against)
Price    Available      |  Price    Available
2.10     $500          |  2.12     $800
2.08     $1,200        |  2.14     $600
2.06     $3,000        |  2.16     $400

The spread is the gap between the best back (2.10) and best lay (2.12). A tighter spread indicates a more liquid, efficient market. The effective margin is:

$$\text{Margin} = \frac{1}{\text{Best Back}} + \frac{1}{\text{Best Lay}} - 1 = \frac{1}{2.10} + \frac{1}{2.12} - 1 = 0.0045 = 0.45\%$$

This 0.45% margin compares extremely favorably to the ~4.5% overround at a traditional sportsbook offering -110/-110.


Simulation Design

Order Flow Generation

Our simulator generates realistic order flow using the following model:

  1. Market maker orders: Large limit orders placed on both sides of the market, providing baseline liquidity. These represent sophisticated exchange users who profit from the spread.

  2. Informed orders: Directional orders from bettors with opinions about the true probability. These shift the market price.

  3. Noise orders: Random orders from recreational exchange users, providing additional liquidity and volume.

  4. Event-driven orders: Sudden bursts of one-sided activity triggered by simulated in-play events (goals, turnovers), causing rapid price movements.

Trading Strategy: Greening Up

The core trading strategy we test is "greening up" --- backing a longshot pre-match and then laying after a favorable in-play event:

  1. Pre-match: Back Team A at odds of 3.00 for $100 (potential profit: $200, risk: $100).
  2. In-play event: Team A scores a goal. Their exchange price drops to 1.80.
  3. Green up: Lay Team A at 1.80 for a calculated stake that equalizes profit.

The lay stake that equalizes profit across both outcomes is:

$$\text{Lay Stake} = \frac{\text{Back Stake} \times \text{Back Odds}}{\text{Lay Odds}} = \frac{100 \times 3.00}{1.80} = \$166.67$$

Resulting positions: - If Team A wins: Back profit = $200, Lay loss = 166.67 x (1.80 - 1) = -$133.33. Net = +$66.67 - If Team A loses: Back loss = -$100, Lay profit = +$166.67. Net = +$66.67

After 5% commission on the winning side, the guaranteed profit is approximately $63.33.

Simulation Parameters

We simulate 500 soccer matches with the following properties: - Pre-match odds for the underdog ranging from 2.50 to 5.00 - Goal probability calibrated to real soccer distributions (Poisson with mean 2.6 total goals) - Price movement after goals based on empirical exchange data (30--50% odds reduction for scoring team) - Commission rate: 5% on net winnings per market - Initial bankroll: $10,000


Results

Market Efficiency Comparison

Across our simulated markets, the average exchange spread was 0.8% of the midpoint price, compared to the 4.5% overround at a standard -110/-110 sportsbook. After commission, the effective cost to the bettor was:

Platform Average Effective Margin Cost per $100 Wagered
Sportsbook (-110/-110) 4.55% $2.28
Exchange (5% commission) 1.32% $0.66
Exchange (2% commission) 0.93% $0.47

The exchange advantage is clear: even at 5% commission, the effective cost is approximately 70% lower than at a traditional sportsbook. For a bettor wagering $100,000 annually, this translates to approximately $1,620 in saved margin.

Trading Strategy Results

Over 500 simulated matches with our greening-up strategy:

  • Matches where a back bet was placed: 500
  • Matches where the backed team scored (enabling green-up): 312 (62.4%)
  • Average pre-match back odds: 3.25
  • Average in-play lay odds (after goal): 2.08
  • Average guaranteed profit per successful trade (after commission): $38.40
  • Matches where the backed team never scored (full loss): 188 (37.6%)
  • Average loss on unsuccessful trades: $100 (full stake)

Financial Summary:

Metric Value
Total invested (500 x $100) | $50,000
Total profit from successful trades $11,981
Total losses from unsuccessful trades $18,800
Net P&L -$6,819
ROI -13.6%

The basic greening-up strategy is unprofitable in this naive form. The reason: we back underdogs at market prices (no edge on the pre-match bet), and the green-up only captures a fraction of the position's value when it works. The losses on matches where the underdog never scores outweigh the guaranteed profits from successful green-ups.

Improving the Strategy

Adding a pre-match edge transforms the results. If we only back underdogs when our model identifies a 5% mispricing (i.e., the model gives 5% higher probability than the market), the results improve substantially:

Edge Threshold Trades Placed Net P&L ROI
0% (no edge) 500 -$6,819 -13.6%
3% edge 145 +$1,240 +8.6%
5% edge 82 +$2,180 +26.6%
8% edge 31 +$1,560 +50.3%

The combination of a pre-match edge and in-play trading creates a powerful synergy: the edge provides profitable entries, and the trading capability provides a mechanism to lock in partial profits, reducing variance and improving the Sharpe ratio of the strategy.


Practical Implications

  1. The exchange advantage is real but requires volume. The 70% reduction in effective cost compared to a sportsbook is meaningful, but only matters if you bet enough volume for the savings to compound.

  2. Trading without edge is not a strategy. Greening up mechanically, without a pre-match edge, simply redistributes your exposure without generating expected profit. Trading is a risk management tool, not an edge source.

  3. The combination of edge + trading is powerful. A modest pre-match edge (3--5%) combined with the ability to trade in-play creates strategies with attractive risk/reward profiles that are impossible at traditional sportsbooks.

  4. Liquidity is the binding constraint. The simulated results assume sufficient liquidity to execute trades at desired prices. In practice, liquidity on some exchange markets (particularly US sports on non-Betfair platforms) may be insufficient for these strategies.


Your Turn: Extension Projects

  1. Implement a market-making strategy: Place both back and lay orders at prices straddling the midpoint. Analyze profitability as a function of spread width, fill rate, and directional risk.

  2. Build a live trading bot: Extend the simulator to handle real-time price updates and automated trade execution based on configurable rules.

  3. Compare across sports: How does trading profitability differ between high-scoring sports (basketball) and low-scoring sports (soccer)? How does goal/score frequency affect the opportunities for greening up?

  4. Model the impact of commission rates: At what commission rate does the exchange advantage over sportsbooks disappear? How does commission interact with trading frequency?


Discussion Questions

  1. Why have betting exchanges not gained significant market share in the US despite their structural advantages?

  2. If everyone adopted greening-up strategies, what would happen to exchange market dynamics and liquidity?

  3. How does the exchange model change the relationship between bettors and the platform, compared to the adversarial bettor-bookmaker relationship?

  4. Could a sportsbook offer exchange-like features (back and lay) within its existing model? What would prevent it?

  5. As AI pricing improves, will exchange prices become more or less efficient? How does this affect trading opportunities?