/** * Calculates the present value sensitivity to the implied volatility of the swaption trade. * <p> * The sensitivity to the normal volatility is also called normal vega. * * @param trade the swaption trade * @param ratesProvider the rates provider * @param swaptionVolatilities the volatilities * @return the point sensitivity to the normal volatility */ public PointSensitivities presentValueSensitivityModelParamsVolatility( ResolvedSwaptionTrade trade, RatesProvider ratesProvider, NormalSwaptionVolatilities swaptionVolatilities) { ResolvedSwaption product = trade.getProduct(); SwaptionSensitivity pointSens = isCash(product) ? cashParYieldPricer.presentValueSensitivityModelParamsVolatility(product, ratesProvider, swaptionVolatilities) : physicalPricer.presentValueSensitivityModelParamsVolatility(product, ratesProvider, swaptionVolatilities); return PointSensitivities.of(pointSens); }
/** * Calculates the present value of the swaption trade. * <p> * The result is expressed using the currency of the swaption. * * @param trade the swaption trade * @param ratesProvider the rates provider * @param swaptionVolatilities the volatilities * @return the present value */ public CurrencyAmount presentValue( ResolvedSwaptionTrade trade, RatesProvider ratesProvider, NormalSwaptionVolatilities swaptionVolatilities) { // product ResolvedSwaption product = trade.getProduct(); CurrencyAmount pvProduct = isCash(product) ? cashParYieldPricer.presentValue(product, ratesProvider, swaptionVolatilities) : physicalPricer.presentValue(product, ratesProvider, swaptionVolatilities); // premium Payment premium = trade.getPremium(); CurrencyAmount pvPremium = paymentPricer.presentValue(premium, ratesProvider); // total return pvProduct.plus(pvPremium); }
/** * Calculates the present value sensitivity of the swaption trade to the rate curves. * <p> * The present value sensitivity is computed in a "sticky strike" style, i.e. the sensitivity to the * curve nodes with the volatility at the swaption strike unchanged. This sensitivity does not include a potential * change of volatility due to the implicit change of forward rate or moneyness. * * @param trade the swaption trade * @param ratesProvider the rates provider * @param swaptionVolatilities the volatilities * @return the point sensitivity to the rate curves */ public PointSensitivities presentValueSensitivityRatesStickyStrike( ResolvedSwaptionTrade trade, RatesProvider ratesProvider, NormalSwaptionVolatilities swaptionVolatilities) { // product ResolvedSwaption product = trade.getProduct(); PointSensitivityBuilder pointSens = isCash(product) ? cashParYieldPricer.presentValueSensitivityRatesStickyStrike(product, ratesProvider, swaptionVolatilities) : physicalPricer.presentValueSensitivityRatesStickyStrike(product, ratesProvider, swaptionVolatilities); // premium Payment premium = trade.getPremium(); PointSensitivityBuilder pvcsPremium = paymentPricer.presentValueSensitivity(premium, ratesProvider); // total return pointSens.combinedWith(pvcsPremium).build(); }