Class DsfTradeCalculations
- java.lang.Object
-
- com.opengamma.strata.measure.dsf.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 withDsfTrade
. CallDsfTrade::resolve(ReferenceData)
to convertDsfTrade
toResolvedDsfTrade
.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.
-
-
Field Summary
Fields Modifier and Type Field Description static DsfTradeCalculations
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DsfTradeCalculations(DiscountingDsfTradePricer tradePricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiCurrencyScenarioArray
currencyExposure(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates currency exposure across one or more scenarios.MultiCurrencyAmount
currencyExposure(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates currency exposure for a single set of market data.CurrencyScenarioArray
presentValue(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value across one or more scenarios.CurrencyAmount
presentValue(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value for a single set of market data.ScenarioArray<CurrencyParameterSensitivities>
pv01CalibratedBucketed(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.CurrencyParameterSensitivities
pv01CalibratedBucketed(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.MultiCurrencyScenarioArray
pv01CalibratedSum(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.MultiCurrencyAmount
pv01CalibratedSum(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.ScenarioArray<CurrencyParameterSensitivities>
pv01MarketQuoteBucketed(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.CurrencyParameterSensitivities
pv01MarketQuoteBucketed(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.MultiCurrencyScenarioArray
pv01MarketQuoteSum(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value sensitivity across one or more scenarios.MultiCurrencyAmount
pv01MarketQuoteSum(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value sensitivity for a single set of market data.DoubleScenarioArray
unitPrice(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates unit price across one or more scenarios.double
unitPrice(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates unit price for a single set of market data.
-
-
-
Field Detail
-
DEFAULT
public static final DsfTradeCalculations DEFAULT
Default implementation.
-
-
Constructor Detail
-
DsfTradeCalculations
public DsfTradeCalculations(DiscountingDsfTradePricer tradePricer)
Creates an instance.In most cases, applications should use the
DEFAULT
instance.- Parameters:
tradePricer
- the pricer forResolvedDsfTrade
-
-
Method Detail
-
presentValue
public CurrencyScenarioArray presentValue(ResolvedDsfTrade trade, RatesMarketDataLookup lookup, ScenarioMarketData marketData)
Calculates present value across one or more scenarios.- Parameters:
trade
- the tradelookup
- the lookup used to query the market datamarketData
- the market data- Returns:
- the present value, one entry per scenario
-
presentValue
public CurrencyAmount presentValue(ResolvedDsfTrade trade, RatesProvider ratesProvider)
Calculates present value for a single set of market data.- Parameters:
trade
- the traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- 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 tradelookup
- the lookup used to query the market datamarketData
- 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 traderatesProvider
- the market data- Returns:
- the currency exposure
-
-