class BillTransactionDefinition implements InstrumentDefinition<BillTransaction> {

  public static BillTransactionDefinition fromYield(final BillSecurityDefinition underlying, final double quantity, final ZonedDateTime settlementDate, final double yield,
      final Calendar calendar) {
    ArgumentChecker.notNull(underlying, "Underlying");
    ArgumentChecker.notNull(settlementDate, "Settlement date");
    final double accrualFactor = underlying.getDayCount().getDayCountFraction(settlementDate, underlying.getEndDate(), calendar);
    final double settlementAmount = -quantity * underlying.getNotional() * PriceFromYieldCalculator.priceFromYield(underlying.getYieldConvention(), yield, accrualFactor);
    return new BillTransactionDefinition(underlying, quantity, settlementDate, settlementAmount);
  }

  public  BillTransactionDefinition(final BillSecurityDefinition underlying, final double quantity, final ZonedDateTime settlementDate, final double settlementAmount);

}