Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CapFloor parser and writer #2318

Merged
merged 4 commits into from
Jun 25, 2021
Merged

Create CapFloor parser and writer #2318

merged 4 commits into from
Jun 25, 2021

Conversation

skitini
Copy link
Contributor

@skitini skitini commented Jun 24, 2021

No description provided.

@skitini skitini changed the title PROD-7729: Create Strata CapFloor parser and writer Create Strata CapFloor parser and writer Jun 24, 2021
@skitini skitini changed the title Create Strata CapFloor parser and writer Create CapFloor parser and writer Jun 24, 2021
String capFloorType = row.getValue(CAP_FLOOR_FIELD);
if (capFloorType.toUpperCase(Locale.ENGLISH).equals("CAP")) {
capFloorLegBuilder.capSchedule(strike);
} else if (capFloorType.toUpperCase(Locale.ENGLISH).equals("FLOOR")) {
Copy link
Member

Choose a reason for hiding this comment

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

Looking at the API, I would assume that a leg can have both a cap and a floor. There does seem to be validation against it though. Might need to investigate changing things to a single schedule and a type in another PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

A cap/floor would always only have one or the other; the payoff is (Rate fixing - Strike) or (Strike - Rate Fixing)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The IborCapFloorLeg only lets you have one, but I think the point is that it has a cap schedule and floor schedule as optional properties (even though there is validation that won't allow it). It might be better having a CapFloor property and then just a single schedule, and the payoff direction can be determined by the CapFloor type, which also aligns with how the parser works/ is represented in CSV format.

@skitini skitini requested a review from jodastephen June 25, 2021 09:41
@skitini skitini merged commit 39b5604 into main Jun 25, 2021
@delete-merged-branch delete-merged-branch bot deleted the topic/cap_floor_parser branch June 25, 2021 09:56
@jodastephen jodastephen added this to the v2.11 milestone Jan 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants