FAILURE MAP
← Case archive

FA-84544 / Betting odds conversion / Member archive

Commission computed on losing markets · case 04

A losing market produces a negative commission refund or a charge on the loss.

Member previewVariant 4 · 3 implementations · 7 checks per implementation

Case contract

Betting exchange settlement. bets rows are [market, side, stake_cents, price, won] where won says whether the bet won. Back: win profit floor(stake * (price - 1)), loss -stake. Lay: win +stake, loss -ceil(stake * (price - 1)) (the liability). Commission is charged per market on the market net profit only when that net is positive, at rate_pct percent rounded half up to a cent. Return [total net after commission, total commission] in cents.

Why this case matters

Exchanges charge commission on net market winnings, not per winning bet.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
boundary losing market no commission[-475, -25][-500, 0]Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

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

Sign in to the archive ↗