}
final Set<String> forwardCurveNames = constraints.getValues(ValuePropertyNames.FORWARD_CURVE_NAME);
if (forwardCurveNames == null || forwardCurveNames.size() != 1) {
return null;
}
final FinancialSecurity security = (FinancialSecurity) target.getPosition().getSecurity();
final ValueRequirement fxCurrencyExposureRequirement = new ValueRequirement(ValueRequirementNames.FX_CURRENCY_EXPOSURE, ComputationTargetSpecification.of(target.getPosition().getSecurity()),
ValueProperties.builder()
.with(ValuePropertyNames.CALCULATION_METHOD, CalculationPropertyNamesAndValues.FORWARD_POINTS)
.with(ValuePropertyNames.PAY_CURVE, payCurveNames.iterator().next())
.with(ValuePropertyNames.PAY_CURVE_CALCULATION_CONFIG, payCurveCalculationConfigs.iterator().next())
.with(ValuePropertyNames.RECEIVE_CURVE, receiveCurveNames.iterator().next())
.with(ValuePropertyNames.RECEIVE_CURVE_CALCULATION_CONFIG, receiveCurveCalculationConfigs.iterator().next())
.with(ValuePropertyNames.FORWARD_CURVE_NAME, forwardCurveNames.iterator().next())
.get());
final Currency payCurrency = security.accept(ForexVisitors.getPayCurrencyVisitor());
final Currency receiveCurrency = security.accept(ForexVisitors.getReceiveCurrencyVisitor());
final ValueProperties fxSpotConstraints = desiredValue.getConstraints().copy()
.withoutAny(ValuePropertyNames.PAY_CURVE)
.withoutAny(ValuePropertyNames.PAY_CURVE_CALCULATION_CONFIG)
.withoutAny(ValuePropertyNames.RECEIVE_CURVE)