{"abstract":"A back order is snapped to a better price than requested.","category":"Betting odds conversion","checks":9,"contract":"Snap a requested price onto an exchange tick ladder. Bands in hundredths [lo, hi, step]: [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]. Prices outside 1.01..1000 return \"invalid\". A back request rounds down to a valid tick and a lay request rounds up (ticks counted from the band lower bound). Return the tick as \"%d.%02d\".","contract_signature":"price, side","evaluation_group":"w2-odds-conversion-exchange-tick-rounding","failed_approach":"Rounding both sides to the nearest tick can still move a back price up.","family":"w2-odds-conversion-exchange-tick-rounding-rounding-direction","id":"FA-84596","implementations":{"attempt":{"sha256":"60e90475065543d89a3aa2ea19e406bfbd06265f38dee3e180fae00e3d4893db","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(price, side):\n    BANDS = [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]\n    c = Fraction(price) * 100\n    if c < 101 or c > 100000:\n        return 'invalid'\n    for lo, hi, step in BANDS:\n        if lo <= c < hi:\n            k = (c - lo) / step\n            k = round(k)\n            v = lo + k * step\n            break\n    return '%d.%02d' % (v // 100, v % 100)\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 on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('11.88', 'back'), '11.50'),\n  ('variant scenario 1', ('1.94', 'lay'), '1.94'),\n  ('variant scenario 2', ('1.00', 'back'), 'invalid')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('484.08', 'lay'), '490.00'),\n  ('variant scenario 1', ('1.25', 'lay'), '1.25'),\n  ('variant scenario 2', ('21.34', 'lay'), '22.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('3.14', 'back'), '3.10'),\n  ('variant scenario 1', ('21.44', 'lay'), '22.00'),\n  ('variant scenario 2', ('853.33', 'back'), '850.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('2.27', 'back'), '2.26'),\n  ('variant scenario 1', ('1.94', 'lay'), '1.94'),\n  ('variant scenario 2', ('248.87', 'back'), '240.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('3.52', 'back'), '3.50'),\n  ('regression: rounding direction', ('221.87', 'lay'), '230.00'),\n  ('variant scenario 1', ('785.23', 'lay'), '790.00'),\n  ('variant scenario 2', ('1.67', 'lay'), '1.67')]]\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":"54bd82e0750fa1b4214c81a25f6343fd83a1b3dbca7a4aa5b2f3b8b47f8a00e2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(price, side):\n    BANDS = [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]\n    c = Fraction(price) * 100\n    if c < 101 or c > 100000:\n        return 'invalid'\n    for lo, hi, step in BANDS:\n        if lo <= c < hi:\n            k = (c - lo) / step\n            k = math.ceil(k) if side == 'back' else math.floor(k)\n            v = lo + k * step\n            break\n    return '%d.%02d' % (v // 100, v % 100)\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 on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('11.88', 'back'), '11.50'),\n  ('variant scenario 1', ('1.94', 'lay'), '1.94'),\n  ('variant scenario 2', ('1.00', 'back'), 'invalid')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('484.08', 'lay'), '490.00'),\n  ('variant scenario 1', ('1.25', 'lay'), '1.25'),\n  ('variant scenario 2', ('21.34', 'lay'), '22.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('3.14', 'back'), '3.10'),\n  ('variant scenario 1', ('21.44', 'lay'), '22.00'),\n  ('variant scenario 2', ('853.33', 'back'), '850.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('2.27', 'back'), '2.26'),\n  ('variant scenario 1', ('1.94', 'lay'), '1.94'),\n  ('variant scenario 2', ('248.87', 'back'), '240.00')],\n [('control on-tick price', ('2.50', 'back'), '2.50'),\n  ('boundary back rounds down', ('3.03', 'back'), '3.00'),\n  ('boundary lay rounds up', ('3.03', 'lay'), '3.05'),\n  ('boundary lay rounds into next band', ('1.995', 'lay'), '2.00'),\n  ('boundary below ladder', ('1.00', 'back'), 'invalid'),\n  ('control top of ladder', ('1000', 'lay'), '1000.00'),\n  ('regression: rounding direction', ('3.52', 'back'), '3.50'),\n  ('regression: rounding direction', ('221.87', 'lay'), '230.00'),\n  ('variant scenario 1', ('785.23', 'lay'), '790.00'),\n  ('variant scenario 2', ('1.67', 'lay'), '1.67')]]\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-tick-rounding-rounding-direction","generated_at":"2026-09-29T14:50:32.462962+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exchange order entry must snap arbitrary prices to valid ticks in the customer-safe direction.","root_cause":"The rounding directions for back and lay are swapped.","sha256":"06363528442d5d490374954fd4379bbad190b8bd2e7af5825ce311083019fde6","title":"Back and lay requests rounded the wrong way · 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.033,"exit_code":1,"observations":[{"actual":"2.50","check":"control on-tick price","expected":"2.50","passed":true},{"actual":"3.05","check":"boundary back rounds down","expected":"3.00","passed":false},{"actual":"3.05","check":"boundary lay rounds up","expected":"3.05","passed":true},{"actual":"1.99","check":"boundary lay rounds into next band","expected":"2.00","passed":false},{"actual":"invalid","check":"boundary below ladder","expected":"invalid","passed":true},{"actual":"1000.00","check":"control top of ladder","expected":"1000.00","passed":true},{"actual":"12.00","check":"regression: rounding direction","expected":"11.50","passed":false},{"actual":"1.94","check":"variant scenario 1","expected":"1.94","passed":true},{"actual":"invalid","check":"variant scenario 2","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control on-tick price\", \"actual\": \"2.50\", \"expected\": \"2.50\", \"passed\": true}, {\"check\": \"boundary back rounds down\", \"actual\": \"3.05\", \"expected\": \"3.00\", \"passed\": false}, {\"check\": \"boundary lay rounds up\", \"actual\": \"3.05\", \"expected\": \"3.05\", \"passed\": true}, {\"check\": \"boundary lay rounds into next band\", \"actual\": \"1.99\", \"expected\": \"2.00\", \"passed\": false}, {\"check\": \"boundary below ladder\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control top of ladder\", \"actual\": \"1000.00\", \"expected\": \"1000.00\", \"passed\": true}, {\"check\": \"regression: rounding direction\", \"actual\": \"12.00\", \"expected\": \"11.50\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"1.94\", \"expected\": \"1.94\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.772,"exit_code":1,"observations":[{"actual":"2.50","check":"control on-tick price","expected":"2.50","passed":true},{"actual":"3.05","check":"boundary back rounds down","expected":"3.00","passed":false},{"actual":"3.00","check":"boundary lay rounds up","expected":"3.05","passed":false},{"actual":"1.99","check":"boundary lay rounds into next band","expected":"2.00","passed":false},{"actual":"invalid","check":"boundary below ladder","expected":"invalid","passed":true},{"actual":"1000.00","check":"control top of ladder","expected":"1000.00","passed":true},{"actual":"12.00","check":"regression: rounding direction","expected":"11.50","passed":false},{"actual":"1.94","check":"variant scenario 1","expected":"1.94","passed":true},{"actual":"invalid","check":"variant scenario 2","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control on-tick price\", \"actual\": \"2.50\", \"expected\": \"2.50\", \"passed\": true}, {\"check\": \"boundary back rounds down\", \"actual\": \"3.05\", \"expected\": \"3.00\", \"passed\": false}, {\"check\": \"boundary lay rounds up\", \"actual\": \"3.00\", \"expected\": \"3.05\", \"passed\": false}, {\"check\": \"boundary lay rounds into next band\", \"actual\": \"1.99\", \"expected\": \"2.00\", \"passed\": false}, {\"check\": \"boundary below ladder\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control top of ladder\", \"actual\": \"1000.00\", \"expected\": \"1000.00\", \"passed\": true}, {\"check\": \"regression: rounding direction\", \"actual\": \"12.00\", \"expected\": \"11.50\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"1.94\", \"expected\": \"1.94\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"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."}}