class BillTotalReturnSwapDefinition extends TotalReturnSwapDefinition {

  @Override
  public BillTotalReturnSwap toDerivative(final ZonedDateTime date, final ZonedDateTimeDoubleTimeSeries data) {
    final double effectiveTime = TimeCalculator.getTimeBetween(date, getEffectiveDate());
    final double terminationTime = TimeCalculator.getTimeBetween(date, getTerminationDate());
    final Annuity<? extends Payment> fundingLeg = getFundingLeg().toDerivative(date, data);
    BillSecurity bill = getAsset().toDerivative(date, getEffectiveDate());
    return new BillTotalReturnSwap(effectiveTime, terminationTime, fundingLeg, bill, _quantity);
  }

  public  BillTotalReturnSwapDefinition(final ZonedDateTime effectiveDate, final ZonedDateTime terminationDate,
      final AnnuityDefinition<? extends PaymentDefinition> annuity,
      final BillSecurityDefinition bill, final double quantity);

}