* @param fxMatrix The FX matrix, not null
* @return The Black surface and curve data
*/
protected BlackSTIRFuturesSmileProviderInterface getBlackSurface(final FunctionExecutionContext executionContext, final FunctionInputs inputs,
final ComputationTarget target, final FXMatrix fxMatrix) {
final ConventionSource conventionSource = OpenGammaExecutionContext.getConventionSource(executionContext);
final IRFutureOptionSecurity security = (IRFutureOptionSecurity) target.getTrade().getSecurity();
final MulticurveProviderInterface data = getMergedProviders(inputs, fxMatrix);
final VolatilitySurface volatilitySurface = (VolatilitySurface) inputs.getValue(INTERPOLATED_VOLATILITY_SURFACE);
final Currency currency = security.getCurrency();
// TODO the convention name should not be hard-coded, but there's no way of getting this information until
// there's a convention link in the security.
final InterestRateFutureConvention convention = conventionSource.getConvention(InterestRateFutureConvention.class, ExternalId.of(SCHEME_NAME, EURODOLLAR_FUTURE));
if (convention == null) {
throw new OpenGammaRuntimeException("Could not get interest rate future convention with id " + ExternalId.of(SCHEME_NAME, EURODOLLAR_FUTURE));
}
final IborIndexConvention iborIndexConvention = conventionSource.getConvention(IborIndexConvention.class, convention.getIndexConvention());
final Period period = Period.ofMonths(3); //TODO
final int spotLag = iborIndexConvention.getSettlementDays();
final IborIndex iborIndex = new IborIndex(currency, period, spotLag, iborIndexConvention.getDayCount(),
iborIndexConvention.getBusinessDayConvention(), iborIndexConvention.isIsEOM(), iborIndexConvention.getName());
final BlackSTIRFuturesSmileProvider blackData = new BlackSTIRFuturesSmileProvider(data, volatilitySurface.getSurface(), iborIndex);