FA-61826 / Options payoff and settlement / Open access
Option order price tick rounding: buy orders round up and sell orders round down · case 01
Orders become more aggressive than the trader's limit.
ROOT CAUSE
The floor and ceiling branches are swapped.
VERIFIED REPAIR
Buys round down and sells round up.
Unsuccessful approach: Rounding both sides to the nearest tick can still cross the limit.
Case contract
Inputs a limit price (up to 3 decimals), side and penny-program flag. Work in mills. Below 3.000 the tick is 0.01 for penny classes and 0.05 otherwise; at or above 3.000 it is 0.05 for penny classes and 0.10 otherwise. Buy orders round down to a tick, sell orders round up; prices already on a tick are unchanged. Return the price as a float.
Why this case matters
Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(price, side, penny):
m = round(price * 1000)
small = m < 3000
tick = (10 if penny else 50) if small else (50 if penny else 100)
if side == 'buy':
out = -(-m // tick) * tick
else:
out = m // tick * tick
return out / 1000
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression side rounding direction 1', [12.344, 'sell', True], 12.35], ['regression side rounding direction 2', [4.105, 'buy', True], 4.1], ['partial repair probe 1', [0.53, 'buy', False], 0.5], ['partial repair probe 2', [0.512, 'sell', True], 0.52], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [0.55, 'buy', False], 0.55], ['normal control 2', [3.1, 'sell', False], 3.1]], [['regression side rounding direction 1', [3.06, 'buy', False], 3.0], ['regression side rounding direction 2', [12.345, 'buy', False], 12.3], ['partial repair probe 1', [2.975, 'buy', False], 2.95], ['partial repair probe 2', [2.951, 'sell', False], 3.0], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [4.1, 'sell', True], 4.1]], [['regression side rounding direction 1', [3.015, 'buy', True], 3.0], ['regression side rounding direction 2', [3.095, 'buy', True], 3.05], ['partial repair probe 1', [4.112, 'sell', True], 4.15], ['partial repair probe 2', [2.999, 'buy', True], 2.99], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [0.5, 'buy', True], 0.5], ['normal control 2', [1.26, 'buy', True], 1.26]], [['regression side rounding direction 1', [3.074, 'sell', False], 3.1], ['regression side rounding direction 2', [3.012, 'sell', True], 3.05], ['partial repair probe 1', [12.341, 'sell', False], 12.4], ['partial repair probe 2', [0.501, 'sell', False], 0.55], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [2.95, 'sell', True], 2.95], ['normal control 2', [3.1, 'buy', True], 3.1]], [['regression side rounding direction 1', [3.04, 'sell', False], 3.1], ['regression side rounding direction 2', [3.015, 'buy', False], 3.0], ['partial repair probe 1', [3.075, 'buy', True], 3.05], ['partial repair probe 2', [3.14, 'sell', False], 3.2], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [0.5, 'buy', True], 0.5]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression side rounding direction 1 | 12.3 | 12.35 | Failed |
| regression side rounding direction 2 | 4.15 | 4.1 | Failed |
| partial repair probe 1 | 0.55 | 0.5 | Failed |
| partial repair probe 2 | 0.51 | 0.52 | Failed |
| boundary control 1 | 3.0 | 3.0 | Passed |
| boundary control 2 | 2.95 | 2.95 | Passed |
| normal control 1 | 0.55 | 0.55 | Passed |
| normal control 2 | 3.1 | 3.1 | Passed |
SHA-256 / d5d7d993b6c8997da60bc9b6a233cd7894ac3ab9b51d7b68bf287194d32242d0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(price, side, penny):
m = round(price * 1000)
small = m < 3000
tick = (10 if penny else 50) if small else (50 if penny else 100)
out = (m + tick // 2) // tick * tick
return out / 1000
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression side rounding direction 1', [12.344, 'sell', True], 12.35], ['regression side rounding direction 2', [4.105, 'buy', True], 4.1], ['partial repair probe 1', [0.53, 'buy', False], 0.5], ['partial repair probe 2', [0.512, 'sell', True], 0.52], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [0.55, 'buy', False], 0.55], ['normal control 2', [3.1, 'sell', False], 3.1]], [['regression side rounding direction 1', [3.06, 'buy', False], 3.0], ['regression side rounding direction 2', [12.345, 'buy', False], 12.3], ['partial repair probe 1', [2.975, 'buy', False], 2.95], ['partial repair probe 2', [2.951, 'sell', False], 3.0], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [4.1, 'sell', True], 4.1]], [['regression side rounding direction 1', [3.015, 'buy', True], 3.0], ['regression side rounding direction 2', [3.095, 'buy', True], 3.05], ['partial repair probe 1', [4.112, 'sell', True], 4.15], ['partial repair probe 2', [2.999, 'buy', True], 2.99], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [0.5, 'buy', True], 0.5], ['normal control 2', [1.26, 'buy', True], 1.26]], [['regression side rounding direction 1', [3.074, 'sell', False], 3.1], ['regression side rounding direction 2', [3.012, 'sell', True], 3.05], ['partial repair probe 1', [12.341, 'sell', False], 12.4], ['partial repair probe 2', [0.501, 'sell', False], 0.55], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [2.95, 'sell', True], 2.95], ['normal control 2', [3.1, 'buy', True], 3.1]], [['regression side rounding direction 1', [3.04, 'sell', False], 3.1], ['regression side rounding direction 2', [3.015, 'buy', False], 3.0], ['partial repair probe 1', [3.075, 'buy', True], 3.05], ['partial repair probe 2', [3.14, 'sell', False], 3.2], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [0.5, 'buy', True], 0.5]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression side rounding direction 1 | 12.35 | 12.35 | Passed |
| regression side rounding direction 2 | 4.1 | 4.1 | Passed |
| partial repair probe 1 | 0.55 | 0.5 | Failed |
| partial repair probe 2 | 0.51 | 0.52 | Failed |
| boundary control 1 | 3.0 | 3.0 | Passed |
| boundary control 2 | 2.95 | 2.95 | Passed |
| normal control 1 | 0.55 | 0.55 | Passed |
| normal control 2 | 3.1 | 3.1 | Passed |
SHA-256 / cba15f2af4231d985f8855c7317dd0086ecfbb44ac26866392a5959fda96b213
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(price, side, penny):
m = round(price * 1000)
small = m < 3000
tick = (10 if penny else 50) if small else (50 if penny else 100)
if side == 'buy':
out = m // tick * tick
else:
out = -(-m // tick) * tick
return out / 1000
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression side rounding direction 1', [12.344, 'sell', True], 12.35], ['regression side rounding direction 2', [4.105, 'buy', True], 4.1], ['partial repair probe 1', [0.53, 'buy', False], 0.5], ['partial repair probe 2', [0.512, 'sell', True], 0.52], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [0.55, 'buy', False], 0.55], ['normal control 2', [3.1, 'sell', False], 3.1]], [['regression side rounding direction 1', [3.06, 'buy', False], 3.0], ['regression side rounding direction 2', [12.345, 'buy', False], 12.3], ['partial repair probe 1', [2.975, 'buy', False], 2.95], ['partial repair probe 2', [2.951, 'sell', False], 3.0], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [4.1, 'sell', True], 4.1]], [['regression side rounding direction 1', [3.015, 'buy', True], 3.0], ['regression side rounding direction 2', [3.095, 'buy', True], 3.05], ['partial repair probe 1', [4.112, 'sell', True], 4.15], ['partial repair probe 2', [2.999, 'buy', True], 2.99], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [0.5, 'buy', True], 0.5], ['normal control 2', [1.26, 'buy', True], 1.26]], [['regression side rounding direction 1', [3.074, 'sell', False], 3.1], ['regression side rounding direction 2', [3.012, 'sell', True], 3.05], ['partial repair probe 1', [12.341, 'sell', False], 12.4], ['partial repair probe 2', [0.501, 'sell', False], 0.55], ['boundary control 1', [3.0, 'buy', False], 3.0], ['boundary control 2', [2.95, 'sell', False], 2.95], ['normal control 1', [2.95, 'sell', True], 2.95], ['normal control 2', [3.1, 'buy', True], 3.1]], [['regression side rounding direction 1', [3.04, 'sell', False], 3.1], ['regression side rounding direction 2', [3.015, 'buy', False], 3.0], ['partial repair probe 1', [3.075, 'buy', True], 3.05], ['partial repair probe 2', [3.14, 'sell', False], 3.2], ['boundary control 1', [2.95, 'sell', False], 2.95], ['boundary control 2', [3.0, 'buy', False], 3.0], ['normal control 1', [3.1, 'sell', False], 3.1], ['normal control 2', [0.5, 'buy', True], 0.5]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression side rounding direction 1 | 12.35 | 12.35 | Passed |
| regression side rounding direction 2 | 4.1 | 4.1 | Passed |
| partial repair probe 1 | 0.5 | 0.5 | Passed |
| partial repair probe 2 | 0.52 | 0.52 | Passed |
| boundary control 1 | 3.0 | 3.0 | Passed |
| boundary control 2 | 2.95 | 2.95 | Passed |
| normal control 1 | 0.55 | 0.55 | Passed |
| normal control 2 | 3.1 | 3.1 | Passed |
SHA-256 / f1babc67ac52cccf78a415638d501af2d234aaf997950682e1847f13f9671c9f
Verification & scope
A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any exchange or clearing rulebook. 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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:46:58.826847+00:00.
Case digest / 729e7c5720add0be12dbd4264268bdc08eee28fe364773122897b5fe7a51bb47