{"abstract":"The hedged position still has unequal outcomes.","category":"Betting odds conversion","checks":7,"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].","evaluation_group":"w2-odds-conversion-exchange-green-up-hedge","failed_approach":"Inverting the price ratio moves the stake in the wrong direction.","family":"w2-odds-conversion-exchange-green-up-hedge-hedge-ratio","id":"FA-84546","implementations":{"attempt":{"sha256":"637cd3e6cd5d209ed09c4f572d0d8d85868989a052a1ffd8e937a81b54c86eaa","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 * lp / bp)\n    liability = lay * (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: hedge ratio', (2500, '7.81', '7.55'), [2586, 16938, 87, 86]),\n  ('variant scenario 1', (1000, '3.26', '7.05'), [462, 2795, -535, -538]),\n  ('variant scenario 2', (2500, '7.95', '5.04'), [3943, 15930, 1445, 1443])],\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: hedge ratio', (777, '1.59', '7.16'), [173, 1066, -607, -604]),\n  ('variant scenario 1', (1000, '6.72', '3.81'), [1764, 4957, 763, 764]),\n  ('variant scenario 2', (333, '1.45', '2.25'), [215, 269, -119, -118])],\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: hedge ratio', (2500, '3.88', '7.37'), [1316, 8383, -1183, -1184]),\n  ('variant scenario 1', (1000, '7.55', '7.11'), [1062, 6489, 61, 62]),\n  ('variant scenario 2', (777, '2.80', '3.78'), [576, 1601, -203, -201])],\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: hedge ratio', (333, '3.90', '7.35'), [177, 1124, -158, -156]),\n  ('variant scenario 1', (777, '6.63', '2.19'), [2352, 2799, 1576, 1575]),\n  ('variant scenario 2', (333, '3.52', '4.20'), [279, 893, -54, -54])],\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: hedge ratio', (2500, '7.26', '4.46'), [4070, 14082, 1568, 1570]),\n  ('variant scenario 1', (333, '5.42', '2.88'), [627, 1179, 293, 294]),\n  ('variant scenario 2', (1000, '5.50', '7.68'), [716, 4783, -283, -284])]]\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":"9239fa4b65f2131a24c8bb423fccb5dff3b4917e10c0bbd443149f09e264e843","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 - 1) / (lp - 1))\n    liability = lay * (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: hedge ratio', (2500, '7.81', '7.55'), [2586, 16938, 87, 86]),\n  ('variant scenario 1', (1000, '3.26', '7.05'), [462, 2795, -535, -538]),\n  ('variant scenario 2', (2500, '7.95', '5.04'), [3943, 15930, 1445, 1443])],\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: hedge ratio', (777, '1.59', '7.16'), [173, 1066, -607, -604]),\n  ('variant scenario 1', (1000, '6.72', '3.81'), [1764, 4957, 763, 764]),\n  ('variant scenario 2', (333, '1.45', '2.25'), [215, 269, -119, -118])],\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: hedge ratio', (2500, '3.88', '7.37'), [1316, 8383, -1183, -1184]),\n  ('variant scenario 1', (1000, '7.55', '7.11'), [1062, 6489, 61, 62]),\n  ('variant scenario 2', (777, '2.80', '3.78'), [576, 1601, -203, -201])],\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: hedge ratio', (333, '3.90', '7.35'), [177, 1124, -158, -156]),\n  ('variant scenario 1', (777, '6.63', '2.19'), [2352, 2799, 1576, 1575]),\n  ('variant scenario 2', (333, '3.52', '4.20'), [279, 893, -54, -54])],\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: hedge ratio', (2500, '7.26', '4.46'), [4070, 14082, 1568, 1570]),\n  ('variant scenario 1', (333, '5.42', '2.88'), [627, 1179, 293, 294]),\n  ('variant scenario 2', (1000, '5.50', '7.68'), [716, 4783, -283, -284])]]\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"},"fixed":{"sha256":"60b35688d8d2f12f19779384cb1279aa1ac17753b268914871ca2e460d5123a5","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 - 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: hedge ratio', (2500, '7.81', '7.55'), [2586, 16938, 87, 86]),\n  ('variant scenario 1', (1000, '3.26', '7.05'), [462, 2795, -535, -538]),\n  ('variant scenario 2', (2500, '7.95', '5.04'), [3943, 15930, 1445, 1443])],\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: hedge ratio', (777, '1.59', '7.16'), [173, 1066, -607, -604]),\n  ('variant scenario 1', (1000, '6.72', '3.81'), [1764, 4957, 763, 764]),\n  ('variant scenario 2', (333, '1.45', '2.25'), [215, 269, -119, -118])],\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: hedge ratio', (2500, '3.88', '7.37'), [1316, 8383, -1183, -1184]),\n  ('variant scenario 1', (1000, '7.55', '7.11'), [1062, 6489, 61, 62]),\n  ('variant scenario 2', (777, '2.80', '3.78'), [576, 1601, -203, -201])],\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: hedge ratio', (333, '3.90', '7.35'), [177, 1124, -158, -156]),\n  ('variant scenario 1', (777, '6.63', '2.19'), [2352, 2799, 1576, 1575]),\n  ('variant scenario 2', (333, '3.52', '4.20'), [279, 893, -54, -54])],\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: hedge ratio', (2500, '7.26', '4.46'), [4070, 14082, 1568, 1570]),\n  ('variant scenario 1', (333, '5.42', '2.88'), [627, 1179, 293, 294]),\n  ('variant scenario 2', (1000, '5.50', '7.68'), [716, 4783, -283, -284])]]\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-hedge-ratio","generated_at":"2026-09-29T14:50:31.894983+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.","repair":"Use back_stake * back_price / lay_price.","root_cause":"The lay stake is back_stake * (back_price - 1) / (lay_price - 1), matching liabilities only.","sha256":"868b2a2a1509e338c28027301a7f072ef5a15541d7c55f3ec5191b3a255f2800","title":"Hedge stake matched on profit instead of total return · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.823,"exit_code":1,"observations":[{"actual":[667,667,1333,-333],"check":"control price shortened","expected":[1500,1500,500,500],"passed":false},{"actual":[2000,6000,-5000,1000],"check":"control price drifted","expected":[500,1500,-500,-500],"passed":false},{"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":[2417,15831,1194,-83],"check":"regression: hedge ratio","expected":[2586,16938,87,86],"passed":false},{"actual":[2163,13086,-10826,1163],"check":"variant scenario 1","expected":[462,2795,-535,-538],"passed":false},{"actual":[1585,6403,10972,-915],"check":"variant scenario 2","expected":[3943,15930,1445,1443],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control price shortened\", \"actual\": [667, 667, 1333, -333], \"expected\": [1500, 1500, 500, 500], \"passed\": false}, {\"check\": \"control price drifted\", \"actual\": [2000, 6000, -5000, 1000], \"expected\": [500, 1500, -500, -500], \"passed\": false}, {\"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: hedge ratio\", \"actual\": [2417, 15831, 1194, -83], \"expected\": [2586, 16938, 87, 86], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [2163, 13086, -10826, 1163], \"expected\": [462, 2795, -535, -538], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [1585, 6403, 10972, -915], \"expected\": [3943, 15930, 1445, 1443], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.418,"exit_code":1,"observations":[{"actual":[2000,2000,0,1000],"check":"control price shortened","expected":[1500,1500,500,500],"passed":false},{"actual":[333,999,1,-667],"check":"control price drifted","expected":[500,1500,-500,-500],"passed":false},{"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":[2599,17023,2,99],"check":"regression: hedge ratio","expected":[2586,16938,87,86],"passed":false},{"actual":[374,2263,-3,-626],"check":"variant scenario 1","expected":[462,2795,-535,-538],"passed":false},{"actual":[4301,17376,-1,1801],"check":"variant scenario 2","expected":[3943,15930,1445,1443],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control price shortened\", \"actual\": [2000, 2000, 0, 1000], \"expected\": [1500, 1500, 500, 500], \"passed\": false}, {\"check\": \"control price drifted\", \"actual\": [333, 999, 1, -667], \"expected\": [500, 1500, -500, -500], \"passed\": false}, {\"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: hedge ratio\", \"actual\": [2599, 17023, 2, 99], \"expected\": [2586, 16938, 87, 86], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [374, 2263, -3, -626], \"expected\": [462, 2795, -535, -538], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [4301, 17376, -1, 1801], \"expected\": [3943, 15930, 1445, 1443], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.932,"exit_code":0,"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":[2586,16938,87,86],"check":"regression: hedge ratio","expected":[2586,16938,87,86],"passed":true},{"actual":[462,2795,-535,-538],"check":"variant scenario 1","expected":[462,2795,-535,-538],"passed":true},{"actual":[3943,15930,1445,1443],"check":"variant scenario 2","expected":[3943,15930,1445,1443],"passed":true}],"passed":true,"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: hedge ratio\", \"actual\": [2586, 16938, 87, 86], \"expected\": [2586, 16938, 87, 86], \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": [462, 2795, -535, -538], \"expected\": [462, 2795, -535, -538], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [3943, 15930, 1445, 1443], \"expected\": [3943, 15930, 1445, 1443], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}