class BlackFxSingleBarrierOptionProductPricer {

  public PointSensitivityBuilder presentValueSensitivityModelParamsVolatility(
      ResolvedFxSingleBarrierOption option,
      RatesProvider ratesProvider,
      BlackFxOptionVolatilities volatilities) {

    ResolvedFxVanillaOption underlyingOption = option.getUnderlyingOption();
    if (volatilities.relativeTime(underlyingOption.getExpiry()) <= 0d) {
      return PointSensitivityBuilder.none();
    }
    ValueDerivatives priceDerivatives = priceDerivatives(option, ratesProvider, volatilities);
    ResolvedFxSingle underlyingFx = underlyingOption.getUnderlying();
    CurrencyPair currencyPair = underlyingFx.getCurrencyPair();
    Currency ccyBase = currencyPair.getBase();
    Currency ccyCounter = currencyPair.getCounter();
    double dfBase = ratesProvider.discountFactor(ccyBase, underlyingFx.getPaymentDate());
    double dfCounter = ratesProvider.discountFactor(ccyCounter, underlyingFx.getPaymentDate());
    double todayFx = ratesProvider.fxRate(currencyPair);
    double forward = todayFx * dfBase / dfCounter;
    return FxOptionSensitivity.of(
        volatilities.getName(),
        currencyPair,
        volatilities.relativeTime(underlyingOption.getExpiry()),
        underlyingOption.getStrike(),
        forward,
        ccyCounter,
        priceDerivatives.getDerivative(4) * signedNotional(underlyingOption));
  }

  public  BlackFxSingleBarrierOptionProductPricer();

}