{"abstract":"Half-Kelly stakes are halved again after capping, or the multiplier is ignored.","category":"Betting odds conversion","checks":9,"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":"Capping the full Kelly fraction and ignoring the multiplier overstakes fractional Kelly users.","family":"w2-odds-conversion-kelly-stake-sizing-cap-order","id":"FA-84566","implementations":{"attempt":{"sha256":"18596b20d6e55cfafe5fab9dfedede3e930d8f5c562595d7b5028244479d728d","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\n    if k < 0:\n        k = Fraction(0)\n    use = min(k, 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: cap order', ('0.55', '3.08', '0.5', 100000, '5'), ['0.3337', 5000]),\n  ('regression: cap order', ('0.55', '2.51', '0.25', 100000, '100'), ['0.2520', 6299]),\n  ('variant scenario 1', ('0.55', '3.41', '0.5', 50000, '5'), ['0.3633', 2500]),\n  ('variant scenario 2', ('0.76', '5.95', '0.25', 100000, '10'), ['0.7115', 10000])],\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: cap order', ('0.65', '4.43', '0.25', 100000, '5'), ['0.5480', 5000]),\n  ('regression: cap order', ('0.40', '5.78', '0.25', 50000, '10'), ['0.2745', 3430]),\n  ('variant scenario 1', ('0.50', '2.74', '1', 100000, '10'), ['0.2126', 10000]),\n  ('variant scenario 2', ('0.50', '1.57', '0.5', 12345, '5'), ['0.0000', 0])],\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: cap order', ('0.50', '3.97', '0.25', 50000, '100'), ['0.3316', 4145]),\n  ('regression: cap order', ('0.55', '4.19', '0.25', 100000, '10'), ['0.4089', 10000]),\n  ('variant scenario 1', ('0.55', '3.12', '1', 50000, '5'), ['0.3377', 2500]),\n  ('variant scenario 2', ('0.55', '4.80', '1', 50000, '100'), ['0.4316', 21578])],\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: cap order', ('0.50', '3.30', '0.5', 50000, '2'), ['0.2826', 1000]),\n  ('regression: cap order', ('0.50', '5.60', '0.5', 50000, '100'), ['0.3913', 9782]),\n  ('variant scenario 1', ('0.50', '3.50', '0.25', 50000, '5'), ['0.3000', 2500]),\n  ('variant scenario 2', ('0.60', '4.06', '1', 12345, '2'), ['0.4693', 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: cap order', ('0.55', '2.71', '0.25', 50000, '2'), ['0.2868', 1000]),\n  ('regression: cap order', ('0.79', '4.28', '0.5', 100000, '100'), ['0.7260', 36298]),\n  ('variant scenario 1', ('0.57', '5.73', '0.25', 50000, '5'), ['0.4791', 2500]),\n  ('variant scenario 2', ('0.60', '2.44', '1', 12345, '2'), ['0.3222', 246])]]\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":"bba164f3cbffea41b8f373f933deea2d4d0fa67bd35542eb25bd65fc08a1fe4a","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\n    if k < 0:\n        k = Fraction(0)\n    use = min(k, Fraction(max_pct) / 100) * Fraction(fraction)\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: cap order', ('0.55', '3.08', '0.5', 100000, '5'), ['0.3337', 5000]),\n  ('regression: cap order', ('0.55', '2.51', '0.25', 100000, '100'), ['0.2520', 6299]),\n  ('variant scenario 1', ('0.55', '3.41', '0.5', 50000, '5'), ['0.3633', 2500]),\n  ('variant scenario 2', ('0.76', '5.95', '0.25', 100000, '10'), ['0.7115', 10000])],\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: cap order', ('0.65', '4.43', '0.25', 100000, '5'), ['0.5480', 5000]),\n  ('regression: cap order', ('0.40', '5.78', '0.25', 50000, '10'), ['0.2745', 3430]),\n  ('variant scenario 1', ('0.50', '2.74', '1', 100000, '10'), ['0.2126', 10000]),\n  ('variant scenario 2', ('0.50', '1.57', '0.5', 12345, '5'), ['0.0000', 0])],\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: cap order', ('0.50', '3.97', '0.25', 50000, '100'), ['0.3316', 4145]),\n  ('regression: cap order', ('0.55', '4.19', '0.25', 100000, '10'), ['0.4089', 10000]),\n  ('variant scenario 1', ('0.55', '3.12', '1', 50000, '5'), ['0.3377', 2500]),\n  ('variant scenario 2', ('0.55', '4.80', '1', 50000, '100'), ['0.4316', 21578])],\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: cap order', ('0.50', '3.30', '0.5', 50000, '2'), ['0.2826', 1000]),\n  ('regression: cap order', ('0.50', '5.60', '0.5', 50000, '100'), ['0.3913', 9782]),\n  ('variant scenario 1', ('0.50', '3.50', '0.25', 50000, '5'), ['0.3000', 2500]),\n  ('variant scenario 2', ('0.60', '4.06', '1', 12345, '2'), ['0.4693', 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: cap order', ('0.55', '2.71', '0.25', 50000, '2'), ['0.2868', 1000]),\n  ('regression: cap order', ('0.79', '4.28', '0.5', 100000, '100'), ['0.7260', 36298]),\n  ('variant scenario 1', ('0.57', '5.73', '0.25', 50000, '5'), ['0.4791', 2500]),\n  ('variant scenario 2', ('0.60', '2.44', '1', 12345, '2'), ['0.3222', 246])]]\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-cap-order","generated_at":"2026-09-29T14:50:32.093548+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":"The cap is applied to the full Kelly fraction and then scaled by the multiplier.","sha256":"cd6aab8ca29f5e2fbbbeeeef9c584d5eee29d182003de41cfe40c6b252cee8d8","title":"Stake cap applied before the Kelly multiplier · 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":48.592,"exit_code":1,"observations":[{"actual":["0.1000",10000],"check":"control even-money edge","expected":["0.1000",10000],"passed":true},{"actual":["0.1000",10000],"check":"control half kelly","expected":["0.1000",5000],"passed":false},{"actual":["0.2000",5000],"check":"boundary capped stake","expected":["0.2000",5000],"passed":true},{"actual":["0.0000",0],"check":"boundary no edge","expected":["0.0000",0],"passed":true},{"actual":["0.0667",6666],"check":"control underdog edge","expected":["0.0667",6666],"passed":true},{"actual":["0.3337",5000],"check":"regression: cap order","expected":["0.3337",5000],"passed":true},{"actual":["0.2520",25198],"check":"regression: cap order","expected":["0.2520",6299],"passed":false},{"actual":["0.3633",2500],"check":"variant scenario 1","expected":["0.3633",2500],"passed":true},{"actual":["0.7115",10000],"check":"variant scenario 2","expected":["0.7115",10000],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control even-money edge\", \"actual\": [\"0.1000\", 10000], \"expected\": [\"0.1000\", 10000], \"passed\": true}, {\"check\": \"control half kelly\", \"actual\": [\"0.1000\", 10000], \"expected\": [\"0.1000\", 5000], \"passed\": false}, {\"check\": \"boundary capped stake\", \"actual\": [\"0.2000\", 5000], \"expected\": [\"0.2000\", 5000], \"passed\": true}, {\"check\": \"boundary no edge\", \"actual\": [\"0.0000\", 0], \"expected\": [\"0.0000\", 0], \"passed\": true}, {\"check\": \"control underdog edge\", \"actual\": [\"0.0667\", 6666], \"expected\": [\"0.0667\", 6666], \"passed\": true}, {\"check\": \"regression: cap order\", \"actual\": [\"0.3337\", 5000], \"expected\": [\"0.3337\", 5000], \"passed\": true}, {\"check\": \"regression: cap order\", \"actual\": [\"0.2520\", 25198], \"expected\": [\"0.2520\", 6299], \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": [\"0.3633\", 2500], \"expected\": [\"0.3633\", 2500], \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": [\"0.7115\", 10000], \"expected\": [\"0.7115\", 10000], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":48.657,"exit_code":1,"observations":[{"actual":["0.1000",10000],"check":"control even-money edge","expected":["0.1000",10000],"passed":true},{"actual":["0.1000",5000],"check":"control half kelly","expected":["0.1000",5000],"passed":true},{"actual":["0.2000",5000],"check":"boundary capped stake","expected":["0.2000",5000],"passed":true},{"actual":["0.0000",0],"check":"boundary no edge","expected":["0.0000",0],"passed":true},{"actual":["0.0667",6666],"check":"control underdog edge","expected":["0.0667",6666],"passed":true},{"actual":["0.3337",2500],"check":"regression: cap order","expected":["0.3337",5000],"passed":false},{"actual":["0.2520",6299],"check":"regression: cap order","expected":["0.2520",6299],"passed":true},{"actual":["0.3633",1250],"check":"variant scenario 1","expected":["0.3633",2500],"passed":false},{"actual":["0.7115",2500],"check":"variant scenario 2","expected":["0.7115",10000],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control even-money edge\", \"actual\": [\"0.1000\", 10000], \"expected\": [\"0.1000\", 10000], \"passed\": true}, {\"check\": \"control half kelly\", \"actual\": [\"0.1000\", 5000], \"expected\": [\"0.1000\", 5000], \"passed\": true}, {\"check\": \"boundary capped stake\", \"actual\": [\"0.2000\", 5000], \"expected\": [\"0.2000\", 5000], \"passed\": true}, {\"check\": \"boundary no edge\", \"actual\": [\"0.0000\", 0], \"expected\": [\"0.0000\", 0], \"passed\": true}, {\"check\": \"control underdog edge\", \"actual\": [\"0.0667\", 6666], \"expected\": [\"0.0667\", 6666], \"passed\": true}, {\"check\": \"regression: cap order\", \"actual\": [\"0.3337\", 2500], \"expected\": [\"0.3337\", 5000], \"passed\": false}, {\"check\": \"regression: cap order\", \"actual\": [\"0.2520\", 6299], \"expected\": [\"0.2520\", 6299], \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": [\"0.3633\", 1250], \"expected\": [\"0.3633\", 2500], \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": [\"0.7115\", 2500], \"expected\": [\"0.7115\", 10000], \"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."}}