Interface LegalEntityDiscountingProvider
-
- All Known Implementing Classes:
ImmutableLegalEntityDiscountingProvider
public interface LegalEntityDiscountingProvider
A provider of data for bond pricing, based on repo and issuer discounting.This provides the environmental information against which bond pricing occurs, which is the repo and issuer curves. If the bond is inflation linked, the price index data is obtained from
RatesProvider
.The standard independent implementation is
ImmutableLegalEntityDiscountingProvider
.All implementations of this interface must be immutable and thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
data(MarketDataId<T> id)
Gets market data of a specific type.<T> Optional<T>
findData(MarketDataName<T> name)
Finds the market data with the specified name.LocalDate
getValuationDate()
Gets the valuation date.IssuerCurveDiscountFactors
issuerCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Gets the discount factors from an issuer based on the issuer ID and currency.CurrencyParameterSensitivities
parameterSensitivity(PointSensitivities pointSensitivities)
Computes the parameter sensitivity.RepoCurveDiscountFactors
repoCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Gets the discount factors from a repo curve based on the issuer ID and currency.RepoCurveDiscountFactors
repoCurveDiscountFactors(SecurityId securityId, LegalEntityId issuerId, Currency currency)
Gets the discount factors from a repo curve based on the security ID, issuer ID and currency.ImmutableLegalEntityDiscountingProvider
toImmutableLegalEntityDiscountingProvider()
Converts this provider to an equivalentImmutableLegalEntityDiscountingProvider
.
-
-
-
Method Detail
-
getValuationDate
LocalDate getValuationDate()
Gets the valuation date.The raw data in this provider is calibrated for this date.
- Returns:
- the valuation date
-
repoCurveDiscountFactors
RepoCurveDiscountFactors repoCurveDiscountFactors(SecurityId securityId, LegalEntityId issuerId, Currency currency)
Gets the discount factors from a repo curve based on the security ID, issuer ID and currency.This searches first for a curve associated with the security iD and currency, and then for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Parameters:
securityId
- the standard ID of security to get the discount factors forissuerId
- the standard ID of legal entity to get the discount factors forcurrency
- the currency to get the discount factors for- Returns:
- the discount factors
- Throws:
IllegalArgumentException
- if the discount factors are not available
-
repoCurveDiscountFactors
RepoCurveDiscountFactors repoCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Gets the discount factors from a repo curve based on the issuer ID and currency.This searches for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Parameters:
issuerId
- the standard ID of legal entity to get the discount factors forcurrency
- the currency to get the discount factors for- Returns:
- the discount factors
- Throws:
IllegalArgumentException
- if the discount factors are not available
-
issuerCurveDiscountFactors
IssuerCurveDiscountFactors issuerCurveDiscountFactors(LegalEntityId issuerId, Currency currency)
Gets the discount factors from an issuer based on the issuer ID and currency.This searches for a curve associated with the issuer ID and currency.
If the valuation date is on or after the specified date, the discount factor is 1.
- Parameters:
issuerId
- the standard ID to get the discount factors forcurrency
- the currency to get the discount factors for- Returns:
- the discount factors
- Throws:
IllegalArgumentException
- if the discount factors are not available
-
parameterSensitivity
CurrencyParameterSensitivities parameterSensitivity(PointSensitivities pointSensitivities)
Computes the parameter sensitivity.This computes the
CurrencyParameterSensitivities
associated with thePointSensitivities
. This corresponds to the projection of the point sensitivity to the curve internal parameters representation.This method handles
RepoCurveZeroRateSensitivity
andIssuerCurveZeroRateSensitivity
. For other sensitivity objects, seeRatesProvider.parameterSensitivity(PointSensitivities)
.- Parameters:
pointSensitivities
- the point sensitivity- Returns:
- the sensitivity to the curve parameters
-
data
<T> T data(MarketDataId<T> id)
Gets market data of a specific type.This is a general purpose mechanism to obtain market data. In general, it is desirable to pass the specific market data needed for pricing into the pricing method. However, in some cases, notably swaps, this is not feasible. It is strongly recommended to clearly state on pricing methods what data is required.
- Type Parameters:
T
- the type of the value- Parameters:
id
- the identifier to find- Returns:
- the data associated with the key
- Throws:
IllegalArgumentException
- if the data is not available
-
findData
<T> Optional<T> findData(MarketDataName<T> name)
Finds the market data with the specified name.This is most commonly used to find a
Curve
using aCurveName
. If the market data cannot be found, empty is returned.- Type Parameters:
T
- the type of the market data value- Parameters:
name
- the name to find- Returns:
- the market data value, empty if not found
-
toImmutableLegalEntityDiscountingProvider
ImmutableLegalEntityDiscountingProvider toImmutableLegalEntityDiscountingProvider()
Converts this provider to an equivalentImmutableLegalEntityDiscountingProvider
.- Returns:
- the equivalent immutable legal entity provider
-
-