/** * Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.provider.calculator.normalstirfutures; import com.opengamma.analytics.financial.interestrate.InstrumentDerivativeVisitorAdapter; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginSecurity; import com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionMarginTransaction; import com.opengamma.analytics.financial.interestrate.future.provider.InterestRateFutureOptionMarginSecurityNormalSmileMethod; import com.opengamma.analytics.financial.provider.description.interestrate.NormalSTIRFuturesProviderInterface; /** * Calculates the vega (first derivative of the price with respect to the volatility) for interest * rate future options in normal model. */ public final class VegaNormalSTIRFutureOptionCalculator extends InstrumentDerivativeVisitorAdapter<NormalSTIRFuturesProviderInterface, Double> { /** * The unique instance of the calculator. */ private static final VegaNormalSTIRFutureOptionCalculator INSTANCE = new VegaNormalSTIRFutureOptionCalculator(); /** * Gets the calculator instance. * @return The calculator. */ public static VegaNormalSTIRFutureOptionCalculator getInstance() { return INSTANCE; } /** * Constructor. */ private VegaNormalSTIRFutureOptionCalculator() { } /** * Pricing methods. */ private static final InterestRateFutureOptionMarginSecurityNormalSmileMethod METHOD_STIR_NORMAL = InterestRateFutureOptionMarginSecurityNormalSmileMethod .getInstance(); @Override public Double visitInterestRateFutureOptionMarginSecurity(InterestRateFutureOptionMarginSecurity futures, NormalSTIRFuturesProviderInterface normal) { return METHOD_STIR_NORMAL.priceVega(futures, normal); } @Override public Double visitInterestRateFutureOptionMarginTransaction(InterestRateFutureOptionMarginTransaction futures, NormalSTIRFuturesProviderInterface normal) { return METHOD_STIR_NORMAL.priceVega(futures.getUnderlyingSecurity(), normal); } }