@Override
public Set<ComputedValue> execute(final FunctionExecutionContext executionContext, final FunctionInputs inputs, final ComputationTarget target,
final Set<ValueRequirement> desiredValues) throws AsynchronousExecution {
final HolidaySource holidaySource = OpenGammaExecutionContext.getHolidaySource(executionContext);
final SecuritySource securitySource = OpenGammaExecutionContext.getSecuritySource(executionContext);
final RegionSource regionSource = OpenGammaExecutionContext.getRegionSource(executionContext);
final OrganizationSource organizationSource = OpenGammaExecutionContext.getOrganizationSource(executionContext);
final CreditDefaultIndexSwapSecurityToProxyConverter converter = new CreditDefaultIndexSwapSecurityToProxyConverter(holidaySource, regionSource, organizationSource);
final ZonedDateTime valuationTime = ZonedDateTime.now(executionContext.getValuationClock());
final CreditDefaultSwapIndexSecurity security = (CreditDefaultSwapIndexSecurity) target.getSecurity();
final CreditDefaultSwapIndexDefinitionSecurity underlyingDefinition = (CreditDefaultSwapIndexDefinitionSecurity) securitySource.getSingle(ExternalIdBundle.of(security.getReferenceEntity()));
if (underlyingDefinition == null) {
throw new OpenGammaRuntimeException("Could not get underlying index definition");
}
final double recoveryRate = underlyingDefinition.getRecoveryRate();
final Calendar calendar = new HolidaySourceCalendarAdapter(holidaySource, FinancialSecurityUtils.getCurrency(security));