Add support for payment lag in cash flow calculations. This is needed…#320
Open
novitk wants to merge 2 commits into
Open
Add support for payment lag in cash flow calculations. This is needed…#320novitk wants to merge 2 commits into
novitk wants to merge 2 commits into
Conversation
… for OIS(SOFR, ESTR, etc). Ensured backward compatibility by defaulting `paymentLag` to `0`.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for a payment lag on overnight indexed swaps by threading a paymentLag parameter through the fixed and overnight legs and the cashflow vector builder.
Changes:
- Adds
paymentLagparameter (default 0) toOvernightIndexedSwapconstructor and applies it to both legs. - Adds
withPaymentLagbuilder method onFixedRateLegandOvernightLeg, with a helpercalcPayDateonFixedRateLeg. - Threads
paymentLagthroughCashFlowVectors.OvernightLegto adjust payment dates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/QLNet/Instruments/OvernightIndexedSwap.cs | Adds optional paymentLag constructor parameter and forwards it to both legs. |
| src/QLNet/Cashflows/OvernightIndexedCoupon.cs | Adds withPaymentLag builder method on OvernightLeg and passes lag through to the cashflow builder. |
| src/QLNet/Cashflows/FixedRateCoupon.cs | Adds withPaymentLag and calcPayDate helper to apply lag in FixedRateLeg.value(). |
| src/QLNet/Cashflows/Cashflowvectors.cs | Adds optional paymentLag parameter that shifts the computed payment date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added an optional `paymentLag` parameter to the `OvernightIndexedSwap` constructor with a default value of `0`. Updated `FixedRateLeg` and `OvernightLeg` initializations to use the `.withPaymentLag(paymentLag)` method.
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.
… for OIS(SOFR, ESTR, etc).
Ensured backward compatibility by defaulting
paymentLagto0.QLNet
Thank you for contributing! Take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.
You must open an issue before embarking on any significant pull request, especially those that
add a new code or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.
IMPORTANT: By submitting a patch via a Pull Request, you agree to allow the project
owners to license your work under the terms of the BSD3 License.
PR Type
What kind of change does this PR introduce?
Description