Class DiscountingFxSwapProductPricer


  • public class DiscountingFxSwapProductPricer
    extends java.lang.Object
    Pricer for foreign exchange swap transaction products.

    This provides the ability to price an ResolvedFxSwap.

    • Method Detail

      • presentValue

        public MultiCurrencyAmount presentValue​(ResolvedFxSwap swap,
                                                RatesProvider provider)
        Calculates the present value of the FX swap product.

        This discounts each payment on each leg in its own currency.

        Parameters:
        swap - the product
        provider - the rates provider
        Returns:
        the present value in the two natural currencies
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedFxSwap swap,
                                                          RatesProvider provider)
        Calculates the present value sensitivity of the FX swap product.

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

        Parameters:
        swap - the product
        provider - the rates provider
        Returns:
        the present value sensitivity
      • parSpread

        public double parSpread​(ResolvedFxSwap swap,
                                RatesProvider provider)
        Calculates the par spread.

        The par spread is the spread that should be added to the FX forward points to have a zero value.

        Parameters:
        swap - the product
        provider - the rates provider
        Returns:
        the spread
      • parSpreadSensitivity

        public PointSensitivities parSpreadSensitivity​(ResolvedFxSwap swap,
                                                       RatesProvider provider)
        Calculates the par spread sensitivity to the curves.

        The sensitivity is reported in the counter currency of the product, but is actually dimensionless.

        Parameters:
        swap - the product
        provider - the rates provider
        Returns:
        the spread curve sensitivity
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedFxSwap product,
                                                    RatesProvider provider)
        Calculates the currency exposure of the FX swap product.

        This discounts each payment on each leg in its own currency.

        Parameters:
        product - the product
        provider - the rates provider
        Returns:
        the currency exposure
      • currentCash

        public MultiCurrencyAmount currentCash​(ResolvedFxSwap swap,
                                               java.time.LocalDate valuationDate)
        Calculates the current cash of the FX swap product.
        Parameters:
        swap - the product
        valuationDate - the valuation date
        Returns:
        the current cash