FAILURE MAP
← Case archive

FA-61726 / Options payoff and settlement / Open access

FX option premium quote conversion: pip premiums are converted to base by multiplying by spot · case 01

Base-currency equivalents of pip premiums are spot-squared off.

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

ROOT CAUSE

The pips branch multiplies term by spot.

VERIFIED REPAIR

Divide the term amount by spot.

Unsuccessful approach: Guessing the direction from the spot magnitude breaks for pairs quoted above one.

Case contract

Inputs quote, quote type, base notional, spot and pip size. pips: term premium = quote*pip*notional, base = term/spot. pct_base: base = quote/100*notional, term = base*spot. pct_term: term = quote/100*notional*spot, base = term/spot. Exact fractions; return [term, base] rounded to 2 as floats.

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
from fractions import Fraction
N = 1
observations = []
def solve(quote, quote_type, notional, spot, pip):
    q = Fraction(str(quote))
    s = Fraction(str(spot))
    N = Fraction(notional)
    pp = Fraction(str(pip))
    if quote_type == 'pips':
        term = q * pp * N
        base = term * s
    elif quote_type == 'pct_base':
        base = q / 100 * N
        term = base * s
    else:
        term = q / 100 * N * s
        base = term / s
    return [float(round(term, 2)), float(round(base, 2))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression pip base conversion 1', [45.0, 'pips', 1000000, 149.35, 0.01], [450000.0, 3013.06]], ['regression pip base conversion 2', [110.0, 'pips', 5000000, 1.0845, 0.0001], [55000.0, 50714.62]], ['partial repair probe 1', [1.25, 'pips', 1000000, 1.2712, 0.0001], [125.0, 98.33]], ['partial repair probe 2', [12.5, 'pips', 5000000, 1.2712, 0.0001], [6250.0, 4916.61]], ['normal control 1', [1.25, 'pct_base', 5000000, 1.0845, 0.0001], [67781.25, 62500.0]], ['normal control 2', [1.25, 'pct_term', 1000000, 1.2712, 0.0001], [15890.0, 12500.0]], ['normal control 3', [0.85, 'pct_term', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 4', [12.5, 'pct_base', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]]], [['regression pip base conversion 1', [12.5, 'pips', 250000, 1.2712, 0.0001], [312.5, 245.83]], ['regression pip base conversion 2', [0.85, 'pips', 1000000, 149.35, 0.01], [8500.0, 56.91]], ['partial repair probe 1', [1.25, 'pips', 250000, 149.35, 0.01], [3125.0, 20.92]], ['partial repair probe 2', [45.0, 'pips', 1000000, 1.2712, 0.0001], [4500.0, 3539.96]], ['normal control 1', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 2', [0.85, 'pct_base', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 3', [0.85, 'pct_base', 5000000, 1.0845, 0.0001], [46091.25, 42500.0]], ['normal control 4', [0.85, 'pct_term', 250000, 1.2712, 0.0001], [2701.3, 2125.0]]], [['regression pip base conversion 1', [12.5, 'pips', 1000000, 1.2712, 0.0001], [1250.0, 983.32]], ['regression pip base conversion 2', [12.5, 'pips', 5000000, 149.35, 0.01], [625000.0, 4184.8]], ['partial repair probe 1', [45.0, 'pips', 5000000, 149.35, 0.01], [2250000.0, 15065.28]], ['partial repair probe 2', [1.25, 'pips', 250000, 1.2712, 0.0001], [31.25, 24.58]], ['normal control 1', [12.5, 'pct_term', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]], ['normal control 2', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 3', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 4', [1.25, 'pct_term', 250000, 1.0845, 0.0001], [3389.06, 3125.0]]], [['regression pip base conversion 1', [45.0, 'pips', 250000, 1.0845, 0.0001], [1125.0, 1037.34]], ['regression pip base conversion 2', [12.5, 'pips', 1000000, 149.35, 0.01], [125000.0, 836.96]], ['partial repair probe 1', [110.0, 'pips', 1000000, 149.35, 0.01], [1100000.0, 7365.25]], ['partial repair probe 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['normal control 1', [0.85, 'pct_base', 250000, 149.35, 0.01], [317368.75, 2125.0]], ['normal control 2', [45.0, 'pct_base', 1000000, 149.35, 0.01], [67207500.0, 450000.0]], ['normal control 3', [110.0, 'pct_base', 1000000, 149.35, 0.01], [164285000.0, 1100000.0]], ['normal control 4', [45.0, 'pct_base', 5000000, 149.35, 0.01], [336037500.0, 2250000.0]]], [['regression pip base conversion 1', [1.25, 'pips', 5000000, 149.35, 0.01], [62500.0, 418.48]], ['regression pip base conversion 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['partial repair probe 1', [45.0, 'pips', 5000000, 1.2712, 0.0001], [22500.0, 17699.81]], ['partial repair probe 2', [0.85, 'pips', 1000000, 1.2712, 0.0001], [85.0, 66.87]], ['normal control 1', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 2', [1.25, 'pct_base', 250000, 149.35, 0.01], [466718.75, 3125.0]], ['normal control 3', [12.5, 'pct_term', 1000000, 149.35, 0.01], [18668750.0, 125000.0]], ['normal control 4', [1.25, 'pct_base', 1000000, 1.2712, 0.0001], [15890.0, 12500.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 pip base conversion 1[450000.0, 67207500.0][450000.0, 3013.06]Failed
regression pip base conversion 2[55000.0, 59647.5][55000.0, 50714.62]Failed
partial repair probe 1[125.0, 158.9][125.0, 98.33]Failed
partial repair probe 2[6250.0, 7945.0][6250.0, 4916.61]Failed
normal control 1[67781.25, 62500.0][67781.25, 62500.0]Passed
normal control 2[15890.0, 12500.0][15890.0, 12500.0]Passed
normal control 3[9218.25, 8500.0][9218.25, 8500.0]Passed
normal control 4[794500.0, 625000.0][794500.0, 625000.0]Passed

SHA-256 / 13ed7948cecfade43ac054b0d3d1fdfefcbe066cb9ec2af92f88513e631471fa

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(quote, quote_type, notional, spot, pip):
    q = Fraction(str(quote))
    s = Fraction(str(spot))
    N = Fraction(notional)
    pp = Fraction(str(pip))
    if quote_type == 'pips':
        term = q * pp * N
        base = term / s if s < 1 else term * s
    elif quote_type == 'pct_base':
        base = q / 100 * N
        term = base * s
    else:
        term = q / 100 * N * s
        base = term / s
    return [float(round(term, 2)), float(round(base, 2))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression pip base conversion 1', [45.0, 'pips', 1000000, 149.35, 0.01], [450000.0, 3013.06]], ['regression pip base conversion 2', [110.0, 'pips', 5000000, 1.0845, 0.0001], [55000.0, 50714.62]], ['partial repair probe 1', [1.25, 'pips', 1000000, 1.2712, 0.0001], [125.0, 98.33]], ['partial repair probe 2', [12.5, 'pips', 5000000, 1.2712, 0.0001], [6250.0, 4916.61]], ['normal control 1', [1.25, 'pct_base', 5000000, 1.0845, 0.0001], [67781.25, 62500.0]], ['normal control 2', [1.25, 'pct_term', 1000000, 1.2712, 0.0001], [15890.0, 12500.0]], ['normal control 3', [0.85, 'pct_term', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 4', [12.5, 'pct_base', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]]], [['regression pip base conversion 1', [12.5, 'pips', 250000, 1.2712, 0.0001], [312.5, 245.83]], ['regression pip base conversion 2', [0.85, 'pips', 1000000, 149.35, 0.01], [8500.0, 56.91]], ['partial repair probe 1', [1.25, 'pips', 250000, 149.35, 0.01], [3125.0, 20.92]], ['partial repair probe 2', [45.0, 'pips', 1000000, 1.2712, 0.0001], [4500.0, 3539.96]], ['normal control 1', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 2', [0.85, 'pct_base', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 3', [0.85, 'pct_base', 5000000, 1.0845, 0.0001], [46091.25, 42500.0]], ['normal control 4', [0.85, 'pct_term', 250000, 1.2712, 0.0001], [2701.3, 2125.0]]], [['regression pip base conversion 1', [12.5, 'pips', 1000000, 1.2712, 0.0001], [1250.0, 983.32]], ['regression pip base conversion 2', [12.5, 'pips', 5000000, 149.35, 0.01], [625000.0, 4184.8]], ['partial repair probe 1', [45.0, 'pips', 5000000, 149.35, 0.01], [2250000.0, 15065.28]], ['partial repair probe 2', [1.25, 'pips', 250000, 1.2712, 0.0001], [31.25, 24.58]], ['normal control 1', [12.5, 'pct_term', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]], ['normal control 2', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 3', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 4', [1.25, 'pct_term', 250000, 1.0845, 0.0001], [3389.06, 3125.0]]], [['regression pip base conversion 1', [45.0, 'pips', 250000, 1.0845, 0.0001], [1125.0, 1037.34]], ['regression pip base conversion 2', [12.5, 'pips', 1000000, 149.35, 0.01], [125000.0, 836.96]], ['partial repair probe 1', [110.0, 'pips', 1000000, 149.35, 0.01], [1100000.0, 7365.25]], ['partial repair probe 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['normal control 1', [0.85, 'pct_base', 250000, 149.35, 0.01], [317368.75, 2125.0]], ['normal control 2', [45.0, 'pct_base', 1000000, 149.35, 0.01], [67207500.0, 450000.0]], ['normal control 3', [110.0, 'pct_base', 1000000, 149.35, 0.01], [164285000.0, 1100000.0]], ['normal control 4', [45.0, 'pct_base', 5000000, 149.35, 0.01], [336037500.0, 2250000.0]]], [['regression pip base conversion 1', [1.25, 'pips', 5000000, 149.35, 0.01], [62500.0, 418.48]], ['regression pip base conversion 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['partial repair probe 1', [45.0, 'pips', 5000000, 1.2712, 0.0001], [22500.0, 17699.81]], ['partial repair probe 2', [0.85, 'pips', 1000000, 1.2712, 0.0001], [85.0, 66.87]], ['normal control 1', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 2', [1.25, 'pct_base', 250000, 149.35, 0.01], [466718.75, 3125.0]], ['normal control 3', [12.5, 'pct_term', 1000000, 149.35, 0.01], [18668750.0, 125000.0]], ['normal control 4', [1.25, 'pct_base', 1000000, 1.2712, 0.0001], [15890.0, 12500.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 pip base conversion 1[450000.0, 67207500.0][450000.0, 3013.06]Failed
regression pip base conversion 2[55000.0, 59647.5][55000.0, 50714.62]Failed
partial repair probe 1[125.0, 158.9][125.0, 98.33]Failed
partial repair probe 2[6250.0, 7945.0][6250.0, 4916.61]Failed
normal control 1[67781.25, 62500.0][67781.25, 62500.0]Passed
normal control 2[15890.0, 12500.0][15890.0, 12500.0]Passed
normal control 3[9218.25, 8500.0][9218.25, 8500.0]Passed
normal control 4[794500.0, 625000.0][794500.0, 625000.0]Passed

SHA-256 / 2e22d2edb98aef36df03ddcdfdd5b2bef4d147fc340ef4eb605322b663915e0b

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(quote, quote_type, notional, spot, pip):
    q = Fraction(str(quote))
    s = Fraction(str(spot))
    N = Fraction(notional)
    pp = Fraction(str(pip))
    if quote_type == 'pips':
        term = q * pp * N
        base = term / s
    elif quote_type == 'pct_base':
        base = q / 100 * N
        term = base * s
    else:
        term = q / 100 * N * s
        base = term / s
    return [float(round(term, 2)), float(round(base, 2))]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression pip base conversion 1', [45.0, 'pips', 1000000, 149.35, 0.01], [450000.0, 3013.06]], ['regression pip base conversion 2', [110.0, 'pips', 5000000, 1.0845, 0.0001], [55000.0, 50714.62]], ['partial repair probe 1', [1.25, 'pips', 1000000, 1.2712, 0.0001], [125.0, 98.33]], ['partial repair probe 2', [12.5, 'pips', 5000000, 1.2712, 0.0001], [6250.0, 4916.61]], ['normal control 1', [1.25, 'pct_base', 5000000, 1.0845, 0.0001], [67781.25, 62500.0]], ['normal control 2', [1.25, 'pct_term', 1000000, 1.2712, 0.0001], [15890.0, 12500.0]], ['normal control 3', [0.85, 'pct_term', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 4', [12.5, 'pct_base', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]]], [['regression pip base conversion 1', [12.5, 'pips', 250000, 1.2712, 0.0001], [312.5, 245.83]], ['regression pip base conversion 2', [0.85, 'pips', 1000000, 149.35, 0.01], [8500.0, 56.91]], ['partial repair probe 1', [1.25, 'pips', 250000, 149.35, 0.01], [3125.0, 20.92]], ['partial repair probe 2', [45.0, 'pips', 1000000, 1.2712, 0.0001], [4500.0, 3539.96]], ['normal control 1', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 2', [0.85, 'pct_base', 1000000, 1.0845, 0.0001], [9218.25, 8500.0]], ['normal control 3', [0.85, 'pct_base', 5000000, 1.0845, 0.0001], [46091.25, 42500.0]], ['normal control 4', [0.85, 'pct_term', 250000, 1.2712, 0.0001], [2701.3, 2125.0]]], [['regression pip base conversion 1', [12.5, 'pips', 1000000, 1.2712, 0.0001], [1250.0, 983.32]], ['regression pip base conversion 2', [12.5, 'pips', 5000000, 149.35, 0.01], [625000.0, 4184.8]], ['partial repair probe 1', [45.0, 'pips', 5000000, 149.35, 0.01], [2250000.0, 15065.28]], ['partial repair probe 2', [1.25, 'pips', 250000, 1.2712, 0.0001], [31.25, 24.58]], ['normal control 1', [12.5, 'pct_term', 5000000, 1.2712, 0.0001], [794500.0, 625000.0]], ['normal control 2', [45.0, 'pct_term', 5000000, 1.2712, 0.0001], [2860200.0, 2250000.0]], ['normal control 3', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 4', [1.25, 'pct_term', 250000, 1.0845, 0.0001], [3389.06, 3125.0]]], [['regression pip base conversion 1', [45.0, 'pips', 250000, 1.0845, 0.0001], [1125.0, 1037.34]], ['regression pip base conversion 2', [12.5, 'pips', 1000000, 149.35, 0.01], [125000.0, 836.96]], ['partial repair probe 1', [110.0, 'pips', 1000000, 149.35, 0.01], [1100000.0, 7365.25]], ['partial repair probe 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['normal control 1', [0.85, 'pct_base', 250000, 149.35, 0.01], [317368.75, 2125.0]], ['normal control 2', [45.0, 'pct_base', 1000000, 149.35, 0.01], [67207500.0, 450000.0]], ['normal control 3', [110.0, 'pct_base', 1000000, 149.35, 0.01], [164285000.0, 1100000.0]], ['normal control 4', [45.0, 'pct_base', 5000000, 149.35, 0.01], [336037500.0, 2250000.0]]], [['regression pip base conversion 1', [1.25, 'pips', 5000000, 149.35, 0.01], [62500.0, 418.48]], ['regression pip base conversion 2', [12.5, 'pips', 250000, 1.0845, 0.0001], [312.5, 288.15]], ['partial repair probe 1', [45.0, 'pips', 5000000, 1.2712, 0.0001], [22500.0, 17699.81]], ['partial repair probe 2', [0.85, 'pips', 1000000, 1.2712, 0.0001], [85.0, 66.87]], ['normal control 1', [12.5, 'pct_base', 5000000, 1.0845, 0.0001], [677812.5, 625000.0]], ['normal control 2', [1.25, 'pct_base', 250000, 149.35, 0.01], [466718.75, 3125.0]], ['normal control 3', [12.5, 'pct_term', 1000000, 149.35, 0.01], [18668750.0, 125000.0]], ['normal control 4', [1.25, 'pct_base', 1000000, 1.2712, 0.0001], [15890.0, 12500.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 pip base conversion 1[450000.0, 3013.06][450000.0, 3013.06]Passed
regression pip base conversion 2[55000.0, 50714.62][55000.0, 50714.62]Passed
partial repair probe 1[125.0, 98.33][125.0, 98.33]Passed
partial repair probe 2[6250.0, 4916.61][6250.0, 4916.61]Passed
normal control 1[67781.25, 62500.0][67781.25, 62500.0]Passed
normal control 2[15890.0, 12500.0][15890.0, 12500.0]Passed
normal control 3[9218.25, 8500.0][9218.25, 8500.0]Passed
normal control 4[794500.0, 625000.0][794500.0, 625000.0]Passed

SHA-256 / 64b36b5da6173e76fc88cc3ef3dbee9641f8e44fedc97f13730cc6338d809b49

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

Case digest / ecf6afc6d4d0a23682be7593e785e1bdb7a98a76ea2fa6290cbbe90fc011b6c4