Class DiscountingFraProductPricer


  • public class DiscountingFraProductPricer
    extends java.lang.Object
    Pricer for for forward rate agreement (FRA) products.

    This provides the ability to price ResolvedFra. The product is priced using a forward curve for the index.

    • Constructor Detail

      • DiscountingFraProductPricer

        public DiscountingFraProductPricer​(RateComputationFn<RateComputation> rateComputationFn)
        Creates an instance.
        Parameters:
        rateComputationFn - the rate computation function
    • Method Detail

      • presentValue

        public CurrencyAmount presentValue​(ResolvedFra fra,
                                           RatesProvider provider)
        Calculates the present value of the FRA product.

        The present value of the product is the value on the valuation date. This is the discounted forecast value.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the present value of the product
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedFra fra,
                                                          RatesProvider provider)
        Calculates the present value sensitivity of the FRA product.

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

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the point sensitivity of the present value
      • forecastValue

        public CurrencyAmount forecastValue​(ResolvedFra fra,
                                            RatesProvider provider)
        Calculates the forecast value of the FRA product.

        The forecast value of the product is the value on the valuation date without present value discounting.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the forecast value of the product
      • forecastValueSensitivity

        public PointSensitivities forecastValueSensitivity​(ResolvedFra fra,
                                                           RatesProvider provider)
        Calculates the forecast value sensitivity of the FRA product.

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

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the point sensitivity of the forecast value
      • parRate

        public double parRate​(ResolvedFra fra,
                              RatesProvider provider)
        Calculates the par rate of the FRA product.

        The par rate is the rate for which the FRA present value is 0.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the par rate
      • parRateSensitivity

        public PointSensitivities parRateSensitivity​(ResolvedFra fra,
                                                     RatesProvider provider)
        Calculates the par rate curve sensitivity of the FRA product.

        The par rate curve sensitivity of the product is the sensitivity of the par rate to the underlying curves.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the par rate sensitivity
      • parSpread

        public double parSpread​(ResolvedFra fra,
                                RatesProvider provider)
        Calculates the par spread of the FRA product.

        This is spread to be added to the fixed rate to have a present value of 0.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the par spread
      • parSpreadSensitivity

        public PointSensitivities parSpreadSensitivity​(ResolvedFra fra,
                                                       RatesProvider provider)
        Calculates the par spread curve sensitivity of the FRA product.

        The par spread curve sensitivity of the product is the sensitivity of the par spread to the underlying curves.

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the par spread sensitivity
      • cashFlows

        public CashFlows cashFlows​(ResolvedFra fra,
                                   RatesProvider provider)
        Calculates the future cash flow of the FRA product.

        There is only one cash flow on the payment date for the FRA product. The expected currency amount of the cash flow is the same as forecastValue(ResolvedFra, RatesProvider).

        Parameters:
        fra - the product
        provider - the rates provider
        Returns:
        the cash flows
      • explainPresentValue

        public ExplainMap explainPresentValue​(ResolvedFra fra,
                                              RatesProvider provider)
        Explains the present value of the FRA product.

        This returns explanatory information about the calculation.

        Parameters:
        fra - the FRA product for which present value should be computed
        provider - the rates provider
        Returns:
        the explanatory information