FA-61341 / Options payoff and settlement / Open access
Cash-settled expiry with exercise by exception: an option exactly at the minimum in-the-money amount is abandoned · case 01
Positions in the money by exactly the threshold expire worthless.
ROOT CAUSE
The automatic rule compares intrinsic > threshold instead of >=.
VERIFIED REPAIR
Exercise automatically when intrinsic is at least the threshold.
Unsuccessful approach: Lowering the threshold by a cent exercises options one cent short of it.
Case contract
Inputs kind C/P, strike, settlement price, signed contracts (+long, -short), multiplier, a minimum in-the-money amount and a long-holder instruction (auto, exercise, dnx). Work in integer cents. Intrinsic is max(0, S-K) for calls, max(0, K-S) for puts. The automatic rule exercises when intrinsic >= threshold. Longs follow their instruction (exercise always exercises, dnx never, auto uses the rule); shorts are assigned by the automatic rule. Cash = intrinsic*multiplier*|contracts| if exercised, negative for shorts. Return [exercised, cash in currency units].
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(kind, strike, settle, contracts, multiplier, min_itm, instruction):
k = round(strike * 100)
s = round(settle * 100)
thr = round(min_itm * 100)
intrinsic = max(0, s - k) if kind == 'C' else max(0, k - s)
auto = intrinsic > thr
if contracts > 0:
if instruction == 'exercise':
ex = True
elif instruction == 'dnx':
ex = False
else:
ex = auto
else:
ex = auto
cash = intrinsic * multiplier * abs(contracts) if ex else 0
if contracts < 0:
cash = -cash
return [ex, cash / 100]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression automatic exercise threshold 1', ['C', 101.5, 101.52, -10, 10, 0.02, 'exercise'], [True, -2.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -10, 100, 0.01, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['P', 50, 51.37, 1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25.05, -4, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 150, 149.95, -10, 100, 0.02, 'exercise'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 1, 100, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 50, 49.99, -4, 100, 0.01, 'auto'], [True, -4.0]], ['regression automatic exercise threshold 2', ['C', 100, 100.05, 3, 100, 0.05, 'auto'], [True, 15.0]], ['partial repair probe 1', ['C', 101.5, 101.49, -10, 10, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 4500, 4500, -4, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['P', 100, 99.95, 1, 50, 0.05, 'exercise'], [True, 2.5]], ['normal control 2', ['C', 150, 149.99, -4, 10, 0.02, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 100, 99.99, -1, 50, 0.01, 'dnx'], [True, -0.5]], ['regression automatic exercise threshold 2', ['C', 4500, 4500.01, -4, 100, 0.01, 'exercise'], [True, -4.0]], ['partial repair probe 1', ['P', 101.5, 113.75, -10, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 50, 50.02, -1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 25, 24.98, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 2', ['C', 101.5, 101.6, -10, 100, 0.05, 'dnx'], [True, -100.0]]], [['regression automatic exercise threshold 1', ['C', 100, 100.02, -1, 50, 0.02, 'auto'], [True, -1.0]], ['regression automatic exercise threshold 2', ['C', 150, 150.05, -10, 100, 0.05, 'exercise'], [True, -50.0]], ['partial repair probe 1', ['P', 50, 62.25, -1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 50, 49.99, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['P', 212.5, 212.55, 10, 50, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 4500, 4500.04, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 101.5, 101.48, -10, 100, 0.02, 'auto'], [True, -20.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -1, 100, 0.01, 'dnx'], [True, -1.0]], ['partial repair probe 1', ['P', 101.5, 102.87, -1, 100, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25, 1, 10, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 212.5, 212.48, -4, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 101.5, 101.5, -1, 100, 0.02, 'exercise'], [False, 0.0]]]]
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 automatic exercise threshold 1 | [False, 0.0] | [True, -2.0] | Failed |
| regression automatic exercise threshold 2 | [False, 0.0] | [True, -10.0] | Failed |
| partial repair probe 1 | [False, 0.0] | [False, 0.0] | Passed |
| partial repair probe 2 | [False, 0.0] | [False, 0.0] | Passed |
| boundary control 1 | [True, 0.0] | [True, 0.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / 6019a8728ea19ed3402be99f4d9a307f7583201ab4c675c4814aed94b4299635
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(kind, strike, settle, contracts, multiplier, min_itm, instruction):
k = round(strike * 100)
s = round(settle * 100)
thr = round(min_itm * 100)
intrinsic = max(0, s - k) if kind == 'C' else max(0, k - s)
auto = intrinsic >= thr - 1
if contracts > 0:
if instruction == 'exercise':
ex = True
elif instruction == 'dnx':
ex = False
else:
ex = auto
else:
ex = auto
cash = intrinsic * multiplier * abs(contracts) if ex else 0
if contracts < 0:
cash = -cash
return [ex, cash / 100]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression automatic exercise threshold 1', ['C', 101.5, 101.52, -10, 10, 0.02, 'exercise'], [True, -2.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -10, 100, 0.01, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['P', 50, 51.37, 1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25.05, -4, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 150, 149.95, -10, 100, 0.02, 'exercise'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 1, 100, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 50, 49.99, -4, 100, 0.01, 'auto'], [True, -4.0]], ['regression automatic exercise threshold 2', ['C', 100, 100.05, 3, 100, 0.05, 'auto'], [True, 15.0]], ['partial repair probe 1', ['C', 101.5, 101.49, -10, 10, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 4500, 4500, -4, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['P', 100, 99.95, 1, 50, 0.05, 'exercise'], [True, 2.5]], ['normal control 2', ['C', 150, 149.99, -4, 10, 0.02, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 100, 99.99, -1, 50, 0.01, 'dnx'], [True, -0.5]], ['regression automatic exercise threshold 2', ['C', 4500, 4500.01, -4, 100, 0.01, 'exercise'], [True, -4.0]], ['partial repair probe 1', ['P', 101.5, 113.75, -10, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 50, 50.02, -1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 25, 24.98, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 2', ['C', 101.5, 101.6, -10, 100, 0.05, 'dnx'], [True, -100.0]]], [['regression automatic exercise threshold 1', ['C', 100, 100.02, -1, 50, 0.02, 'auto'], [True, -1.0]], ['regression automatic exercise threshold 2', ['C', 150, 150.05, -10, 100, 0.05, 'exercise'], [True, -50.0]], ['partial repair probe 1', ['P', 50, 62.25, -1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 50, 49.99, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['P', 212.5, 212.55, 10, 50, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 4500, 4500.04, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 101.5, 101.48, -10, 100, 0.02, 'auto'], [True, -20.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -1, 100, 0.01, 'dnx'], [True, -1.0]], ['partial repair probe 1', ['P', 101.5, 102.87, -1, 100, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25, 1, 10, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 212.5, 212.48, -4, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 101.5, 101.5, -1, 100, 0.02, 'exercise'], [False, 0.0]]]]
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 automatic exercise threshold 1 | [True, -2.0] | [True, -2.0] | Passed |
| regression automatic exercise threshold 2 | [True, -10.0] | [True, -10.0] | Passed |
| partial repair probe 1 | [True, 0.0] | [False, 0.0] | Failed |
| partial repair probe 2 | [True, 0.0] | [False, 0.0] | Failed |
| boundary control 1 | [True, 0.0] | [True, 0.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / 60592ab247721df2356da7edf2e9b24f8bda8e52ef4bade75460bf2fe48c973a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(kind, strike, settle, contracts, multiplier, min_itm, instruction):
k = round(strike * 100)
s = round(settle * 100)
thr = round(min_itm * 100)
intrinsic = max(0, s - k) if kind == 'C' else max(0, k - s)
auto = intrinsic >= thr
if contracts > 0:
if instruction == 'exercise':
ex = True
elif instruction == 'dnx':
ex = False
else:
ex = auto
else:
ex = auto
cash = intrinsic * multiplier * abs(contracts) if ex else 0
if contracts < 0:
cash = -cash
return [ex, cash / 100]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression automatic exercise threshold 1', ['C', 101.5, 101.52, -10, 10, 0.02, 'exercise'], [True, -2.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -10, 100, 0.01, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['P', 50, 51.37, 1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25.05, -4, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 150, 149.95, -10, 100, 0.02, 'exercise'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 1, 100, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 50, 49.99, -4, 100, 0.01, 'auto'], [True, -4.0]], ['regression automatic exercise threshold 2', ['C', 100, 100.05, 3, 100, 0.05, 'auto'], [True, 15.0]], ['partial repair probe 1', ['C', 101.5, 101.49, -10, 10, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 4500, 4500, -4, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['P', 100, 99.95, 1, 50, 0.05, 'exercise'], [True, 2.5]], ['normal control 2', ['C', 150, 149.99, -4, 10, 0.02, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 100, 99.99, -1, 50, 0.01, 'dnx'], [True, -0.5]], ['regression automatic exercise threshold 2', ['C', 4500, 4500.01, -4, 100, 0.01, 'exercise'], [True, -4.0]], ['partial repair probe 1', ['P', 101.5, 113.75, -10, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 50, 50.02, -1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 25, 24.98, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 2', ['C', 101.5, 101.6, -10, 100, 0.05, 'dnx'], [True, -100.0]]], [['regression automatic exercise threshold 1', ['C', 100, 100.02, -1, 50, 0.02, 'auto'], [True, -1.0]], ['regression automatic exercise threshold 2', ['C', 150, 150.05, -10, 100, 0.05, 'exercise'], [True, -50.0]], ['partial repair probe 1', ['P', 50, 62.25, -1, 50, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['C', 50, 49.99, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['P', 212.5, 212.55, 10, 50, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 4500, 4500.04, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression automatic exercise threshold 1', ['P', 101.5, 101.48, -10, 100, 0.02, 'auto'], [True, -20.0]], ['regression automatic exercise threshold 2', ['C', 101.5, 101.51, -1, 100, 0.01, 'dnx'], [True, -1.0]], ['partial repair probe 1', ['P', 101.5, 102.87, -1, 100, 0.01, 'auto'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 25, 1, 10, 0.01, 'auto'], [False, 0.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 212.5, 212.48, -4, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 101.5, 101.5, -1, 100, 0.02, 'exercise'], [False, 0.0]]]]
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 automatic exercise threshold 1 | [True, -2.0] | [True, -2.0] | Passed |
| regression automatic exercise threshold 2 | [True, -10.0] | [True, -10.0] | Passed |
| partial repair probe 1 | [False, 0.0] | [False, 0.0] | Passed |
| partial repair probe 2 | [False, 0.0] | [False, 0.0] | Passed |
| boundary control 1 | [True, 0.0] | [True, 0.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / d74baa5dc7de24e7367d024b66d412facb0c06c14b09cfa9bd443be81558016f
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:54.336735+00:00.
Case digest / a98f546e6f0cddff60abf0036fd21ce75d54fa04e175a6b90a2c3258de6c6a6e