final Period startPeriod = cashNode.getStartTenor().getPeriod();
final Period maturityPeriod = cashNode.getMaturityTenor().getPeriod();
if (convention instanceof DepositConvention) {
final DepositConvention depositConvention = (DepositConvention) convention;
final Currency currency = depositConvention.getCurrency();
final Calendar calendar = CalendarUtils.getCalendar(_regionSource, _holidaySource, depositConvention.getRegionCalendar());
final BusinessDayConvention businessDayConvention = depositConvention.getBusinessDayConvention();
final boolean isEOM = depositConvention.isIsEOM();
final DayCount dayCount = depositConvention.getDayCount();
final int settlementDays = depositConvention.getSettlementDays();
final ZonedDateTime spotDate = ScheduleCalculator.getAdjustedDate(_valuationTime, settlementDays, calendar);
final ZonedDateTime startDate = ScheduleCalculator.getAdjustedDate(spotDate, startPeriod, businessDayConvention, calendar, isEOM);
final ZonedDateTime endDate = ScheduleCalculator.getAdjustedDate(startDate, maturityPeriod, businessDayConvention, calendar, isEOM);
final double accrualFactor = dayCount.getDayCountFraction(startDate, endDate);
return new CashDefinition(currency, startDate, endDate, 1, rate, accrualFactor);
} else if (convention instanceof IborIndexConvention) {
final IborIndexConvention iborConvention = (IborIndexConvention) convention;
final Currency currency = iborConvention.getCurrency();
final Calendar calendar = CalendarUtils.getCalendar(_regionSource, _holidaySource, iborConvention.getRegionCalendar());
final BusinessDayConvention businessDayConvention = iborConvention.getBusinessDayConvention();
final boolean isEOM = iborConvention.isIsEOM();
final DayCount dayCount = iborConvention.getDayCount();
final int settlementDays = iborConvention.getSettlementDays();
final ZonedDateTime spotDate = ScheduleCalculator.getAdjustedDate(_valuationTime, settlementDays, calendar);