FA-61356 / Options payoff and settlement / Open access
Cash-settled expiry with exercise by exception: assigned short positions receive the settlement amount · case 01
Short holders are credited instead of debited on assignment.
ROOT CAUSE
The short-side adjustment takes the absolute value instead of negating.
VERIFIED REPAIR
Negate the settlement amount for short positions.
Unsuccessful approach: Using signed contracts in the amount and then negating flips shorts back to positive.
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 = abs(cash)
return [ex, cash / 100]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression short settlement sign 1', ['C', 150, 150.04, -10, 50, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['P', 25, 22.5, -10, 10, 0.05, 'dnx'], [True, -250.0]], ['partial repair probe 1', ['P', 100, 99.99, -4, 100, 0.01, 'dnx'], [True, -4.0]], ['partial repair probe 2', ['C', 101.5, 101.54, -4, 100, 0.01, 'auto'], [True, -16.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 100, 100.1, 1, 10, 0.01, 'auto'], [True, 1.0]], ['normal control 2', ['C', 101.5, 101.49, -4, 10, 0.02, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 101.54, -10, 100, 0.01, 'exercise'], [True, -40.0]], ['regression short settlement sign 2', ['C', 4500, 4500.02, -10, 10, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['P', 100, 97.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['partial repair probe 2', ['P', 150, 149.99, -4, 50, 0.01, 'dnx'], [True, -2.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 50.01, 3, 50, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 50.1, -1, 10, 0.02, 'exercise'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 102.87, -10, 100, 0.02, 'dnx'], [True, -1370.0]], ['regression short settlement sign 2', ['C', 100, 100.02, -1, 100, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['C', 25, 25.05, -4, 100, 0.02, 'auto'], [True, -20.0]], ['partial repair probe 2', ['C', 101.5, 101.52, -1, 50, 0.01, 'dnx'], [True, -1.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', 25, 25.1, -10, 100, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 100, 100.01, 3, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['P', 50, 49.95, -4, 100, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['C', 150, 150.1, -1, 100, 0.01, 'auto'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.04, -1, 50, 0.02, 'dnx'], [True, -2.0]], ['partial repair probe 2', ['C', 50, 50.02, -1, 100, 0.01, 'exercise'], [True, -2.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 100, 99.98, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 4500, 4500, 3, 100, 0.05, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 25, 37.25, -1, 100, 0.01, 'dnx'], [True, -1225.0]], ['regression short settlement sign 2', ['C', 25, 25.1, -1, 100, 0.02, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.05, -10, 100, 0.01, 'auto'], [True, -50.0]], ['partial repair probe 2', ['P', 50, 47.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 25, 24.95, 1, 10, 0.01, 'auto'], [False, 0.0]], ['normal control 2', ['P', 212.5, 224.75, -10, 50, 0.01, '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 short settlement sign 1 | [True, 20.0] | [True, -20.0] | Failed |
| regression short settlement sign 2 | [True, 250.0] | [True, -250.0] | Failed |
| partial repair probe 1 | [True, 4.0] | [True, -4.0] | Failed |
| partial repair probe 2 | [True, 16.0] | [True, -16.0] | Failed |
| boundary control 1 | [True, 1.0] | [True, 1.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / 5d8484de653ed32acd3457a1af44bd610734b875f654d28e81c465fb74598a6e
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 == 'dnx':
ex = False
else:
ex = auto
else:
ex = auto
cash = intrinsic * multiplier * 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 short settlement sign 1', ['C', 150, 150.04, -10, 50, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['P', 25, 22.5, -10, 10, 0.05, 'dnx'], [True, -250.0]], ['partial repair probe 1', ['P', 100, 99.99, -4, 100, 0.01, 'dnx'], [True, -4.0]], ['partial repair probe 2', ['C', 101.5, 101.54, -4, 100, 0.01, 'auto'], [True, -16.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 100, 100.1, 1, 10, 0.01, 'auto'], [True, 1.0]], ['normal control 2', ['C', 101.5, 101.49, -4, 10, 0.02, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 101.54, -10, 100, 0.01, 'exercise'], [True, -40.0]], ['regression short settlement sign 2', ['C', 4500, 4500.02, -10, 10, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['P', 100, 97.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['partial repair probe 2', ['P', 150, 149.99, -4, 50, 0.01, 'dnx'], [True, -2.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 50.01, 3, 50, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 50.1, -1, 10, 0.02, 'exercise'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 102.87, -10, 100, 0.02, 'dnx'], [True, -1370.0]], ['regression short settlement sign 2', ['C', 100, 100.02, -1, 100, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['C', 25, 25.05, -4, 100, 0.02, 'auto'], [True, -20.0]], ['partial repair probe 2', ['C', 101.5, 101.52, -1, 50, 0.01, 'dnx'], [True, -1.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', 25, 25.1, -10, 100, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 100, 100.01, 3, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['P', 50, 49.95, -4, 100, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['C', 150, 150.1, -1, 100, 0.01, 'auto'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.04, -1, 50, 0.02, 'dnx'], [True, -2.0]], ['partial repair probe 2', ['C', 50, 50.02, -1, 100, 0.01, 'exercise'], [True, -2.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 100, 99.98, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 4500, 4500, 3, 100, 0.05, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 25, 37.25, -1, 100, 0.01, 'dnx'], [True, -1225.0]], ['regression short settlement sign 2', ['C', 25, 25.1, -1, 100, 0.02, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.05, -10, 100, 0.01, 'auto'], [True, -50.0]], ['partial repair probe 2', ['P', 50, 47.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 25, 24.95, 1, 10, 0.01, 'auto'], [False, 0.0]], ['normal control 2', ['P', 212.5, 224.75, -10, 50, 0.01, '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 short settlement sign 1 | [True, 20.0] | [True, -20.0] | Failed |
| regression short settlement sign 2 | [True, 250.0] | [True, -250.0] | Failed |
| partial repair probe 1 | [True, 4.0] | [True, -4.0] | Failed |
| partial repair probe 2 | [True, 16.0] | [True, -16.0] | Failed |
| boundary control 1 | [True, 1.0] | [True, 1.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / d04036a7a412732b0fb7ba6410cb9522389f45de2a36031db27020b0d3819e0f
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 short settlement sign 1', ['C', 150, 150.04, -10, 50, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['P', 25, 22.5, -10, 10, 0.05, 'dnx'], [True, -250.0]], ['partial repair probe 1', ['P', 100, 99.99, -4, 100, 0.01, 'dnx'], [True, -4.0]], ['partial repair probe 2', ['C', 101.5, 101.54, -4, 100, 0.01, 'auto'], [True, -16.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 100, 100.1, 1, 10, 0.01, 'auto'], [True, 1.0]], ['normal control 2', ['C', 101.5, 101.49, -4, 10, 0.02, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 101.54, -10, 100, 0.01, 'exercise'], [True, -40.0]], ['regression short settlement sign 2', ['C', 4500, 4500.02, -10, 10, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['P', 100, 97.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['partial repair probe 2', ['P', 150, 149.99, -4, 50, 0.01, 'dnx'], [True, -2.0]], ['boundary control 1', ['C', 100, 99.0, 2, 100, 0.01, 'exercise'], [True, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 50, 50.01, 3, 50, 0.05, 'auto'], [False, 0.0]], ['normal control 2', ['P', 50, 50.1, -1, 10, 0.02, 'exercise'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 101.5, 102.87, -10, 100, 0.02, 'dnx'], [True, -1370.0]], ['regression short settlement sign 2', ['C', 100, 100.02, -1, 100, 0.01, 'auto'], [True, -2.0]], ['partial repair probe 1', ['C', 25, 25.05, -4, 100, 0.02, 'auto'], [True, -20.0]], ['partial repair probe 2', ['C', 101.5, 101.52, -1, 50, 0.01, 'dnx'], [True, -1.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', 25, 25.1, -10, 100, 0.02, 'dnx'], [False, 0.0]], ['normal control 2', ['P', 100, 100.01, 3, 50, 0.01, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['P', 50, 49.95, -4, 100, 0.01, 'dnx'], [True, -20.0]], ['regression short settlement sign 2', ['C', 150, 150.1, -1, 100, 0.01, 'auto'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.04, -1, 50, 0.02, 'dnx'], [True, -2.0]], ['partial repair probe 2', ['C', 50, 50.02, -1, 100, 0.01, 'exercise'], [True, -2.0]], ['boundary control 1', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['boundary control 2', ['P', 100, 100, 1, 100, 0.01, 'auto'], [False, 0.0]], ['normal control 1', ['C', 100, 99.98, 1, 100, 0.02, 'auto'], [False, 0.0]], ['normal control 2', ['C', 4500, 4500, 3, 100, 0.05, 'dnx'], [False, 0.0]]], [['regression short settlement sign 1', ['C', 25, 37.25, -1, 100, 0.01, 'dnx'], [True, -1225.0]], ['regression short settlement sign 2', ['C', 25, 25.1, -1, 100, 0.02, 'dnx'], [True, -10.0]], ['partial repair probe 1', ['C', 25, 25.05, -10, 100, 0.01, 'auto'], [True, -50.0]], ['partial repair probe 2', ['P', 50, 47.5, -10, 100, 0.01, 'auto'], [True, -2500.0]], ['boundary control 1', ['C', 100, 100.01, 1, 100, 0.01, 'auto'], [True, 1.0]], ['boundary control 2', ['C', 100, 105, 1, 100, 0.01, 'dnx'], [False, 0.0]], ['normal control 1', ['C', 25, 24.95, 1, 10, 0.01, 'auto'], [False, 0.0]], ['normal control 2', ['P', 212.5, 224.75, -10, 50, 0.01, '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 short settlement sign 1 | [True, -20.0] | [True, -20.0] | Passed |
| regression short settlement sign 2 | [True, -250.0] | [True, -250.0] | Passed |
| partial repair probe 1 | [True, -4.0] | [True, -4.0] | Passed |
| partial repair probe 2 | [True, -16.0] | [True, -16.0] | Passed |
| boundary control 1 | [True, 1.0] | [True, 1.0] | Passed |
| boundary control 2 | [False, 0.0] | [False, 0.0] | Passed |
| normal control 1 | [True, 1.0] | [True, 1.0] | Passed |
| normal control 2 | [False, 0.0] | [False, 0.0] | Passed |
SHA-256 / 20d613f82548eb55716f46d37d5ef659a4ea946630d43499ee871c11075aaf36
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.457059+00:00.
Case digest / 7b6b5fee3103a287465c231fd3ae93f83651d8f859a2e64f3047c1bcb52e1a67