feat(claim): add FaceValueAccrualClaim settling on a reference security - #867
Merged
Conversation
Port `FaceValueAccrualClaim`, which settles a default claim against the notional and accrual of a reference `Bond`, paying `N (1 - R - a)` where `a` is the security's accrual at the default date normalised by its notional there. The `Claim::amount` trait method now returns `QlResult<Real>` since the accrual claim reads a fallible `Bond` API. `FaceValueClaim`, which cannot fail, returns `Ok`, and the three CDS engines propagate the result. Where `claim.cpp:41-43` divides by a zero reference notional and returns `NaN`, the port fails explicitly: `Bond::notional` reports a redeemed bond as `Ok(0.0)`, putting that quotient within reach of ordinary use, so the claim names the condition as an error (D4) instead of letting a `NaN` propagate into a protection leg. Like `FaceValueClaim`, the accrual claim declines the ISDA downcast seam, so the engine refuses it. Closes #688
Ports `conventionalSpread` (`creditdefaultswap.cpp:383-423`) as `CreditDefaultSwap::conventional_spread`, which converts a contract carrying an upfront into a running spread. It solves the flat hazard rate that prices the contract to nothing at the conventional recovery, then reports the engine's fair spread on that curve, supporting both the mid-point and ISDA models. Adds two tests over a shared eight-year fixture whose upfront is still unsettled at the evaluation date, so the conversion moves the spread off its own running rate. Each rebuilds the contract at the converted spread with no upfront and checks it prices to nothing on the solved hazard rate. Drops the deferral note that listed `conventionalSpread` as omitted. close #790 close #688
benbenbang
enabled auto-merge (rebase)
August 12, 2026 23:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #688