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));
LegacyVanillaCreditDefaultSwapDefinition definition = (LegacyVanillaCreditDefaultSwapDefinition) security.accept(converter);
definition = definition.withEffectiveDate(FOLLOWING.adjustDate(calendar, valuationTime.withHour(0).withMinute(0).withSecond(0).withNano(0).plusDays(1)));
definition = definition.withRecoveryRate(recoveryRate);
final Object yieldCurveObject = inputs.getValue(ValueRequirementNames.YIELD_CURVE);