internal static CmsPeriod sut2() { FixedIborSwapConvention conv = INDEX.Template.Convention; ResolvedSwap swap = conv.toTrade(FIXING.plusDays(1), START.plusDays(1), END.plusDays(1), BuySell.BUY, 1d, 1d).Product.resolve(REF_DATA); return(CmsPeriod.builder().currency(EUR).notional(NOTIONAL + 1).startDate(START.plusDays(1)).endDate(END.plusDays(1)).unadjustedStartDate(START_UNADJUSTED.plusDays(1)).unadjustedEndDate(END_UNADJUSTED.plusDays(1)).yearFraction(YEAR_FRACTION + 0.01).paymentDate(PAYMENT.plusDays(1)).fixingDate(FIXING.plusDays(1)).floorlet(STRIKE).dayCount(ACT_365F).index(SwapIndices.EUR_EURIBOR_1100_5Y).underlyingSwap(swap).build()); }
internal static CmsPeriod sutCoupon() { FixedIborSwapConvention conv = INDEX.Template.Convention; ResolvedSwap swap = conv.toTrade(FIXING, START, END, BuySell.BUY, 1d, 0.01).Product.resolve(REF_DATA); return(CmsPeriod.builder().currency(GBP).notional(NOTIONAL).startDate(START).endDate(END).unadjustedStartDate(START_UNADJUSTED).unadjustedEndDate(END_UNADJUSTED).yearFraction(YEAR_FRACTION).paymentDate(PAYMENT).fixingDate(FIXING).dayCount(ACT_360).index(INDEX).underlyingSwap(swap).build()); }
// creates and resolves the underlying swap private static ResolvedSwap createUnderlyingSwap(LocalDate fixingDate) { FixedIborSwapConvention conv = EUR_EURIBOR_1100_5Y.Template.Convention; LocalDate effectiveDate = conv.calculateSpotDateFromTradeDate(fixingDate, REF_DATA); LocalDate maturityDate = effectiveDate.plus(EUR_EURIBOR_1100_5Y.Template.Tenor); Swap swap = conv.toTrade(fixingDate, effectiveDate, maturityDate, BuySell.BUY, 1d, 1d).Product; return(swap.resolve(REF_DATA)); }