FA-61251 / Bond day-count conventions / Open access
Money-market certificate priced from yield: accrued interest counts days remaining instead of days elapsed · case 01
Clean prices are wrong except at the midpoint.
ROOT CAUSE
Accrued days use days from settlement to maturity.
THE FAILURE
Accrued days use days from settlement to maturity.
Unsuccessful approach: Adding a day to the elapsed count includes the settlement date.
Case contract
Inputs issue, maturity and settlement dates, coupon and yield (decimals). The instrument pays 100*(1 + coupon*T/360) at maturity where T = days(issue, maturity). Dirty = redemption/(1 + y*R/360) with R = days(settle, maturity); accrued = 100*coupon*A/360 with A = days(issue, settle). Return [dirty, dirty-accrued] rounded to 6.
Why this case matters
Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(issue, maturity, settle, coupon, y):
I = datetime.date(*issue)
M = datetime.date(*maturity)
S = datetime.date(*settle)
T = (M - I).days
R = (M - S).days
A = (M - S).days
redemption = 100 * (1 + coupon * T / 360)
dirty = redemption / (1 + y * R / 360)
accrued = 100 * coupon * A / 360
return [round(dirty, 6), round(dirty - accrued, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression accrued days 1', [[2021, 12, 31], [2023, 4, 27], [2022, 2, 12], 0.065, 0.06], [101.291608, 100.51522]], ['regression accrued days 2', [[2028, 5, 30], [2028, 12, 26], [2028, 11, 21], 0.0375, 0.01], [102.088248, 100.265331]], ['partial repair probe 1', [[2036, 5, 23], [2038, 2, 25], [2037, 6, 1], 0.02, 0.01], [102.804048, 100.72627]], ['partial repair probe 2', [[2030, 9, 27], [2032, 7, 9], [2032, 6, 26], 0.0375, 0.01], [106.742704, 100.096871]], ['normal control 1', [[2022, 9, 30], [2023, 10, 5], [2022, 11, 27], 0.0, 0.045], [96.246391, 96.246391]], ['normal control 2', [[2014, 12, 28], [2016, 7, 26], [2016, 3, 31], 0.0, 0.06], [98.087298, 98.087298]], ['normal control 3', [[2039, 7, 31], [2040, 1, 25], [2039, 10, 22], 0.0, 0.06], [98.441345, 98.441345]], ['normal control 4', [[2023, 3, 31], [2023, 7, 22], [2023, 6, 2], 0.0, 0.045], [99.378882, 99.378882]]], [['regression accrued days 1', [[2030, 3, 31], [2032, 1, 23], [2030, 11, 12], 0.02, 0.01], [102.439828, 101.184272]], ['regression accrued days 2', [[2020, 12, 9], [2021, 8, 7], [2020, 12, 17], 0.0375, 0.045], [99.609296, 99.525963]], ['partial repair probe 1', [[2011, 6, 30], [2011, 8, 3], [2011, 7, 17], 0.02, 0.06], [99.905822, 99.811378]], ['partial repair probe 2', [[2021, 9, 15], [2021, 12, 22], [2021, 11, 3], 0.065, 0.03], [101.355576, 100.470854]], ['normal control 1', [[2025, 8, 12], [2027, 5, 8], [2025, 10, 1], 0.0, 0.01], [98.403674, 98.403674]], ['normal control 2', [[2034, 2, 28], [2034, 9, 17], [2034, 7, 14], 0.0, 0.03], [99.461252, 99.461252]], ['normal control 3', [[2029, 11, 19], [2031, 6, 23], [2031, 5, 13], 0.0, 0.03], [99.659497, 99.659497]], ['normal control 4', [[2030, 9, 16], [2032, 8, 16], [2032, 3, 2], 0.0, 0.03], [98.627435, 98.627435]]], [['regression accrued days 1', [[2012, 5, 14], [2013, 1, 15], [2012, 8, 31], 0.065, 0.01], [104.045715, 102.077659]], ['regression accrued days 2', [[2013, 10, 29], [2014, 1, 15], [2013, 11, 22], 0.0375, 0.06], [99.91328, 99.66328]], ['partial repair probe 1', [[2033, 7, 3], [2035, 4, 26], [2034, 4, 3], 0.0375, 0.045], [101.9512, 99.097033]], ['partial repair probe 2', [[2020, 10, 14], [2021, 7, 14], [2020, 11, 3], 0.0375, 0.01], [102.126031, 101.917698]], ['normal control 1', [[2023, 7, 13], [2025, 4, 14], [2023, 11, 4], 0.0, 0.045], [93.819632, 93.819632]], ['normal control 2', [[2010, 12, 4], [2012, 1, 14], [2011, 11, 20], 0.0, 0.09], [98.64365, 98.64365]], ['normal control 3', [[2011, 1, 31], [2012, 8, 15], [2011, 5, 28], 0.0, 0.01], [98.778982, 98.778982]], ['normal control 4', [[2012, 1, 13], [2012, 11, 21], [2012, 11, 12], 0.0, 0.06], [99.850225, 99.850225]]], [['regression accrued days 1', [[2032, 4, 1], [2034, 1, 25], [2033, 8, 16], 0.0375, 0.045], [104.794576, 99.56541]], ['regression accrued days 2', [[2012, 9, 28], [2013, 3, 23], [2012, 12, 17], 0.02, 0.01], [100.70922, 100.264775]], ['partial repair probe 1', [[2031, 11, 30], [2032, 2, 4], [2032, 1, 2], 0.065, 0.01], [101.098993, 100.503159]], ['normal control 1', [[2036, 4, 3], [2036, 11, 25], [2036, 11, 21], 0.0, 0.03], [99.966678, 99.966678]], ['normal control 2', [[2025, 9, 30], [2026, 12, 8], [2026, 4, 20], 0.0, 0.03], [98.103336, 98.103336]], ['normal control 3', [[2029, 5, 16], [2030, 2, 19], [2030, 1, 13], 0.0, 0.09], [99.083478, 99.083478]], ['normal control 4', [[2022, 1, 10], [2023, 2, 23], [2022, 4, 3], 0.0, 0.06], [94.846665, 94.846665]], ['normal control 5', [[2022, 4, 11], [2023, 9, 11], [2022, 12, 4], 0.0, 0.045], [96.60669, 96.60669]]], [['regression accrued days 1', [[2023, 6, 10], [2023, 11, 27], [2023, 10, 10], 0.065, 0.06], [102.251433, 100.048655]], ['regression accrued days 2', [[2021, 4, 4], [2022, 6, 11], [2022, 1, 14], 0.02, 0.045], [100.545464, 98.962131]], ['partial repair probe 1', [[2015, 11, 24], [2016, 2, 16], [2016, 1, 5], 0.02, 0.09], [99.422728, 99.189395]], ['normal control 1', [[2016, 12, 31], [2017, 4, 21], [2017, 2, 18], 0.0, 0.045], [99.23096, 99.23096]], ['normal control 2', [[2029, 10, 18], [2030, 8, 8], [2029, 11, 5], 0.0, 0.03], [97.751711, 97.751711]], ['normal control 3', [[2038, 1, 30], [2038, 5, 9], [2038, 4, 5], 0.0, 0.01], [99.905645, 99.905645]], ['normal control 4', [[2013, 4, 23], [2014, 6, 5], [2014, 4, 30], 0.0, 0.045], [99.552016, 99.552016]], ['normal control 5', [[2026, 8, 27], [2028, 2, 14], [2027, 7, 18], 0.0, 0.03], [98.27205, 98.27205]]]]
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 accrued days 1 | [101.291608, 93.36522] | [101.291608, 100.51522] | Failed |
| regression accrued days 2 | [102.088248, 101.723664] | [102.088248, 100.265331] | Failed |
| partial repair probe 1 | [102.804048, 101.309603] | [102.804048, 100.72627] | Failed |
| partial repair probe 2 | [106.742704, 106.607287] | [106.742704, 100.096871] | Failed |
| normal control 1 | [96.246391, 96.246391] | [96.246391, 96.246391] | Passed |
| normal control 2 | [98.087298, 98.087298] | [98.087298, 98.087298] | Passed |
| normal control 3 | [98.441345, 98.441345] | [98.441345, 98.441345] | Passed |
| normal control 4 | [99.378882, 99.378882] | [99.378882, 99.378882] | Passed |
SHA-256 / a563c0f4da7ca57ded021bd0c984e3747f226492a6b4be63a52073f2cd58bbf9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(issue, maturity, settle, coupon, y):
I = datetime.date(*issue)
M = datetime.date(*maturity)
S = datetime.date(*settle)
T = (M - I).days
R = (M - S).days
A = (S - I).days + 1
redemption = 100 * (1 + coupon * T / 360)
dirty = redemption / (1 + y * R / 360)
accrued = 100 * coupon * A / 360
return [round(dirty, 6), round(dirty - accrued, 6)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression accrued days 1', [[2021, 12, 31], [2023, 4, 27], [2022, 2, 12], 0.065, 0.06], [101.291608, 100.51522]], ['regression accrued days 2', [[2028, 5, 30], [2028, 12, 26], [2028, 11, 21], 0.0375, 0.01], [102.088248, 100.265331]], ['partial repair probe 1', [[2036, 5, 23], [2038, 2, 25], [2037, 6, 1], 0.02, 0.01], [102.804048, 100.72627]], ['partial repair probe 2', [[2030, 9, 27], [2032, 7, 9], [2032, 6, 26], 0.0375, 0.01], [106.742704, 100.096871]], ['normal control 1', [[2022, 9, 30], [2023, 10, 5], [2022, 11, 27], 0.0, 0.045], [96.246391, 96.246391]], ['normal control 2', [[2014, 12, 28], [2016, 7, 26], [2016, 3, 31], 0.0, 0.06], [98.087298, 98.087298]], ['normal control 3', [[2039, 7, 31], [2040, 1, 25], [2039, 10, 22], 0.0, 0.06], [98.441345, 98.441345]], ['normal control 4', [[2023, 3, 31], [2023, 7, 22], [2023, 6, 2], 0.0, 0.045], [99.378882, 99.378882]]], [['regression accrued days 1', [[2030, 3, 31], [2032, 1, 23], [2030, 11, 12], 0.02, 0.01], [102.439828, 101.184272]], ['regression accrued days 2', [[2020, 12, 9], [2021, 8, 7], [2020, 12, 17], 0.0375, 0.045], [99.609296, 99.525963]], ['partial repair probe 1', [[2011, 6, 30], [2011, 8, 3], [2011, 7, 17], 0.02, 0.06], [99.905822, 99.811378]], ['partial repair probe 2', [[2021, 9, 15], [2021, 12, 22], [2021, 11, 3], 0.065, 0.03], [101.355576, 100.470854]], ['normal control 1', [[2025, 8, 12], [2027, 5, 8], [2025, 10, 1], 0.0, 0.01], [98.403674, 98.403674]], ['normal control 2', [[2034, 2, 28], [2034, 9, 17], [2034, 7, 14], 0.0, 0.03], [99.461252, 99.461252]], ['normal control 3', [[2029, 11, 19], [2031, 6, 23], [2031, 5, 13], 0.0, 0.03], [99.659497, 99.659497]], ['normal control 4', [[2030, 9, 16], [2032, 8, 16], [2032, 3, 2], 0.0, 0.03], [98.627435, 98.627435]]], [['regression accrued days 1', [[2012, 5, 14], [2013, 1, 15], [2012, 8, 31], 0.065, 0.01], [104.045715, 102.077659]], ['regression accrued days 2', [[2013, 10, 29], [2014, 1, 15], [2013, 11, 22], 0.0375, 0.06], [99.91328, 99.66328]], ['partial repair probe 1', [[2033, 7, 3], [2035, 4, 26], [2034, 4, 3], 0.0375, 0.045], [101.9512, 99.097033]], ['partial repair probe 2', [[2020, 10, 14], [2021, 7, 14], [2020, 11, 3], 0.0375, 0.01], [102.126031, 101.917698]], ['normal control 1', [[2023, 7, 13], [2025, 4, 14], [2023, 11, 4], 0.0, 0.045], [93.819632, 93.819632]], ['normal control 2', [[2010, 12, 4], [2012, 1, 14], [2011, 11, 20], 0.0, 0.09], [98.64365, 98.64365]], ['normal control 3', [[2011, 1, 31], [2012, 8, 15], [2011, 5, 28], 0.0, 0.01], [98.778982, 98.778982]], ['normal control 4', [[2012, 1, 13], [2012, 11, 21], [2012, 11, 12], 0.0, 0.06], [99.850225, 99.850225]]], [['regression accrued days 1', [[2032, 4, 1], [2034, 1, 25], [2033, 8, 16], 0.0375, 0.045], [104.794576, 99.56541]], ['regression accrued days 2', [[2012, 9, 28], [2013, 3, 23], [2012, 12, 17], 0.02, 0.01], [100.70922, 100.264775]], ['partial repair probe 1', [[2031, 11, 30], [2032, 2, 4], [2032, 1, 2], 0.065, 0.01], [101.098993, 100.503159]], ['normal control 1', [[2036, 4, 3], [2036, 11, 25], [2036, 11, 21], 0.0, 0.03], [99.966678, 99.966678]], ['normal control 2', [[2025, 9, 30], [2026, 12, 8], [2026, 4, 20], 0.0, 0.03], [98.103336, 98.103336]], ['normal control 3', [[2029, 5, 16], [2030, 2, 19], [2030, 1, 13], 0.0, 0.09], [99.083478, 99.083478]], ['normal control 4', [[2022, 1, 10], [2023, 2, 23], [2022, 4, 3], 0.0, 0.06], [94.846665, 94.846665]], ['normal control 5', [[2022, 4, 11], [2023, 9, 11], [2022, 12, 4], 0.0, 0.045], [96.60669, 96.60669]]], [['regression accrued days 1', [[2023, 6, 10], [2023, 11, 27], [2023, 10, 10], 0.065, 0.06], [102.251433, 100.048655]], ['regression accrued days 2', [[2021, 4, 4], [2022, 6, 11], [2022, 1, 14], 0.02, 0.045], [100.545464, 98.962131]], ['partial repair probe 1', [[2015, 11, 24], [2016, 2, 16], [2016, 1, 5], 0.02, 0.09], [99.422728, 99.189395]], ['normal control 1', [[2016, 12, 31], [2017, 4, 21], [2017, 2, 18], 0.0, 0.045], [99.23096, 99.23096]], ['normal control 2', [[2029, 10, 18], [2030, 8, 8], [2029, 11, 5], 0.0, 0.03], [97.751711, 97.751711]], ['normal control 3', [[2038, 1, 30], [2038, 5, 9], [2038, 4, 5], 0.0, 0.01], [99.905645, 99.905645]], ['normal control 4', [[2013, 4, 23], [2014, 6, 5], [2014, 4, 30], 0.0, 0.045], [99.552016, 99.552016]], ['normal control 5', [[2026, 8, 27], [2028, 2, 14], [2027, 7, 18], 0.0, 0.03], [98.27205, 98.27205]]]]
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 accrued days 1 | [101.291608, 100.497164] | [101.291608, 100.51522] | Failed |
| regression accrued days 2 | [102.088248, 100.254914] | [102.088248, 100.265331] | Failed |
| partial repair probe 1 | [102.804048, 100.720714] | [102.804048, 100.72627] | Failed |
| partial repair probe 2 | [106.742704, 100.086454] | [106.742704, 100.096871] | Failed |
| normal control 1 | [96.246391, 96.246391] | [96.246391, 96.246391] | Passed |
| normal control 2 | [98.087298, 98.087298] | [98.087298, 98.087298] | Passed |
| normal control 3 | [98.441345, 98.441345] | [98.441345, 98.441345] | Passed |
| normal control 4 | [99.378882, 99.378882] | [99.378882, 99.378882] | Passed |
SHA-256 / dcab41a30321db8dca92a9e9c9833599c764992d67ff3e33a3820f10bf17028b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any published convention text. 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:53.524804+00:00.
Case digest / 0fa59c0a9e9ac268f37843830b054badb3dc1480ab0499ddfd69cda99d6c712e