FAILURE MAP
← Case archive

FA-84535 / Betting odds conversion / Member archive

Commission charged per winning bet instead of per market · case 05

A hedged market pays commission on the winning leg despite a small net profit.

Member previewVariant 5 · 3 implementations · 8 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 hedged market nets out[400, 100][475, 25]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 ↗