{"abstract":"The liability shown differs from what the exchange will reserve for the placed lay.","category":"Betting odds conversion","checks":8,"contract":"Green-up a matched back bet by laying at a later price (both > 1, else \"invalid\"). The equal-profit lay stake is back_stake * back_price / lay_price rounded half up to a cent. Using that rounded lay stake: liability = lay_stake * (lay_price - 1), profit if the selection wins = back_stake * (back_price - 1) - liability, profit if it loses = lay_stake - back_stake. Money values are exact then rounded half up to cents. Return [lay_stake, liability, profit_win, profit_lose].","contract_signature":"back_stake, back_price, lay_price","evaluation_group":"w2-odds-conversion-exchange-green-up-hedge","failed_approach":"Using the unrounded lay stake reports a liability for a stake that cannot be placed.","family":"w2-odds-conversion-exchange-green-up-hedge-liability-basis","id":"FA-84551","implementations":{"attempt":{"sha256":"b1aebc76f2abecef87cdcac0983a65444c33a52bcdbf8b1bec457ca86a7be037","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(back_stake, back_price, lay_price):\n    bp = Fraction(back_price)\n    lp = Fraction(lay_price)\n    if bp <= 1 or lp <= 1:\n        return 'invalid'\n    def cents(x):\n        return math.floor(x + Fraction(1, 2))\n    lay = cents(back_stake * bp / lp)\n    liability = back_stake * bp / lp * (lp - 1)\n    win = back_stake * (bp - 1) - liability\n    lose = lay - back_stake\n    return [lay, cents(liability), cents(win), cents(lose)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (1000, '2.13', '3.37'), [632, 1498, -368, -368]),\n  ('regression: liability basis', (777, '2.19', '3.53'), [482, 1219, -295, -295]),\n  ('variant scenario 1', (2500, '4.19', '5.37'), [1951, 8526, -551, -549]),\n  ('variant scenario 2', (777, '2.40', '4.13'), [452, 1415, -327, -325])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (333, '3.71', '6.08'), [203, 1031, -129, -130]),\n  ('variant scenario 1', (333, '3.42', '3.87'), [294, 844, -38, -39]),\n  ('variant scenario 2', (777, '6.37', '6.02'), [822, 4126, 46, 45])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (2500, '4.93', '3.75'), [3287, 9039, 786, 787]),\n  ('variant scenario 1', (333, '7.71', '5.28'), [486, 2080, 154, 153]),\n  ('variant scenario 2', (777, '3.75', '6.14'), [475, 2442, -305, -302])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (1000, '4.61', '3.77'), [1223, 3388, 222, 223]),\n  ('variant scenario 1', (1000, '6.97', '1.50'), [4647, 2324, 3647, 3647]),\n  ('variant scenario 2', (333, '6.28', '6.70'), [312, 1778, -20, -21])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (2500, '6.61', '2.17'), [7615, 8910, 5115, 5115]),\n  ('regression: liability basis', (777, '2.82', '6.91'), [317, 1873, -459, -460]),\n  ('variant scenario 1', (777, '7.11', '1.39'), [3974, 1550, 3198, 3197]),\n  ('variant scenario 2', (2500, '2.16', '1.35'), [4000, 1400, 1500, 1500])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"473fe1dd6e407a273201619ffcde9215956e494673f81617dfdb842af82757c5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(back_stake, back_price, lay_price):\n    bp = Fraction(back_price)\n    lp = Fraction(lay_price)\n    if bp <= 1 or lp <= 1:\n        return 'invalid'\n    def cents(x):\n        return math.floor(x + Fraction(1, 2))\n    lay = cents(back_stake * bp / lp)\n    liability = lay * lp\n    win = back_stake * (bp - 1) - liability\n    lose = lay - back_stake\n    return [lay, cents(liability), cents(win), cents(lose)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (1000, '2.13', '3.37'), [632, 1498, -368, -368]),\n  ('regression: liability basis', (777, '2.19', '3.53'), [482, 1219, -295, -295]),\n  ('variant scenario 1', (2500, '4.19', '5.37'), [1951, 8526, -551, -549]),\n  ('variant scenario 2', (777, '2.40', '4.13'), [452, 1415, -327, -325])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (333, '3.71', '6.08'), [203, 1031, -129, -130]),\n  ('variant scenario 1', (333, '3.42', '3.87'), [294, 844, -38, -39]),\n  ('variant scenario 2', (777, '6.37', '6.02'), [822, 4126, 46, 45])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (2500, '4.93', '3.75'), [3287, 9039, 786, 787]),\n  ('variant scenario 1', (333, '7.71', '5.28'), [486, 2080, 154, 153]),\n  ('variant scenario 2', (777, '3.75', '6.14'), [475, 2442, -305, -302])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (1000, '4.61', '3.77'), [1223, 3388, 222, 223]),\n  ('variant scenario 1', (1000, '6.97', '1.50'), [4647, 2324, 3647, 3647]),\n  ('variant scenario 2', (333, '6.28', '6.70'), [312, 1778, -20, -21])],\n [('control price shortened', (1000, '3.00', '2.00'), [1500, 1500, 500, 500]),\n  ('control price drifted', (1000, '2.00', '4.00'), [500, 1500, -500, -500]),\n  ('boundary no movement', (1000, '2.50', '2.50'), [1000, 1500, 0, 0]),\n  ('boundary invalid price', (1000, '1.00', '2.00'), 'invalid'),\n  ('regression: liability basis', (2500, '6.61', '2.17'), [7615, 8910, 5115, 5115]),\n  ('regression: liability basis', (777, '2.82', '6.91'), [317, 1873, -459, -460]),\n  ('variant scenario 1', (777, '7.11', '1.39'), [3974, 1550, 3198, 3197]),\n  ('variant scenario 2', (2500, '2.16', '1.35'), [4000, 1400, 1500, 1500])]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-odds-conversion-exchange-green-up-hedge-liability-basis","generated_at":"2026-09-29T14:50:31.891192+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exchange trading tools compute hedge stakes that equalise profit across outcomes.","root_cause":"Liability is computed as lay_stake * lay_price.","sha256":"60176208294464be118484af52fb75afe8cc3c266d52f584904303f8336eb674","title":"Liability computed from the unrounded lay stake or the full price · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":42.547,"exit_code":1,"observations":[{"actual":[1500,1500,500,500],"check":"control price shortened","expected":[1500,1500,500,500],"passed":true},{"actual":[500,1500,-500,-500],"check":"control price drifted","expected":[500,1500,-500,-500],"passed":true},{"actual":[1000,1500,0,0],"check":"boundary no movement","expected":[1000,1500,0,0],"passed":true},{"actual":"invalid","check":"boundary invalid price","expected":"invalid","passed":true},{"actual":[632,1498,-368,-368],"check":"regression: liability basis","expected":[632,1498,-368,-368],"passed":true},{"actual":[482,1220,-295,-295],"check":"regression: liability basis","expected":[482,1219,-295,-295],"passed":false},{"actual":[1951,8524,-549,-549],"check":"variant scenario 1","expected":[1951,8526,-551,-549],"passed":false},{"actual":[452,1413,-325,-325],"check":"variant scenario 2","expected":[452,1415,-327,-325],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control price shortened\", \"actual\": [1500, 1500, 500, 500], \"expected\": [1500, 1500, 500, 500], \"passed\": true}, {\"check\": \"control price drifted\", \"actual\": [500, 1500, -500, -500], \"expected\": [500, 1500, -500, -500], \"passed\": true}, {\"check\": \"boundary no movement\", \"actual\": [1000, 1500, 0, 0], \"expected\": [1000, 1500, 0, 0], \"passed\": true}, {\"check\": \"boundary invalid price\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: liability basis\", \"actual\": [632, 1498, -368, -368], \"expected\": [632, 1498, -368, -368], \"passed\": true}, {\"check\": \"regression: liability basis\", \"actual\": [482, 1220, -295, -295], \"expected\": [482, 1219, -295, -295], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [1951, 8524, -549, -549], \"expected\": [1951, 8526, -551, -549], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [452, 1413, -325, -325], \"expected\": [452, 1415, -327, -325], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.347,"exit_code":1,"observations":[{"actual":[1500,3000,-1000,500],"check":"control price shortened","expected":[1500,1500,500,500],"passed":false},{"actual":[500,2000,-1000,-500],"check":"control price drifted","expected":[500,1500,-500,-500],"passed":false},{"actual":[1000,2500,-1000,0],"check":"boundary no movement","expected":[1000,1500,0,0],"passed":false},{"actual":"invalid","check":"boundary invalid price","expected":"invalid","passed":true},{"actual":[632,2130,-1000,-368],"check":"regression: liability basis","expected":[632,1498,-368,-368],"passed":false},{"actual":[482,1701,-777,-295],"check":"regression: liability basis","expected":[482,1219,-295,-295],"passed":false},{"actual":[1951,10477,-2502,-549],"check":"variant scenario 1","expected":[1951,8526,-551,-549],"passed":false},{"actual":[452,1867,-779,-325],"check":"variant scenario 2","expected":[452,1415,-327,-325],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control price shortened\", \"actual\": [1500, 3000, -1000, 500], \"expected\": [1500, 1500, 500, 500], \"passed\": false}, {\"check\": \"control price drifted\", \"actual\": [500, 2000, -1000, -500], \"expected\": [500, 1500, -500, -500], \"passed\": false}, {\"check\": \"boundary no movement\", \"actual\": [1000, 2500, -1000, 0], \"expected\": [1000, 1500, 0, 0], \"passed\": false}, {\"check\": \"boundary invalid price\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"regression: liability basis\", \"actual\": [632, 2130, -1000, -368], \"expected\": [632, 1498, -368, -368], \"passed\": false}, {\"check\": \"regression: liability basis\", \"actual\": [482, 1701, -777, -295], \"expected\": [482, 1219, -295, -295], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [1951, 10477, -2502, -549], \"expected\": [1951, 8526, -551, -549], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [452, 1867, -779, -325], \"expected\": [452, 1415, -327, -325], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}