Skip to content

cross-currency swap builder added - #2736

Open
dakshbtc wants to merge 1 commit into
lballabio:masterfrom
dakshbtc:feature/2717-make-xccy-basis-swap
Open

dakshbtc wants to merge 1 commit into
lballabio:masterfrom
dakshbtc:feature/2717-make-xccy-basis-swap

Conversation

@dakshbtc

@dakshbtc dakshbtc commented Aug 18, 2026

Copy link
Copy Markdown

Feature: #2717

Summary

Adds fluent Make* builders for cross-currency swaps (same pattern as MakeVanillaSwap / MakeOIS).

What's added

  • MakeConstNotionalCrossCurrencyBasisSwap — float vs float
  • MakeConstNotionalCrossCurrencyFixedVsFloatingSwap — fixed vs float
  • MakeConstNotionalCrossCurrencySwap — generic pre-built legs
  • MakeMtMCrossCurrencyBasisSwap — resetting-notional basis swap

@CLAassistant

CLAassistant commented Aug 18, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@boring-cyborg

boring-cyborg Bot commented Aug 18, 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.

@dakshbtc

Copy link
Copy Markdown
Author

@lballabio Looking forward to your feedback :)

@lballabio

Copy link
Copy Markdown
Owner

@lballabio Looking forward to your feedback :)

Thanks! I will, probably not very soon since I'm on holiday this couple of weeks.

@dakshbtc
dakshbtc marked this pull request as ready for review August 18, 2026 19:05

@lballabio lballabio left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I left a few comments in the files.

Comment on lines +56 to +58
bool isFxBaseCurrencyLegResettable,
Real fxBaseNominal = 1.0,
const Period& forwardStart = 0 * Days);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These three (or at least the last two, since they have a default value) can probably be additional methods instead of constructor arguments. I know there are similar arguments in MakeVanillaSwap for instance, but in hindsight that might have been a mistake.

The same goes for the other swaps.

"the FX spot quote must be positive; got " << fxSpot_->value());
fxQuoteNominal = fxBaseNominal_ * fxSpot_->value();
} else {
QL_REQUIRE(fxBaseCcy == fxQuoteCcy,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I would allow the currencies to be the same. It's not a XCCY swap in this case. I'd probably check this earlier and throw if they're the same.

The same goes for the other swaps.

QL_REQUIRE(fxSpot_->value() > 0.0,
"the FX spot quote must be positive; got " << fxSpot_->value());
fxQuoteNominal = fxBaseNominal_ * fxSpot_->value();
} else {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might also have the case in which both an FX quote nominal and an FX spot were passed. I'd probably throw in that case.

@@ -0,0 +1,433 @@
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a copyright attribution here and in the other new files.

pair of indices, see \c MakeConstNotionalCrossCurrencyBasisSwap and
\c MakeConstNotionalCrossCurrencyFixedVsFloatingSwap.
*/
class MakeConstNotionalCrossCurrencySwap {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this one is worth having, given all the previous work that goes into creating the legs.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 75.093% (-0.2%) from 75.309% — dakshbtc:feature/2717-make-xccy-basis-swap 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.

4 participants