Pricing Spanish SPGB Bonds

When a SPGB bond has a maturity date which falls on a weekend for discounting purposes the maturity date is bumped to the next business day. This means DiscountingFixedCouponBondProductPricer#dirtyPriceFromYieldStandard needs special handling to adjust pow on the final coupon period, the problem I have is how to get the next business day, specifically using ES0000012B39 as an example it matures on 2028-04-30 (Sunday) but the 2028-05-01 (Monday) is a bank holiday in the target calendar, so the date which needs to be used for this adjustment is 2028-05-02 (Tuesday).

Once a bond has been resolved it’s not possible to access ReferenceData or a HolidayCalendar instance so I am unsure how to best modify the existing code to expose this date. Should ResolvedFixedCouponBond have an additional property added to it? Or should ReferenceData be added to the method signature and the bond calendar exposed? I can’t come up with a clean way to effect this change.

The general rule is that a resolved trade has all the date-related logic resolved. Thus, if a date/calendar is needed to pick a date, this should occur during the resolve process, with the result stored in the resolved bean. In this case, it sounds like the resolved bean might need an extra field, one that all bonds could populate, but that would only be different for SPGB bonds.

Thanks, I’m looking into whether I can provide some PRs so if that’s possible I’ll get in touch to discuss further.

1 Like