Class DsfTradeCalculations


  • public class DsfTradeCalculations
    extends Object
    Calculates pricing and risk measures for Deliverable Swap Future (DSF) trades.

    This provides a high-level entry point for DSF pricing and risk measures.

    Each method takes a ResolvedDsfTrade, whereas application code will typically work with DsfTrade. Call DsfTrade::resolve(ReferenceData) to convert DsfTrade to ResolvedDsfTrade.

    Price

    The price of a DSF is based on the present value (NPV) of the underlying swap on the delivery date. For example, a price of 100.182 represents a present value of $100,182.00, if the notional is $100,000. This price can also be viewed as a percentage present value - (100 + percentPv), or 0.182% in this example.

    Strata uses decimal prices for DSFs in the trade model, pricers and market data. The decimal price is based on the decimal multiplier equivalent to the implied percentage. Thus the market price of 100.182 is represented in Strata by 1.00182.

    • Constructor Detail

    • Method Detail

      • presentValue

        public CurrencyAmount presentValue​(ResolvedDsfTrade trade,
                                           RatesProvider ratesProvider)
        Calculates present value for a single set of market data.
        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value
      • pv01CalibratedSum

        public MultiCurrencyScenarioArray pv01CalibratedSum​(ResolvedDsfTrade trade,
                                                            RatesMarketDataLookup lookup,
                                                            ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01CalibratedSum

        public MultiCurrencyAmount pv01CalibratedSum​(ResolvedDsfTrade trade,
                                                     RatesProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01CalibratedBucketed

        public ScenarioArray<CurrencyParameterSensitivities> pv01CalibratedBucketed​(ResolvedDsfTrade trade,
                                                                                    RatesMarketDataLookup lookup,
                                                                                    ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01CalibratedBucketed

        public CurrencyParameterSensitivities pv01CalibratedBucketed​(ResolvedDsfTrade trade,
                                                                     RatesProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the calibrated curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01MarketQuoteSum

        public MultiCurrencyScenarioArray pv01MarketQuoteSum​(ResolvedDsfTrade trade,
                                                             RatesMarketDataLookup lookup,
                                                             ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01MarketQuoteSum

        public MultiCurrencyAmount pv01MarketQuoteSum​(ResolvedDsfTrade trade,
                                                      RatesProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is the sum of the sensitivities of all affected curves.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • pv01MarketQuoteBucketed

        public ScenarioArray<CurrencyParameterSensitivities> pv01MarketQuoteBucketed​(ResolvedDsfTrade trade,
                                                                                     RatesMarketDataLookup lookup,
                                                                                     ScenarioMarketData marketData)
        Calculates present value sensitivity across one or more scenarios.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value sensitivity, one entry per scenario
      • pv01MarketQuoteBucketed

        public CurrencyParameterSensitivities pv01MarketQuoteBucketed​(ResolvedDsfTrade trade,
                                                                      RatesProvider ratesProvider)
        Calculates present value sensitivity for a single set of market data.

        This is the sensitivity of present value to a one basis point shift in the market quotes used to calibrate the curves. The result is provided for each affected curve and currency, bucketed by curve node.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value sensitivity
      • unitPrice

        public DoubleScenarioArray unitPrice​(ResolvedDsfTrade trade,
                                             RatesMarketDataLookup lookup,
                                             ScenarioMarketData marketData)
        Calculates unit price across one or more scenarios.

        This is the price of a single unit of the security.

        Strata uses decimal prices for DSFs in the trade model, pricers and market data. The decimal price is based on the decimal multiplier equivalent to the implied percentage. Thus the market price of 100.182 is represented in Strata by 1.00182.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the present value, one entry per scenario
      • unitPrice

        public double unitPrice​(ResolvedDsfTrade trade,
                                RatesProvider ratesProvider)
        Calculates unit price for a single set of market data.

        This is the price of a single unit of the security.

        Strata uses decimal prices for DSFs in the trade model, pricers and market data. The decimal price is based on the decimal multiplier equivalent to the implied percentage. Thus the market price of 100.182 is represented in Strata by 1.00182.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the present value
      • currencyExposure

        public MultiCurrencyScenarioArray currencyExposure​(ResolvedDsfTrade trade,
                                                           RatesMarketDataLookup lookup,
                                                           ScenarioMarketData marketData)
        Calculates currency exposure across one or more scenarios.

        The currency risk, expressed as the equivalent amount in each currency.

        Parameters:
        trade - the trade
        lookup - the lookup used to query the market data
        marketData - the market data
        Returns:
        the currency exposure, one entry per scenario
      • currencyExposure

        public MultiCurrencyAmount currencyExposure​(ResolvedDsfTrade trade,
                                                    RatesProvider ratesProvider)
        Calculates currency exposure for a single set of market data.

        The currency risk, expressed as the equivalent amount in each currency.

        Parameters:
        trade - the trade
        ratesProvider - the market data
        Returns:
        the currency exposure