Skip to content

Fixes #356 - #357

Open
salujajaskeerat wants to merge 1 commit into
OpenSourceRisk:masterfrom
salujajaskeerat:fix-zero-spread-maturity-order
Open

Fixes #356#357
salujajaskeerat wants to merge 1 commit into
OpenSourceRisk:masterfrom
salujajaskeerat:fix-zero-spread-maturity-order

Conversation

@salujajaskeerat

Copy link
Copy Markdown

About

Fixes #356.

YieldCurve::buildZeroSpreadedCurve() collects ZeroSpread quotes in a set ordered by pointer identity(address). As a result, resolved maturities and quote handles may be passed to PiecewiseZeroSpreadedTermStructure in a non-chronological order, producing non-deterministic yield curves.

This change keeps each resolved maturity paired with its quote, sorts the nodes by maturity, and then builds the date and quote-handle vectors used to construct the curve.

I have tried to keep the minimal changes without breaking any functionalities

Tests

  • Added a regression test with distinct ZeroSpread values and non-chronological quote lookup.
  • Ran ZeroSpreadRegressionTests/testZeroSpreadedYieldCurveOrdersNodesByResolvedMaturity.
  • Ran TodaysMarketTests/testZeroSpreadedYieldCurve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZeroSpread quotes are not ordered by resolved maturity, causing non-deterministic yield curves

1 participant