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