static InstrumentDerivative getDerivative(final FinancialSecurity security, final ZonedDateTime now, final HistoricalTimeSeriesBundle timeSeries, final String[] curveNames,
final InstrumentDefinition<?> definition, final FixedIncomeConverterDataProvider definitionConverter) {
final InstrumentDerivative derivative;
if (security instanceof SwapSecurity) {
final SwapSecurity swapSecurity = (SwapSecurity) security;
final InterestRateInstrumentType type = SwapSecurityUtils.getSwapType(swapSecurity);
if (type == InterestRateInstrumentType.SWAP_FIXED_IBOR || type == InterestRateInstrumentType.SWAP_FIXED_IBOR_WITH_SPREAD || type == InterestRateInstrumentType.SWAP_FIXED_OIS) {
final Frequency resetFrequency;
if (swapSecurity.getPayLeg() instanceof FloatingInterestRateLeg) {
resetFrequency = ((FloatingInterestRateLeg) swapSecurity.getPayLeg()).getFrequency();
} else {