• java.lang.Object

• public class DiscountingBillTradePricer
extends java.lang.Object

This function provides the ability to price a ResolvedBillTrade.

• ### Field Summary

Fields
Modifier and Type Field Description
static DiscountingBillTradePricer DEFAULT
Default implementation.
• ### Constructor Summary

Constructors
Constructor Description
DiscountingBillTradePricer​(DiscountingBillProductPricer productPricer, DiscountingPaymentPricer paymentPricer)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method Description
MultiCurrencyAmount currencyExposure​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the currency exposure of a bill trade.
MultiCurrencyAmount currencyExposureWithZSpread​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
CurrencyAmount currentCash​(ResolvedBillTrade trade, java.time.LocalDate valuationDate)
Calculates the current cash of a bill trade.
CurrencyAmount presentValue​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value of a bill trade.
PointSensitivities presentValueSensitivity​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of a bill trade.
PointSensitivities presentValueSensitivityWithZSpread​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
CurrencyAmount presentValueWithZSpread​(ResolvedBillTrade trade, LegalEntityDiscountingProvider provider, double zSpread, CompoundedRateType compoundedRateType, int periodsPerYear)
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### DEFAULT

public static final DiscountingBillTradePricer DEFAULT
Default implementation.
• ### Constructor Detail

public DiscountingBillTradePricer​(DiscountingBillProductPricer productPricer,
DiscountingPaymentPricer paymentPricer)
Creates an instance.
Parameters:
productPricer - the pricer for ResolvedBill
paymentPricer - the pricer for Payment
• ### Method Detail

• #### presentValue

public CurrencyAmount presentValue​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider)
Calculates the present value of a bill trade.

If the settlement details are provided, the present value is the sum of the underlying product's present value multiplied by the quantity and the present value of the settlement payment if still due at the valuation date. If not it is the underlying product's present value multiplied by the quantity.

Parameters:
trade - the trade
provider - the discounting provider
Returns:
the present value

public CurrencyAmount presentValueWithZSpread​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider,
CompoundedRateType compoundedRateType,
int periodsPerYear)

If the settlement details are provided, the present value is the sum of the underlying product's present value multiplied by the quantity and the present value of the settlement payment if still due at the valuation date. If not it is the underlying product's present value multiplied by the quantity.

The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve. The z-spread is applied only on the legal entity curve, not on the repo curve used for the settlement amount.

Parameters:
trade - the trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - the number of periods per year
Returns:
the present value
• #### presentValueSensitivity

public PointSensitivities presentValueSensitivity​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider)
Calculates the present value sensitivity of a bill trade.

If the settlement details are provided, the sensitivity is the sum of the underlying product's sensitivity multiplied by the quantity and the sensitivity of the settlement payment if still due at the valuation date. If not it is the underlying product's sensitivity multiplied by the quantity.

Parameters:
trade - the trade
provider - the discounting provider
Returns:
the present value sensitivity

public PointSensitivities presentValueSensitivityWithZSpread​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider,
CompoundedRateType compoundedRateType,
int periodsPerYear)

If the settlement details are provided, the sensitivity is the sum of the underlying product's sensitivity multiplied by the quantity and the sensitivity of the settlement payment if still due at the valuation date. If not it is the underlying product's sensitivity multiplied by the quantity.

The z-spread is a parallel shift applied to continuously compounded rates or periodic compounded rates of the issuer discounting curve. The z-spread is applied only on the legal entity curve, not on the repo curve used for the settlement amount.

Parameters:
trade - the trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - the number of periods per year
Returns:
the present value sensitivity
• #### currencyExposure

public MultiCurrencyAmount currencyExposure​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider)
Calculates the currency exposure of a bill trade.
Parameters:
trade - the trade
provider - the discounting provider
Returns:
the currency exposure

public MultiCurrencyAmount currencyExposureWithZSpread​(ResolvedBillTrade trade,
LegalEntityDiscountingProvider provider,
CompoundedRateType compoundedRateType,
int periodsPerYear)
Parameters:
trade - the trade
provider - the discounting provider
zSpread - the z-spread
compoundedRateType - the compounded rate type
periodsPerYear - the number of periods per year
Returns:
the currency exposure
• #### currentCash

public CurrencyAmount currentCash​(ResolvedBillTrade trade,
java.time.LocalDate valuationDate)
Calculates the current cash of a bill trade.
Parameters:
trade - the trade
valuationDate - the valuation date
Returns:
the current cash amount