markets
What is a middle in sports betting? The math and real line changes
A middle is two bets on opposite sides of the same market at different lines, placed so that both win when the result lands between the lines. Over 214.5 and under 216.5 on a total both win if the game ends on 215 or 216 points. This article gives the math, the break-even chance and a real example of lines that moved.
How does a middle work?
A total or a spread is a line plus a price on each side. When the same market is available at two different lines, at two books or at one book at two moments, the two bets overlap on the numbers in between. With over 214.5 and under 216.5:
| Final total | Over 214.5 | Under 216.5 |
|---|---|---|
| 214 or less | loses | wins |
| 215 or 216 | wins | wins |
| 217 or more | wins | loses |
Outside the window one bet wins and one loses. Inside it both win. With whole-number lines a result on the line is a push and that stake is returned.
What is the math of a middle?
With a stake of 1 on each side:
result outside the window, one bet wins: winning decimal - 2
result inside the window, both win: decimal 1 + decimal 2 - 2
break-even chance, same price d on both: (2 - d) / dAt -110 on both sides, decimal 1.909:
| Result | Returned | Net on 2 staked |
|---|---|---|
| Outside the window | 1.909 | -0.091 |
| Inside the window | 3.818 | +1.818 |
The pair breaks even when the result lands inside the window 4.76% of the time. Below that the small loss outside adds up to more than the win inside. The cost outside the window is the hold of the two prices taken together: enter them in the arbitrage calculator and the amount by which the total passes 100% is that cost. The hedge calculator sizes the second stake so both outside results return the same.
Where do the two lines come from in odds data?
Every selection in an odds response carries a line and the prices of the books that quote it. In our reads of GET /v1/odds for NBA totals, each game came with one total market at one line. So the second line of a middle comes from time: the line you recorded earlier against the line now. This script reads the totals twice and prints the games whose line changed in between. It needs Node 18 or later and no packages.
// line-changes.mjs: reads NBA totals twice and prints the games whose line changed in between. Node 18 or later.
// Usage: PRICEDODDS_API_KEY=... node line-changes.mjs
const BASE = "https://api.pricedodds.com/v1";
const auth = { headers: { Authorization: `Bearer ${process.env.PRICEDODDS_API_KEY}` } };
const WAIT_SECONDS = 120;
const read = async () => {
const games = (await (await fetch(`${BASE}/odds?league=nba&markets=total@game`, auth)).json()).data;
const lines = new Map();
for (const game of games) {
const over = game.markets[0]?.selections.find((s) => s.side === "over");
if (over) lines.set(game.event.id, { matchup: `${game.event.away.abbr} @ ${game.event.home.abbr}`, status: game.event.status, line: over.line, books: over.prices.length });
}
return lines;
};
const before = await read();
await new Promise((resolve) => setTimeout(resolve, WAIT_SECONDS * 1000));
const after = await read();
let moved = 0;
for (const [id, a] of after) {
const b = before.get(id);
if (!b || b.line === a.line) continue;
moved++;
const [low, high] = [b.line, a.line].sort((x, y) => x - y);
const first = Math.ceil(low + 0.01), last = Math.floor(high - 0.01);
console.log(a.matchup, a.status, "total", b.line, "->", a.line, "| over", low, "and under", high, "both win on", first === last ? first : `${first} to ${last}`);
}
console.log("games read:", after.size, "| line changed:", moved, "| seconds between reads:", WAIT_SECONDS);Run it with PRICEDODDS_API_KEY=... node line-changes.mjs.
Our run on November 24, 2026, 00:41 UTC, as an example and not a current price:
MEM @ CHA live total 216.5 -> 215.5 | over 215.5 and under 216.5 both win on 216
POR @ PHI live total 231.5 -> 236.5 | over 231.5 and under 236.5 both win on 232 to 236
OKC @ IND live total 224.5 -> 221.5 | over 221.5 and under 224.5 both win on 222 to 224
BKN @ MIN live total 224.5 -> 226.5 | over 224.5 and under 226.5 both win on 225 to 226
games read: 13 | line changed: 4 | seconds between reads: 120In 120 seconds the line of 4 of 13 games changed. All of them were in play, where the total follows the score and moves often. The script shows that the two lines existed 120 seconds apart. It does not show that both prices could be taken.
Which fields do I record?
lineon the selection: the number of the spread or total.decimalandamericanon each price, with thebook.changedAt: when PricedOdds ingested the last change of that price.statuson the event:scheduledorlive.
Ask for one market with markets=total@game or markets=spread@game. The API returns current prices only and keeps no history, so the earlier line is the one you stored.
curl -s "https://api.pricedodds.com/v1/odds?league=nba&markets=total@game" \
-H "Authorization: Bearer $PRICEDODDS_API_KEY"What are the limits of a middle?
The window is usually one or two numbers wide, and the chance of landing on it is small and hard to estimate. The first bet is already placed when the second line appears, so the second price is whatever the market offers then. In play, lines move in seconds and bets can be delayed or rejected. Rules differ between books on overtime and pushes. Nothing here is betting advice.
Where do I start?
How to read every change of a price or a line is in line movement explained. The fields are in the docs and the books are on the coverage page. Every plan starts with a 3-day free trial with a $1 card verification that is refunded immediately. The plan you pick at signup is charged from day 4 unless you cancel before the trial ends. See pricing or create an account.
To scan for price gaps in code, see find arbitrage with the API in Python. To run the numbers for your own two lines and prices, use the middle calculator. A middle can also be built with alternate lines at one book; the alternate line calculator gives a fair price for each line from the main market. Quarter-goal soccer lines split the stake across two lines, so half can win and half push; the Asian handicap calculator settles each case.