if (forex instanceof ForexOptionVanilla) {
final ForexOptionVanilla fxDerivative = (ForexOptionVanilla) forex;
spot = data.getFxRates().getFxRate(fxDerivative.getCurrency1(), fxDerivative.getCurrency2());
} else if (forex instanceof ForexOptionDigital) {
final ForexOptionDigital fxDerivative = (ForexOptionDigital) forex;
if (fxDerivative.payDomestic()) {
spot = data.getFxRates().getFxRate(fxDerivative.getCurrency1(), fxDerivative.getCurrency2());
} else {
spot = data.getFxRates().getFxRate(fxDerivative.getCurrency2(), fxDerivative.getCurrency1());
}
} else if (forex instanceof ForexOptionSingleBarrier) {