FA-61351 / Options payoff and settlement / Open access
Cash-settled expiry with exercise by exception: do-not-exercise instructions are never recognized · case 01
Holders who instructed not to exercise are exercised automatically.
ROOT CAUSE
The instruction is compared against an upper-case code while instructions arrive lower case.
VERIFIED REPAIR
Compare against the contract code dnx exactly as supplied.
Unsuccessful approach: Upper-casing the input but comparing with the lower-case code still never matches.
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 contrary instruction match 1', ['C', 50, 51.37, 1, 50, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['P', 100, 97.5, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 101.5, 113.75, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 10, 100, 0.05, 'dnx'], [False, 0.0]], ['boundary control 1', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 2', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['normal control 1', ['P', 50, 50.05, 3, 100, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 51.37, 3, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 4500, 4500.02, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 10, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 24.99, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 4500, 4500, -10, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 100, 101.37, -10, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 25, 37.25, 10, 10, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.02, 1, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 150, 150.1, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 100, 101.37, 1, 100, 0.02, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 49.99, -1, 10, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 10, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 100, 100.04, 10, 100, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 100.1, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 1, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 101.5, 101.49, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 150, 150.1, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['P', 4500, 4499.98, 3, 100, 0.02, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.1, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['P', 50, 47.5, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 150, 150.04, 10, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 101.5, 99.0, -4, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['C', 150, 150.02, 3, 10, 0.05, 'auto'], [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 contrary instruction match 1 | [True, 68.5] | [False, 0.0] | Failed |
| regression contrary instruction match 2 | [True, 2500.0] | [False, 0.0] | Failed |
| partial repair probe 1 | [True, 612.5] | [False, 0.0] | Failed |
| partial repair probe 2 | [True, 2500.0] | [False, 0.0] | Failed |
| boundary control 1 | [False, 0.0] | [False, 0.0] | Passed |
| boundary control 2 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / d7108877ffe5cedc47e16d471f4b30f8bdec83452873db5a587f56800c37ddfb
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
if contracts > 0:
if instruction == 'exercise':
ex = True
elif instruction.upper() == '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 contrary instruction match 1', ['C', 50, 51.37, 1, 50, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['P', 100, 97.5, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 101.5, 113.75, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 10, 100, 0.05, 'dnx'], [False, 0.0]], ['boundary control 1', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 2', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['normal control 1', ['P', 50, 50.05, 3, 100, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 51.37, 3, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 4500, 4500.02, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 10, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 24.99, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 4500, 4500, -10, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 100, 101.37, -10, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 25, 37.25, 10, 10, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.02, 1, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 150, 150.1, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 100, 101.37, 1, 100, 0.02, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 49.99, -1, 10, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 10, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 100, 100.04, 10, 100, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 100.1, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 1, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 101.5, 101.49, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 150, 150.1, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['P', 4500, 4499.98, 3, 100, 0.02, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.1, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['P', 50, 47.5, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 150, 150.04, 10, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 101.5, 99.0, -4, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['C', 150, 150.02, 3, 10, 0.05, 'auto'], [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 contrary instruction match 1 | [True, 68.5] | [False, 0.0] | Failed |
| regression contrary instruction match 2 | [True, 2500.0] | [False, 0.0] | Failed |
| partial repair probe 1 | [True, 612.5] | [False, 0.0] | Failed |
| partial repair probe 2 | [True, 2500.0] | [False, 0.0] | Failed |
| boundary control 1 | [False, 0.0] | [False, 0.0] | Passed |
| boundary control 2 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / 9befdab8cf1dbf1c67e1327024b766c434a124d4544813f67970b7f01ab91824
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 contrary instruction match 1', ['C', 50, 51.37, 1, 50, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['P', 100, 97.5, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 101.5, 113.75, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 10, 100, 0.05, 'dnx'], [False, 0.0]], ['boundary control 1', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['boundary control 2', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['normal control 1', ['P', 50, 50.05, 3, 100, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 51.37, 3, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 4500, 4500.02, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 10, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 25, 24.99, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 4500, 4500, -10, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 100, 101.37, -10, 100, 0.01, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 25, 37.25, 10, 10, 0.05, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.02, 1, 10, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 150, 150.1, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 100, 101.37, 1, 100, 0.02, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 49.99, -1, 10, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 25, 24.95, 10, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression contrary instruction match 1', ['C', 100, 100.04, 10, 100, 0.01, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 100, 100.1, 3, 100, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['C', 212.5, 212.54, 1, 10, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['P', 4500, 4497.5, 3, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 101.5, 101.49, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['P', 150, 150.1, -10, 10, 0.05, 'auto'], [False, 0.0]]], [['regression contrary instruction match 1', ['P', 4500, 4499.98, 3, 100, 0.02, 'dnx'], [False, 0.0]], ['regression contrary instruction match 2', ['C', 50, 50.1, 10, 100, 0.02, 'dnx'], [False, 0.0]], ['partial repair probe 1', ['P', 50, 47.5, 1, 50, 0.01, 'dnx'], [False, 0.0]], ['partial repair probe 2', ['C', 150, 150.04, 10, 10, 0.01, 'dnx'], [False, 0.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['normal control 1', ['C', 101.5, 99.0, -4, 10, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['C', 150, 150.02, 3, 10, 0.05, 'auto'], [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 contrary instruction match 1 | [False, 0.0] | [False, 0.0] | Passed |
| regression contrary instruction match 2 | [False, 0.0] | [False, 0.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 | [False, 0.0] | [False, 0.0] | Passed |
| boundary control 2 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 1 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / c7b66a8c8f44c62539b251215784091c5aad630320fb51f11b2751a0c078d2da
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.414792+00:00.
Case digest / a8b7c3b95ab67dc8cf0dc560a98a90044831f6450e0f894a0d69628c0a2c5487