public class IsdaCdsProductPricer extends Object
The implementation is based on the ISDA model versions 1.8.2.
A CDS product is priced based on referenceDate.
This is typically valuation date, or settlement date if the product is associated with a Trade.
| Modifier and Type | Field and Description |
|---|---|
static IsdaCdsProductPricer |
DEFAULT
Default implementation.
|
| Constructor and Description |
|---|
IsdaCdsProductPricer(AccrualOnDefaultFormula formula)
Constructor specifying the formula to use for the accrued on default calculation.
|
| Modifier and Type | Method and Description |
|---|---|
CurrencyAmount |
expectedLoss(ResolvedCds cds,
CreditRatesProvider ratesProvider)
Calculates the expected loss of the CDS product.
|
AccrualOnDefaultFormula |
getAccrualOnDefaultFormula()
Gets the accrual-on-default formula used in this pricer.
|
JumpToDefault |
jumpToDefault(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the jump-to-default of the CDS product.
|
double |
parSpread(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the par spread of the CDS product.
|
PointSensitivityBuilder |
parSpreadSensitivity(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the par spread sensitivity of the product.
|
CurrencyAmount |
presentValue(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
PriceType priceType,
ReferenceData refData)
Calculates the present value of the CDS product.
|
PointSensitivityBuilder |
presentValueSensitivity(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the present value sensitivity of the product.
|
double |
price(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
PriceType priceType,
ReferenceData refData)
Calculates the price of the CDS product, which is the present value per unit notional.
|
PointSensitivityBuilder |
priceSensitivity(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the price sensitivity of the product.
|
double |
protectionLeg(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the price of the protection leg, which is the protection leg present value per unit notional.
|
CurrencyAmount |
recovery01(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the recovery01 of the CDS product.
|
double |
riskyAnnuity(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
PriceType priceType,
ReferenceData refData)
Calculates the risky annuity, which is RPV01 per unit notional.
|
PointSensitivityBuilder |
riskyAnnuitySensitivity(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
ReferenceData refData)
Calculates the risky annuity sensitivity of the product.
|
CurrencyAmount |
rpv01(ResolvedCds cds,
CreditRatesProvider ratesProvider,
LocalDate referenceDate,
PriceType priceType,
ReferenceData refData)
Calculates the risky PV01 of the CDS product.
|
public static final IsdaCdsProductPricer DEFAULT
public IsdaCdsProductPricer(AccrualOnDefaultFormula formula)
Options are the formula given in the ISDA model (version 1.8.2 and lower); the proposed fix by Markit (given as a comment in version 1.8.2), or the mathematically correct formula.
formula - the formulapublic AccrualOnDefaultFormula getAccrualOnDefaultFormula()
public double price(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData)
This method can calculate the clean or dirty price, see PriceType.
If calculating the clean price, the accrued interest is calculated based on the step-in date.
This is coherent with presentValue(ResolvedCds, CreditRatesProvider, LocalDate, PriceType, ReferenceData).
cds - the productratesProvider - the rates providerreferenceDate - the reference datepriceType - the price typerefData - the reference datapublic PointSensitivityBuilder priceSensitivity(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The price sensitivity of the product is the sensitivity of price to the underlying curves.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic CurrencyAmount presentValue(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData)
The present value of the product is based on referenceDate.
This is typically the valuation date, or cash settlement date if the product is associated with a Trade.
This method can calculate the clean or dirty present value, see PriceType.
If calculating the clean value, the accrued interest is calculated based on the step-in date.
cds - the productratesProvider - the rates providerreferenceDate - the reference datepriceType - the price typerefData - the reference datapublic PointSensitivityBuilder presentValueSensitivity(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The present value sensitivity of the product is the sensitivity of present value to the underlying curves.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic double parSpread(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The par spread is a coupon rate such that the clean PV is 0. The result is represented in decimal form.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic PointSensitivityBuilder parSpreadSensitivity(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The par spread sensitivity of the product is the sensitivity of par spread to the underlying curves. The resulting sensitivity is based on the currency of the CDS product.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic double protectionLeg(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic double riskyAnnuity(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData)
Zero is returned if the CDS already expired.
cds - the productratesProvider - the rates providerreferenceDate - the reference datepriceType - the price typerefData - the reference datapublic PointSensitivityBuilder riskyAnnuitySensitivity(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The risky annuity sensitivity of the product is the sensitivity of risky annuity to the underlying curves. The resulting sensitivity is based on the currency of the CDS product.
Empty sensitivity is returned if the CDS already expired.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic CurrencyAmount rpv01(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, PriceType priceType, ReferenceData refData)
RPV01 is defined as minus of the present value sensitivity to coupon rate.
cds - the productratesProvider - the rates providerreferenceDate - the reference datepriceType - the price typerefData - the reference datepublic CurrencyAmount recovery01(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The recovery01 is defined as the present value sensitivity to the recovery rate. Since the ISDA standard model requires the recovery rate to be constant throughout the lifetime of the CDS, one currency amount is returned by this method.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic JumpToDefault jumpToDefault(ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData)
The jump-to-default is the value of the product in case of immediate default.
cds - the productratesProvider - the rates providerreferenceDate - the reference daterefData - the reference datapublic CurrencyAmount expectedLoss(ResolvedCds cds, CreditRatesProvider ratesProvider)
The expected loss is the (undiscounted) expected default settlement value paid by the protection seller. The resulting value is always positive.
cds - the productratesProvider - the rates providerCopyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.