{"abstract":"Stakes are sized far too large on every price.","category":"Betting odds conversion","checks":8,"contract":"Kelly staking. With b = price - 1, p = prob and q = 1 - p, the full Kelly fraction is (b * p - q) / b, floored at 0 when the edge is not positive. The stake is bankroll * min(full Kelly * fraction, max_pct / 100), rounded down to a cent. Return [full Kelly fraction rounded half up to four decimals as a string, stake cents].","contract_signature":"prob, price, fraction, bankroll_cents, max_pct","evaluation_group":"w2-odds-conversion-kelly-stake-sizing","failed_approach":"Using net odds in the numerator but the decimal price in the denominator still misstates the fraction.","family":"w2-odds-conversion-kelly-stake-sizing-net-odds","id":"FA-84556","implementations":{"attempt":{"sha256":"f04de6a2d7fe538620b2987cbd4f6e52a3e7537923811dbe09ed0ea671bcc0b4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(prob, price, fraction, bankroll_cents, max_pct):\n    p = Fraction(prob)\n    b = Fraction(price) - 1\n    q = 1 - p\n    k = (b * p - q) / (b + 1)\n    if k < 0:\n        k = Fraction(0)\n    use = min(k * Fraction(fraction), Fraction(max_pct) / 100)\n    stake = math.floor(bankroll_cents * use)\n    r = math.floor(k * 10000 + Fraction(1, 2))\n    return ['%d.%04d' % (r // 10000, r % 10000), stake]\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 even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.60', '3.27', '0.5', 50000, '10'), ['0.4238', 5000]),\n  ('variant scenario 1', ('0.50', '1.73', '0.5', 100000, '5'), ['0.0000', 0]),\n  ('variant scenario 2', ('0.60', '5.99', '1', 12345, '10'), ['0.5198', 1234])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.80', '4.16', '0.25', 50000, '2'), ['0.7367', 1000]),\n  ('variant scenario 1', ('0.60', '3.64', '0.5', 12345, '5'), ['0.4485', 617]),\n  ('variant scenario 2', ('0.60', '2.09', '1', 12345, '2'), ['0.2330', 246])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.60', '2.62', '0.25', 50000, '5'), ['0.3531', 2500]),\n  ('variant scenario 1', ('0.60', '5.17', '0.25', 50000, '5'), ['0.5041', 2500]),\n  ('variant scenario 2', ('0.57', '3.82', '0.5', 50000, '100'), ['0.4175', 10437])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.55', '1.34', '1', 100000, '10'), ['0.0000', 0]),\n  ('regression: net odds', ('0.57', '2.09', '0.5', 100000, '10'), ['0.1755', 8775]),\n  ('variant scenario 1', ('0.60', '2.15', '1', 12345, '100'), ['0.2522', 3113]),\n  ('variant scenario 2', ('0.48', '3.64', '0.5', 50000, '2'), ['0.2830', 1000])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.55', '3.59', '0.25', 12345, '100'), ['0.3763', 1161]),\n  ('variant scenario 1', ('0.60', '2.93', '0.25', 12345, '10'), ['0.3927', 1212]),\n  ('variant scenario 2', ('0.78', '1.41', '0.25', 100000, '100'), ['0.2434', 6085])]]\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":"149e954f772927e42934efcc85c1f85e6989903261d84d7b385e985616b983d8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(prob, price, fraction, bankroll_cents, max_pct):\n    p = Fraction(prob)\n    b = Fraction(price)\n    q = 1 - p\n    k = (b * p - q) / b\n    if k < 0:\n        k = Fraction(0)\n    use = min(k * Fraction(fraction), Fraction(max_pct) / 100)\n    stake = math.floor(bankroll_cents * use)\n    r = math.floor(k * 10000 + Fraction(1, 2))\n    return ['%d.%04d' % (r // 10000, r % 10000), stake]\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 even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.60', '3.27', '0.5', 50000, '10'), ['0.4238', 5000]),\n  ('variant scenario 1', ('0.50', '1.73', '0.5', 100000, '5'), ['0.0000', 0]),\n  ('variant scenario 2', ('0.60', '5.99', '1', 12345, '10'), ['0.5198', 1234])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.80', '4.16', '0.25', 50000, '2'), ['0.7367', 1000]),\n  ('variant scenario 1', ('0.60', '3.64', '0.5', 12345, '5'), ['0.4485', 617]),\n  ('variant scenario 2', ('0.60', '2.09', '1', 12345, '2'), ['0.2330', 246])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.60', '2.62', '0.25', 50000, '5'), ['0.3531', 2500]),\n  ('variant scenario 1', ('0.60', '5.17', '0.25', 50000, '5'), ['0.5041', 2500]),\n  ('variant scenario 2', ('0.57', '3.82', '0.5', 50000, '100'), ['0.4175', 10437])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.55', '1.34', '1', 100000, '10'), ['0.0000', 0]),\n  ('regression: net odds', ('0.57', '2.09', '0.5', 100000, '10'), ['0.1755', 8775]),\n  ('variant scenario 1', ('0.60', '2.15', '1', 12345, '100'), ['0.2522', 3113]),\n  ('variant scenario 2', ('0.48', '3.64', '0.5', 50000, '2'), ['0.2830', 1000])],\n [('control even-money edge', ('0.55', '2.00', '1', 100000, '100'), ['0.1000', 10000]),\n  ('control half kelly', ('0.55', '2.00', '0.5', 100000, '100'), ['0.1000', 5000]),\n  ('boundary capped stake', ('0.60', '2.00', '1', 100000, '5'), ['0.2000', 5000]),\n  ('boundary no edge', ('0.40', '2.00', '1', 100000, '5'), ['0.0000', 0]),\n  ('control underdog edge', ('0.30', '4.00', '1', 100000, '100'), ['0.0667', 6666]),\n  ('regression: net odds', ('0.55', '3.59', '0.25', 12345, '100'), ['0.3763', 1161]),\n  ('variant scenario 1', ('0.60', '2.93', '0.25', 12345, '10'), ['0.3927', 1212]),\n  ('variant scenario 2', ('0.78', '1.41', '0.25', 100000, '100'), ['0.2434', 6085])]]\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-kelly-stake-sizing-net-odds","generated_at":"2026-09-29T14:50:31.900680+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Bankroll tools size stakes with fractional Kelly and a hard cap.","root_cause":"b is taken as the decimal price rather than price - 1.","sha256":"6349aadfd0c4042fe8431d1997d051227ad631ed5597619feb1c7ac5601a94d2","title":"Kelly computed with decimal odds instead of net odds · 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":44.358,"exit_code":1,"observations":[{"actual":["0.0500",5000],"check":"control even-money edge","expected":["0.1000",10000],"passed":false},{"actual":["0.0500",2500],"check":"control half kelly","expected":["0.1000",5000],"passed":false},{"actual":["0.1000",5000],"check":"boundary capped stake","expected":["0.2000",5000],"passed":false},{"actual":["0.0000",0],"check":"boundary no edge","expected":["0.0000",0],"passed":true},{"actual":["0.0500",5000],"check":"control underdog edge","expected":["0.0667",6666],"passed":false},{"actual":["0.2942",5000],"check":"regression: net odds","expected":["0.4238",5000],"passed":false},{"actual":["0.0000",0],"check":"variant scenario 1","expected":["0.0000",0],"passed":true},{"actual":["0.4331",1234],"check":"variant scenario 2","expected":["0.5198",1234],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control even-money edge\", \"actual\": [\"0.0500\", 5000], \"expected\": [\"0.1000\", 10000], \"passed\": false}, {\"check\": \"control half kelly\", \"actual\": [\"0.0500\", 2500], \"expected\": [\"0.1000\", 5000], \"passed\": false}, {\"check\": \"boundary capped stake\", \"actual\": [\"0.1000\", 5000], \"expected\": [\"0.2000\", 5000], \"passed\": false}, {\"check\": \"boundary no edge\", \"actual\": [\"0.0000\", 0], \"expected\": [\"0.0000\", 0], \"passed\": true}, {\"check\": \"control underdog edge\", \"actual\": [\"0.0500\", 5000], \"expected\": [\"0.0667\", 6666], \"passed\": false}, {\"check\": \"regression: net odds\", \"actual\": [\"0.2942\", 5000], \"expected\": [\"0.4238\", 5000], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"0.0000\", 0], \"expected\": [\"0.0000\", 0], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"0.4331\", 1234], \"expected\": [\"0.5198\", 1234], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.611,"exit_code":1,"observations":[{"actual":["0.3250",32500],"check":"control even-money edge","expected":["0.1000",10000],"passed":false},{"actual":["0.3250",16250],"check":"control half kelly","expected":["0.1000",5000],"passed":false},{"actual":["0.4000",5000],"check":"boundary capped stake","expected":["0.2000",5000],"passed":false},{"actual":["0.1000",5000],"check":"boundary no edge","expected":["0.0000",0],"passed":false},{"actual":["0.1250",12500],"check":"control underdog edge","expected":["0.0667",6666],"passed":false},{"actual":["0.4777",5000],"check":"regression: net odds","expected":["0.4238",5000],"passed":false},{"actual":["0.2110",5000],"check":"variant scenario 1","expected":["0.0000",0],"passed":false},{"actual":["0.5332",1234],"check":"variant scenario 2","expected":["0.5198",1234],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control even-money edge\", \"actual\": [\"0.3250\", 32500], \"expected\": [\"0.1000\", 10000], \"passed\": false}, {\"check\": \"control half kelly\", \"actual\": [\"0.3250\", 16250], \"expected\": [\"0.1000\", 5000], \"passed\": false}, {\"check\": \"boundary capped stake\", \"actual\": [\"0.4000\", 5000], \"expected\": [\"0.2000\", 5000], \"passed\": false}, {\"check\": \"boundary no edge\", \"actual\": [\"0.1000\", 5000], \"expected\": [\"0.0000\", 0], \"passed\": false}, {\"check\": \"control underdog edge\", \"actual\": [\"0.1250\", 12500], \"expected\": [\"0.0667\", 6666], \"passed\": false}, {\"check\": \"regression: net odds\", \"actual\": [\"0.4777\", 5000], \"expected\": [\"0.4238\", 5000], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"0.2110\", 5000], \"expected\": [\"0.0000\", 0], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [\"0.5332\", 1234], \"expected\": [\"0.5198\", 1234], \"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."}}