Class DiscountingFxSwapTradePricer


  • public class DiscountingFxSwapTradePricer
    extends Object
    Pricer for foreign exchange swap transaction trades.

    This provides the ability to price an ResolvedFxSwapTrade.

    • Method Detail

      • presentValue

        public MultiCurrencyAmount presentValue​(ResolvedFxSwapTrade trade,
                                                RatesProvider provider)
        Calculates the present value of the trade.

        The present value of the trade is the value on the valuation date. The present value is returned in the settlement currency.

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the present value of the trade in the settlement currency
      • presentValueSensitivity

        public PointSensitivities presentValueSensitivity​(ResolvedFxSwapTrade trade,
                                                          RatesProvider provider)
        Calculates the present value curve sensitivity of the trade.

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

        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the point sensitivity of the present value
      • parSpread

        public double parSpread​(ResolvedFxSwapTrade trade,
                                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:
        trade - the trade
        provider - the rates provider
        Returns:
        the spread
      • parSpreadSensitivity

        public PointSensitivities parSpreadSensitivity​(ResolvedFxSwapTrade trade,
                                                       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:
        trade - the trade
        provider - the rates provider
        Returns:
        the spread curve sensitivity
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedFxSwapTrade trade,
                                                    RatesProvider provider)
        Calculates the currency exposure by discounting each payment in its own currency.
        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the currency exposure
      • currentCash

        public MultiCurrencyAmount currentCash​(ResolvedFxSwapTrade trade,
                                               RatesProvider provider)
        Calculates the current cash of the trade.
        Parameters:
        trade - the trade
        provider - the rates provider
        Returns:
        the current cash of the trade in the settlement currency