Class DiscountingBillProductPricer


  • public class DiscountingBillProductPricer
    extends Object
    Pricer for bill products.

    This function provides the ability to price a ResolvedBill.

    • Constructor Detail

      • DiscountingBillProductPricer

        public DiscountingBillProductPricer()
    • Method Detail

      • presentValue

        public CurrencyAmount presentValue​(ResolvedBill bill,
                                           LegalEntityDiscountingProvider provider)
        Calculates the present value of the bill product.

        The present value of the product is the value on the valuation date. The result is expressed using the payment currency of the bill.

        Coupon payments of the product are considered based on the valuation date.

        Parameters:
        bill - the product
        provider - the discounting provider
        Returns:
        the present value of the bill product
      • presentValueWithZSpread

        public CurrencyAmount presentValueWithZSpread​(ResolvedBill bill,
                                                      LegalEntityDiscountingProvider provider,
                                                      double zSpread,
                                                      CompoundedRateType compoundedRateType,
                                                      int periodsPerYear)
        Calculates the present value of a bill product with z-spread.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.

        Parameters:
        bill - the product
        provider - the discounting provider
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the present value of the bill product
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedBill bill,
                                                          LegalEntityDiscountingProvider provider)
        Calculates the present value sensitivity of the bill product.

        The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.

        Parameters:
        bill - the product
        provider - the discounting provider
        Returns:
        the present value curve sensitivity of the product
      • presentValueSensitivityWithZSpread

        public PointSensitivities presentValueSensitivityWithZSpread​(ResolvedBill bill,
                                                                     LegalEntityDiscountingProvider provider,
                                                                     double zSpread,
                                                                     CompoundedRateType compoundedRateType,
                                                                     int periodsPerYear)
        Calculates the present value sensitivity of the bill product with z-spread.

        The present value sensitivity of the product is the sensitivity of the present value to the underlying curves.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.

        Parameters:
        bill - the product
        provider - the discounting provider
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the present value curve sensitivity of the product
      • priceFromCurves

        public double priceFromCurves​(ResolvedBill bill,
                                      LegalEntityDiscountingProvider provider,
                                      LocalDate settlementDate)
        Calculates the price for settlement at a given settlement date using curves.
        Parameters:
        bill - the bill
        provider - the discounting provider
        settlementDate - the settlement date
        Returns:
        the price
      • priceFromCurvesWithZSpread

        public double priceFromCurvesWithZSpread​(ResolvedBill bill,
                                                 LegalEntityDiscountingProvider provider,
                                                 LocalDate settlementDate,
                                                 double zSpread,
                                                 CompoundedRateType compoundedRateType,
                                                 int periodsPerYear)
        Calculates the price for settlement at a given settlement date using curves with z-spread.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.

        The z-spread is applied only on the legal entity curve, not on the repo curve.

        Parameters:
        bill - the bill
        provider - the discounting provider
        settlementDate - the settlement date
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the price
      • yieldFromCurves

        public double yieldFromCurves​(ResolvedBill bill,
                                      LegalEntityDiscountingProvider provider,
                                      LocalDate settlementDate)
        Calculates the yield for settlement at a given settlement date using curves.
        Parameters:
        bill - the bill
        provider - the discounting provider
        settlementDate - the settlement date
        Returns:
        the yield
      • yieldFromCurvesWithZSpread

        public double yieldFromCurvesWithZSpread​(ResolvedBill bill,
                                                 LegalEntityDiscountingProvider provider,
                                                 LocalDate settlementDate,
                                                 double zSpread,
                                                 CompoundedRateType compoundedRateType,
                                                 int periodsPerYear)
        Calculates the yield for settlement at a given settlement date using curves with z-spread.

        The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve.

        The z-spread is applied only on the legal entity curve, not on the repo curve.

        Parameters:
        bill - the bill
        provider - the discounting provider
        settlementDate - the settlement date
        zSpread - the z-spread
        compoundedRateType - the compounded rate type
        periodsPerYear - the number of periods per year
        Returns:
        the yield