FAILURE MAP
← Case archive

FA-84766 / Betting odds conversion / Open access

Negative American payout converted as a positive line · case 01

A two-team teaser at -120 pays 2.20 instead of about 1.83.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The negative table value is converted with |am| / 100.

THE FAILURE

The negative table value is converted with |am| / 100.

Unsuccessful approach: Dividing 100 by the signed value produces a price below 1.

Case contract

Point-spread teaser. legs rows are [team spread line, team margin of victory]; every line is moved in the bettor's favour by points (adjusted = line + points). A leg wins if margin + adjusted > 0, pushes if = 0, loses if < 0. Any losing leg loses the ticket. Pushed legs are dropped; fewer than 2 remaining winners refunds the stake. Payout by winning legs from the American table {2: -120, 3: +160, 4: +260, 5: +400} (5 or more pay +400). Return [status, return cents rounded down].

Why this case matters

Sportsbooks grade teasers with shifted lines, push reduction and a tiered payout table.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(legs, points, stake_cents):
    TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
    wins = 0
    for line, margin in legs:
        adj = Fraction(line) + Fraction(points)
        v = margin + adj
        if v < 0:
            return ['lose', 0]
        if v > 0:
            wins += 1
    if wins < 2:
        return ['refund', stake_cents]
    am = TABLE[min(wins, 5)]
    dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(-am, 100))
    return ['win', math.floor(stake_cents * dec)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7.5', 11], ['+3', -5]], '6.5', 1100), ['win', 2016]),
  ('variant scenario 1', ([['-1', -13], ['+7', 14], ['-1', -9]], '6', 1100), ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -3], ['+7', 12], ['+7', -1], ['-7.5', 0], ['-3', -5]], '6.5', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7', 7], ['+2.5', 1]], '6', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+7', 3], ['+7', -3], ['+3', 8], ['+1.5', 2], ['-1', 13], ['+1.5', 1]], '6', 1100),
   ['win', 5500]),
  ('variant scenario 2',
   ([['+3', 10], ['-6', -4], ['-7.5', 11], ['+3', 3]], '7', 500),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout',
   ([['-1', 13], ['+3', 6], ['-10', 4]], '6', 1000),
   ['win', 1833]),
  ('variant scenario 1',
   ([['-7.5', 5], ['-7.5', -7], ['+2.5', -5], ['+2.5', 13], ['-7.5', 14], ['-3', 13]], '7', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['+7', 10], ['-10', 2], ['-7.5', -11], ['-7', -12], ['+3', -11], ['-7.5', 12]], '6', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+3', 1], ['+7', 4]], '7', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+3', 6], ['+2.5', -10], ['-7', -5], ['-6', -10], ['-7', 4], ['+1.5', 2]], '6.5', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -5], ['-10', 0], ['-3', 4], ['-6', -10], ['+7', 2]], '6', 1100),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+2.5', 1], ['+1.5', 7]], '6', 500), ['win', 916]),
  ('variant scenario 1',
   ([['-7.5', 8], ['-10', -13], ['+3', 2], ['-6', -9]], '6.5', 1000),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-1', -8], ['-6', 1], ['-7.5', 8], ['-7.5', -8]], '7', 1000),
   ['lose', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control two-team teaser['win', 2640]['win', 2200]Failed
boundary push drops a leg['win', 2200]['win', 1833]Failed
boundary reduced to one leg['refund', 1000]['refund', 1000]Passed
control losing leg['lose', 0]['lose', 0]Passed
control three winners['win', 2600]['win', 2600]Passed
regression: negative line payout['win', 2420]['win', 2016]Failed
variant scenario 1['lose', 0]['lose', 0]Passed
variant scenario 2['lose', 0]['lose', 0]Passed

SHA-256 / 232e1f0c6e2a8769a434a4d83da1d97a834070573df2f5a6530d9ebec60900e2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(legs, points, stake_cents):
    TABLE = {2: -120, 3: 160, 4: 260, 5: 400}
    wins = 0
    for line, margin in legs:
        adj = Fraction(line) + Fraction(points)
        v = margin + adj
        if v < 0:
            return ['lose', 0]
        if v > 0:
            wins += 1
    if wins < 2:
        return ['refund', stake_cents]
    am = TABLE[min(wins, 5)]
    dec = 1 + (Fraction(am, 100) if am > 0 else Fraction(100, am))
    return ['win', math.floor(stake_cents * dec)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
    try:
        return solve(*args)
    except Exception as exc:
        return 'raised ' + type(exc).__name__
cases = [[('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7.5', 11], ['+3', -5]], '6.5', 1100), ['win', 2016]),
  ('variant scenario 1', ([['-1', -13], ['+7', 14], ['-1', -9]], '6', 1100), ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -3], ['+7', 12], ['+7', -1], ['-7.5', 0], ['-3', -5]], '6.5', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['-7', 7], ['+2.5', 1]], '6', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+7', 3], ['+7', -3], ['+3', 8], ['+1.5', 2], ['-1', 13], ['+1.5', 1]], '6', 1100),
   ['win', 5500]),
  ('variant scenario 2',
   ([['+3', 10], ['-6', -4], ['-7.5', 11], ['+3', 3]], '7', 500),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout',
   ([['-1', 13], ['+3', 6], ['-10', 4]], '6', 1000),
   ['win', 1833]),
  ('variant scenario 1',
   ([['-7.5', 5], ['-7.5', -7], ['+2.5', -5], ['+2.5', 13], ['-7.5', 14], ['-3', 13]], '7', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['+7', 10], ['-10', 2], ['-7.5', -11], ['-7', -12], ['+3', -11], ['-7.5', 12]], '6', 1000),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+3', 1], ['+7', 4]], '7', 1000), ['win', 1833]),
  ('variant scenario 1',
   ([['+3', 6], ['+2.5', -10], ['-7', -5], ['-6', -10], ['-7', 4], ['+1.5', 2]], '6.5', 500),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-7', -5], ['-10', 0], ['-3', 4], ['-6', -10], ['+7', 2]], '6', 1100),
   ['lose', 0])],
 [('control two-team teaser', ([['-7.5', 3], ['+2.5', -5]], '6', 1200), ['win', 2200]),
  ('boundary push drops a leg', ([['-7', 1], ['+3', 0], ['-1', 2]], '6', 1000), ['win', 1833]),
  ('boundary reduced to one leg', ([['-7', 1], ['+3', 5]], '6', 1000), ['refund', 1000]),
  ('control losing leg', ([['-10', 2], ['+3', 5], ['+7', 0]], '6', 1000), ['lose', 0]),
  ('control three winners', ([['-3', 1], ['+3', 0], ['-1', 0]], '6', 1000), ['win', 2600]),
  ('regression: negative line payout', ([['+2.5', 1], ['+1.5', 7]], '6', 500), ['win', 916]),
  ('variant scenario 1',
   ([['-7.5', 8], ['-10', -13], ['+3', 2], ['-6', -9]], '6.5', 1000),
   ['lose', 0]),
  ('variant scenario 2',
   ([['-1', -8], ['-6', 1], ['-7.5', 8], ['-7.5', -8]], '7', 1000),
   ['lose', 0])]]
for label, args, expected in cases[N - 1]:
    check(label, run(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
control two-team teaser['win', 200]['win', 2200]Failed
boundary push drops a leg['win', 166]['win', 1833]Failed
boundary reduced to one leg['refund', 1000]['refund', 1000]Passed
control losing leg['lose', 0]['lose', 0]Passed
control three winners['win', 2600]['win', 2600]Passed
regression: negative line payout['win', 183]['win', 2016]Failed
variant scenario 1['lose', 0]['lose', 0]Passed
variant scenario 2['lose', 0]['lose', 0]Passed

SHA-256 / a697211cbf1401a2d2b25b5baf56b704c95409a54a74e421b8df887cb85273f2

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:33.993573+00:00.

Case digest / 59286c02bc9abc13b6636f4096556ad00c0369fb0368a87922548bfb4c054d8d