@Override public Double visitInterestRateFutureOptionMarginTransaction( final InterestRateFutureOptionMarginTransaction option, final YieldCurveBundle curves) { ArgumentChecker.notNull(curves, "curves"); ArgumentChecker.notNull(option, "option"); if (curves instanceof YieldCurveWithBlackCubeBundle) { return MARGINNED_IR_FUTURE_OPTION.presentValue(option, curves).getAmount(); } throw new UnsupportedOperationException( "The PresentValueBlackCalculator visitor visitSwaptionPhysicalFixedIbor requires a YieldCurveWithBlackSwaptionBundle as data."); }
@Override public Double visitInterestRateFutureOptionPremiumTransaction( final InterestRateFutureOptionPremiumTransaction option, final YieldCurveBundle curves) { ArgumentChecker.notNull(curves, "curves"); ArgumentChecker.notNull(option, "option"); if (curves instanceof YieldCurveWithBlackCubeBundle) { final InterestRateFutureOptionPremiumSecurity underlyingOption = option.getUnderlyingOption(); final InterestRateFutureOptionMarginSecurity underlyingMarginedOption = new InterestRateFutureOptionMarginSecurity( underlyingOption.getUnderlyingFuture(), underlyingOption.getExpirationTime(), underlyingOption.getStrike(), underlyingOption.isCall()); final InterestRateFutureOptionMarginTransaction margined = new InterestRateFutureOptionMarginTransaction( underlyingMarginedOption, option.getQuantity(), option.getTradePrice()); return MARGINNED_IR_FUTURE_OPTION.presentValue(margined, curves).getAmount(); } throw new UnsupportedOperationException( "The PresentValueBlackCalculator visitor visitInterestRateFutureOptionPremiumTransaction requires a YieldCurveWithBlackCubeBundle as data."); }