FAILURE MAP
← Case archive

FA-61376 / Options payoff and settlement / Open access

Physical delivery on exercise and assignment: cash moves in the same direction as shares · case 01

Buyers of shares are credited the strike price.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The cash leg uses +direction instead of -direction.

VERIFIED REPAIR

Cash flows opposite to the share movement.

Unsuccessful approach: Always debiting the strike amount ignores parties that deliver shares.

Case contract

Inputs kind C/P, strike, signed contracts (+long exercised, -short assigned), deliverable shares per contract and whether exercise happened. Long calls and short puts receive shares and pay strike*shares; long puts and short calls deliver shares and receive strike*shares. Return [share delta, cash delta] (cash in currency, computed in cents); unexercised returns [0, 0.0].

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, contracts, deliverable, exercised):
    if not exercised:
        return [0, 0.0]
    n = abs(contracts) * deliverable
    k = round(strike * 100)
    direction = 1 if kind == 'C' else -1
    if contracts < 0:
        direction = -direction
    shares = direction * n
    cash = direction * n * k
    return [shares, cash / 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression cash leg sign 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['regression cash leg sign 2', ['C', 10, 5, 150, True], [750, -7500.0]], ['partial repair probe 1', ['P', 10, 1, 50, True], [-50, 500.0]], ['partial repair probe 2', ['P', 42.5, 1, 133, True], [-133, 5652.5]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 42.5, -3, 150, False], [0, 0.0]], ['normal control 2', ['C', 250, -1, 100, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 2, 150, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 101.25, 5, 50, True], [-250, 25312.5]], ['regression cash leg sign 2', ['C', 250, -1, 100, True], [-100, 25000.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['P', 42.5, 2, 100, True], [-200, 8500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 1, 133, False], [0, 0.0]], ['normal control 2', ['P', 101.25, -1, 100, False], [0, 0.0]], ['normal control 3', ['P', 10, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, -3, 50, True], [-150, 37500.0]], ['regression cash leg sign 2', ['C', 42.5, 2, 50, True], [100, -4250.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['C', 10, -1, 100, True], [-100, 1000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 2, 100, False], [0, 0.0]], ['normal control 2', ['C', 101.25, -1, 50, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 1, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 42.5, 2, 150, True], [-300, 12750.0]], ['regression cash leg sign 2', ['P', 10, -1, 150, True], [150, -1500.0]], ['partial repair probe 1', ['C', 10, -1, 133, True], [-133, 1330.0]], ['partial repair probe 2', ['C', 250, -3, 50, True], [-150, 37500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 101.25, -3, 50, False], [0, 0.0]], ['normal control 2', ['P', 101.25, 2, 133, False], [0, 0.0]], ['normal control 3', ['C', 101.25, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, 1, 100, True], [100, -25000.0]], ['regression cash leg sign 2', ['P', 250, 1, 50, True], [-50, 12500.0]], ['partial repair probe 1', ['C', 101.25, -3, 100, True], [-300, 30375.0]], ['partial repair probe 2', ['C', 250, -3, 100, True], [-300, 75000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, -3, 133, False], [0, 0.0]], ['normal control 2', ['C', 10, 5, 50, False], [0, 0.0]], ['normal control 3', ['C', 101.25, -1, 50, False], [0, 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 fixtureActualExpectedOutcome
regression cash leg sign 1[-750, -75937.5][-750, 75937.5]Failed
regression cash leg sign 2[750, 7500.0][750, -7500.0]Failed
partial repair probe 1[-50, -500.0][-50, 500.0]Failed
partial repair probe 2[-133, -5652.5][-133, 5652.5]Failed
boundary control 1[0, 0.0][0, 0.0]Passed
normal control 1[0, 0.0][0, 0.0]Passed
normal control 2[0, 0.0][0, 0.0]Passed
normal control 3[0, 0.0][0, 0.0]Passed

SHA-256 / 9c22958086357da41cfa6b4e0465b3a5196e05aa9ed1647996e118dc72c6a0d1

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(kind, strike, contracts, deliverable, exercised):
    if not exercised:
        return [0, 0.0]
    n = abs(contracts) * deliverable
    k = round(strike * 100)
    direction = 1 if kind == 'C' else -1
    if contracts < 0:
        direction = -direction
    shares = direction * n
    cash = -abs(direction * n * k)
    return [shares, cash / 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression cash leg sign 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['regression cash leg sign 2', ['C', 10, 5, 150, True], [750, -7500.0]], ['partial repair probe 1', ['P', 10, 1, 50, True], [-50, 500.0]], ['partial repair probe 2', ['P', 42.5, 1, 133, True], [-133, 5652.5]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 42.5, -3, 150, False], [0, 0.0]], ['normal control 2', ['C', 250, -1, 100, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 2, 150, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 101.25, 5, 50, True], [-250, 25312.5]], ['regression cash leg sign 2', ['C', 250, -1, 100, True], [-100, 25000.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['P', 42.5, 2, 100, True], [-200, 8500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 1, 133, False], [0, 0.0]], ['normal control 2', ['P', 101.25, -1, 100, False], [0, 0.0]], ['normal control 3', ['P', 10, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, -3, 50, True], [-150, 37500.0]], ['regression cash leg sign 2', ['C', 42.5, 2, 50, True], [100, -4250.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['C', 10, -1, 100, True], [-100, 1000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 2, 100, False], [0, 0.0]], ['normal control 2', ['C', 101.25, -1, 50, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 1, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 42.5, 2, 150, True], [-300, 12750.0]], ['regression cash leg sign 2', ['P', 10, -1, 150, True], [150, -1500.0]], ['partial repair probe 1', ['C', 10, -1, 133, True], [-133, 1330.0]], ['partial repair probe 2', ['C', 250, -3, 50, True], [-150, 37500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 101.25, -3, 50, False], [0, 0.0]], ['normal control 2', ['P', 101.25, 2, 133, False], [0, 0.0]], ['normal control 3', ['C', 101.25, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, 1, 100, True], [100, -25000.0]], ['regression cash leg sign 2', ['P', 250, 1, 50, True], [-50, 12500.0]], ['partial repair probe 1', ['C', 101.25, -3, 100, True], [-300, 30375.0]], ['partial repair probe 2', ['C', 250, -3, 100, True], [-300, 75000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, -3, 133, False], [0, 0.0]], ['normal control 2', ['C', 10, 5, 50, False], [0, 0.0]], ['normal control 3', ['C', 101.25, -1, 50, False], [0, 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 fixtureActualExpectedOutcome
regression cash leg sign 1[-750, -75937.5][-750, 75937.5]Failed
regression cash leg sign 2[750, -7500.0][750, -7500.0]Passed
partial repair probe 1[-50, -500.0][-50, 500.0]Failed
partial repair probe 2[-133, -5652.5][-133, 5652.5]Failed
boundary control 1[0, 0.0][0, 0.0]Passed
normal control 1[0, 0.0][0, 0.0]Passed
normal control 2[0, 0.0][0, 0.0]Passed
normal control 3[0, 0.0][0, 0.0]Passed

SHA-256 / 533c67ee0d97772ea799c98bc1b14502df0275752e8ace15f54630a63b9846a1

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(kind, strike, contracts, deliverable, exercised):
    if not exercised:
        return [0, 0.0]
    n = abs(contracts) * deliverable
    k = round(strike * 100)
    direction = 1 if kind == 'C' else -1
    if contracts < 0:
        direction = -direction
    shares = direction * n
    cash = -direction * n * k
    return [shares, cash / 100]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression cash leg sign 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['regression cash leg sign 2', ['C', 10, 5, 150, True], [750, -7500.0]], ['partial repair probe 1', ['P', 10, 1, 50, True], [-50, 500.0]], ['partial repair probe 2', ['P', 42.5, 1, 133, True], [-133, 5652.5]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 42.5, -3, 150, False], [0, 0.0]], ['normal control 2', ['C', 250, -1, 100, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 2, 150, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 101.25, 5, 50, True], [-250, 25312.5]], ['regression cash leg sign 2', ['C', 250, -1, 100, True], [-100, 25000.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['P', 42.5, 2, 100, True], [-200, 8500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 1, 133, False], [0, 0.0]], ['normal control 2', ['P', 101.25, -1, 100, False], [0, 0.0]], ['normal control 3', ['P', 10, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, -3, 50, True], [-150, 37500.0]], ['regression cash leg sign 2', ['C', 42.5, 2, 50, True], [100, -4250.0]], ['partial repair probe 1', ['P', 101.25, 5, 150, True], [-750, 75937.5]], ['partial repair probe 2', ['C', 10, -1, 100, True], [-100, 1000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, 2, 100, False], [0, 0.0]], ['normal control 2', ['C', 101.25, -1, 50, False], [0, 0.0]], ['normal control 3', ['C', 42.5, 1, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['P', 42.5, 2, 150, True], [-300, 12750.0]], ['regression cash leg sign 2', ['P', 10, -1, 150, True], [150, -1500.0]], ['partial repair probe 1', ['C', 10, -1, 133, True], [-133, 1330.0]], ['partial repair probe 2', ['C', 250, -3, 50, True], [-150, 37500.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['P', 101.25, -3, 50, False], [0, 0.0]], ['normal control 2', ['P', 101.25, 2, 133, False], [0, 0.0]], ['normal control 3', ['C', 101.25, 5, 100, False], [0, 0.0]]], [['regression cash leg sign 1', ['C', 250, 1, 100, True], [100, -25000.0]], ['regression cash leg sign 2', ['P', 250, 1, 50, True], [-50, 12500.0]], ['partial repair probe 1', ['C', 101.25, -3, 100, True], [-300, 30375.0]], ['partial repair probe 2', ['C', 250, -3, 100, True], [-300, 75000.0]], ['boundary control 1', ['C', 50, 1, 100, False], [0, 0.0]], ['normal control 1', ['C', 101.25, -3, 133, False], [0, 0.0]], ['normal control 2', ['C', 10, 5, 50, False], [0, 0.0]], ['normal control 3', ['C', 101.25, -1, 50, False], [0, 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 fixtureActualExpectedOutcome
regression cash leg sign 1[-750, 75937.5][-750, 75937.5]Passed
regression cash leg sign 2[750, -7500.0][750, -7500.0]Passed
partial repair probe 1[-50, 500.0][-50, 500.0]Passed
partial repair probe 2[-133, 5652.5][-133, 5652.5]Passed
boundary control 1[0, 0.0][0, 0.0]Passed
normal control 1[0, 0.0][0, 0.0]Passed
normal control 2[0, 0.0][0, 0.0]Passed
normal control 3[0, 0.0][0, 0.0]Passed

SHA-256 / b735e41dc26740f13b61abfdd3b9de30c212f041827d74ca554aca959f583078

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.770510+00:00.

Case digest / 9bb71196db94be7f38c6de418062fc2046a8ca7751e4faa5e8e8e9977379c85a