Class DiscountingFraTradePricer
- java.lang.Object
-
- com.opengamma.strata.pricer.fra.DiscountingFraTradePricer
-
public class DiscountingFraTradePricer extends Object
Pricer for for forward rate agreement (FRA) trades.This provides the ability to price
ResolvedFraTrade
. The trade is priced by pricing the underlying product using a forward curve for the index.
-
-
Field Summary
Fields Modifier and Type Field Description static DiscountingFraTradePricer
DEFAULT
Default implementation.
-
Constructor Summary
Constructors Constructor Description DiscountingFraTradePricer(DiscountingFraProductPricer productPricer)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CashFlows
cashFlows(ResolvedFraTrade trade, RatesProvider provider)
Calculates the future cash flow of the FRA trade.MultiCurrencyAmount
currencyExposure(ResolvedFraTrade trade, RatesProvider provider)
Calculates the currency exposure of the FRA trade.CurrencyAmount
currentCash(ResolvedFraTrade trade, RatesProvider provider)
Calculates the current cash of the FRA trade.ExplainMap
explainPresentValue(ResolvedFraTrade trade, RatesProvider provider)
Explains the present value of the FRA product.CurrencyAmount
forecastValue(ResolvedFraTrade trade, RatesProvider provider)
Calculates the forecast value of the FRA trade.PointSensitivities
forecastValueSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the forecast value sensitivity of the FRA trade.DiscountingFraProductPricer
getProductPricer()
Gets the underlying product pricer.double
parRate(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par rate of the FRA trade.PointSensitivities
parRateSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par rate curve sensitivity of the FRA trade.double
parSpread(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par spread of the FRA trade.PointSensitivities
parSpreadSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par spread curve sensitivity of the FRA trade.CurrencyAmount
presentValue(ResolvedFraTrade trade, RatesProvider provider)
Calculates the present value of the FRA trade.PointSensitivities
presentValueSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the present value sensitivity of the FRA trade.
-
-
-
Field Detail
-
DEFAULT
public static final DiscountingFraTradePricer DEFAULT
Default implementation.
-
-
Constructor Detail
-
DiscountingFraTradePricer
public DiscountingFraTradePricer(DiscountingFraProductPricer productPricer)
Creates an instance.- Parameters:
productPricer
- the pricer forResolvedFra
-
-
Method Detail
-
getProductPricer
public DiscountingFraProductPricer getProductPricer()
Gets the underlying product pricer.- Returns:
- the product pricer
-
presentValue
public CurrencyAmount presentValue(ResolvedFraTrade trade, RatesProvider provider)
Calculates the present value of the FRA trade.The present value of the trade is the value on the valuation date. This is the discounted forecast value.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the present value of the trade
-
explainPresentValue
public ExplainMap explainPresentValue(ResolvedFraTrade trade, RatesProvider provider)
Explains the present value of the FRA product.This returns explanatory information about the calculation.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the explanatory information
-
presentValueSensitivity
public PointSensitivities presentValueSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the present value sensitivity of the FRA trade.The present value sensitivity of the trade is the sensitivity of the present value to the underlying curves.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the point sensitivity of the present value
-
forecastValue
public CurrencyAmount forecastValue(ResolvedFraTrade trade, RatesProvider provider)
Calculates the forecast value of the FRA trade.The forecast value of the trade is the value on the valuation date without present value discounting.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the forecast value of the trade
-
forecastValueSensitivity
public PointSensitivities forecastValueSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the forecast value sensitivity of the FRA trade.The forecast value sensitivity of the product is the sensitivity of the forecast value to the underlying curves.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the point sensitivity of the forecast value
-
parRate
public double parRate(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par rate of the FRA trade.The par rate is the rate for which the FRA present value is 0.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the par rate
-
parRateSensitivity
public PointSensitivities parRateSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par rate curve sensitivity of the FRA trade.The par rate curve sensitivity of the product is the sensitivity of the par rate to the underlying curves.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the par rate sensitivity
-
parSpread
public double parSpread(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par spread of the FRA trade.This is spread to be added to the fixed rate to have a present value of 0.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the par spread
-
parSpreadSensitivity
public PointSensitivities parSpreadSensitivity(ResolvedFraTrade trade, RatesProvider provider)
Calculates the par spread curve sensitivity of the FRA trade.The par spread curve sensitivity of the product is the sensitivity of the par spread to the underlying curves.
- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the par spread sensitivity
-
cashFlows
public CashFlows cashFlows(ResolvedFraTrade trade, RatesProvider provider)
Calculates the future cash flow of the FRA trade.There is only one cash flow on the payment date for the FRA trade. The expected currency amount of the cash flow is the same as
forecastValue(ResolvedFraTrade, RatesProvider)
.- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the cash flows
-
currencyExposure
public MultiCurrencyAmount currencyExposure(ResolvedFraTrade trade, RatesProvider provider)
Calculates the currency exposure of the FRA trade.- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the currency exposure
-
currentCash
public CurrencyAmount currentCash(ResolvedFraTrade trade, RatesProvider provider)
Calculates the current cash of the FRA trade.- Parameters:
trade
- the tradeprovider
- the rates provider- Returns:
- the current cash
-
-