public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target, final Set<ValueRequirement> desiredValues) {
final ConventionBundleSource conventionSource = OpenGammaExecutionContext.getConventionBundleSource(executionContext);
final ValueRequirement desiredValue = desiredValues.iterator().next();
final Currency currency = FinancialSecurityUtils.getCurrency(target.getSecurity());
final String conventionName = currency.getCode() + "_SWAP";
final ConventionBundle convention = conventionSource.getConventionBundle(ExternalId.of(InMemoryConventionBundleMaster.SIMPLE_NAME_SCHEME, conventionName));
if (convention == null) {
throw new OpenGammaRuntimeException("Could not get convention named " + conventionName);
}
final DayCount dayCount = convention.getSwapFloatingLegDayCount();
if (dayCount == null) {
throw new OpenGammaRuntimeException("Could not get daycount");
}
final String curveCalculationConfigName = desiredValue.getConstraint(ValuePropertyNames.CURVE_CALCULATION_CONFIG);
final ConfigSource configSource = OpenGammaExecutionContext.getConfigSource(executionContext);