Skip to content

Calculate spot dates from the actual evaluation date (#753)#2653

Open
Excal-rs wants to merge 1 commit into
lballabio:masterfrom
Excal-rs:fix-753-reference-date-adjustment
Open

Calculate spot dates from the actual evaluation date (#753)#2653
Excal-rs wants to merge 1 commit into
lballabio:masterfrom
Excal-rs:fix-753-reference-date-adjustment

Conversation

@Excal-rs

@Excal-rs Excal-rs commented Jul 9, 2026

Copy link
Copy Markdown

This addresses #753, using the approach @eltoder confirmed there.

Calendar::advance() already skips non business days. Because of this, adjusting the evaluation date before advancing added an extra business day whenever the evaluation date was a holiday or weekend. For example T+2 on TARGET from Saturday 20 June 2026 gave 24 June instead of 23 June.

This PR does the following.

  • Removes the adjustment from MakeVanillaSwap and MakeOIS (when explicit settlement days are given) and from DepositRateHelper, FraRateHelper and BMASwapRateHelper.
  • Adds an optional settlement calendar to MakeVanillaSwap and MakeOIS, defaulting to the float and overnight calendar. This is needed because the settlement calendar is not always the index calendar (for example USD SOFR swaps).
  • Adds regression tests for both behaviours.

Two checks in testMakeOISDefaultSettlementDays expected the old behaviour on a weekend evaluation date, so they were updated. The rest of the test suite passes unchanged.

The spot date paths that go through Index::valueDate, and the same pattern in MakeCms, MakeSwaption, MakeMultipleResetsSwap and FxSwapRateHelper, are left for a follow up. Happy to take those too.

Claude Code was used while working on this, mainly for confirming the issue still exists, finding the places that needed the fix, and for testing and debugging.

Settlement and fixing days are counted from the actual evaluation date,
without first rolling it to a business day: Calendar::advance already
skips non-business days, so the pre-adjustment added an extra business
day whenever the evaluation date was a holiday or weekend.

The adjustment is removed from MakeVanillaSwap and MakeOIS (when
explicit settlement days are given) and from DepositRateHelper,
FraRateHelper and BMASwapRateHelper.  MakeVanillaSwap and MakeOIS also
gain an optional settlement calendar, defaulting to the float and
overnight calendar respectively, since the calendar used for the
settlement-day advance is not always the index calendar (e.g. USD SOFR
swaps).
@CLAassistant

CLAassistant commented Jul 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@boring-cyborg

boring-cyborg Bot commented Jul 9, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! It might take a while before we look at it, so don't worry if there seems to be no feedback. We'll get to it.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 74.887% (+0.002%) from 74.885% — Excal-rs:fix-753-reference-date-adjustment into lballabio:master

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.

3 participants