Interface CreditRatesMarketDataLookup
-
- All Superinterfaces:
CalculationParameter
public interface CreditRatesMarketDataLookup extends CalculationParameter
The lookup that provides access to credit rates in market data.The credit rates market lookup provides access to credit, discount and recovery rate curves.
The lookup implements
CalculationParameter
and is used by passing it as an argument toCalculationRules
. It provides the link between the data that the function needs and the data that is available inScenarioMarketData
.Implementations of this interface must be immutable.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CreditRatesProvider
creditRatesProvider(MarketData marketData)
Obtains credit rates provider based on the specified market data.ImmutableSet<Pair<StandardId,Currency>>
getCreditLegalEntities()
Gets the set of pairs of legal entity ID and currency that credit curves are provided for.ImmutableSet<MarketDataId<?>>
getCreditMarketDataIds(StandardId standardId, Currency currency)
Gets the identifiers used to obtain the credit curve for the pair of legal entity ID and currency.ImmutableSet<Currency>
getDiscountCurrencies()
Gets the set of currencies that discount factors are provided for.ImmutableSet<MarketDataId<?>>
getDiscountMarketDataIds(Currency currency)
Gets the identifiers used to obtain the discount factors for the specified currency.ImmutableSet<StandardId>
getRecoveryRateLegalEntities()
Gets the set of legal entity IDs that recovery rate curves are provided for.ImmutableSet<MarketDataId<?>>
getRecoveryRateMarketDataIds(StandardId standardId)
Gets the identifiers used to obtain the recovery rate curve for the legal entity ID.default CreditRatesMarketData
marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.default CreditRatesScenarioMarketData
marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.static CreditRatesMarketDataLookup
of(Map<Pair<StandardId,Currency>,CurveId> creditCurveIds, Map<Currency,CurveId> discountCurveIds, Map<StandardId,CurveId> recoveryRateCurveIds)
Obtains an instance based on a maps for credit, discount and recovery rate curves.static CreditRatesMarketDataLookup
of(Map<Pair<StandardId,Currency>,CurveId> creditCurveIds, Map<Currency,CurveId> discountCurveIds, Map<StandardId,CurveId> recoveryRateCurveIds, ObservableSource observableSource)
Obtains an instance based on a maps for credit, discount and recovery rate curves.default Class<? extends CalculationParameter>
queryType()
Gets the type that the lookup will be queried by.FunctionRequirements
requirements(StandardId legalEntityId, Currency currency)
Creates market data requirements for the specified standard ID and currency.-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
filter
-
-
-
-
Method Detail
-
of
static CreditRatesMarketDataLookup of(Map<Pair<StandardId,Currency>,CurveId> creditCurveIds, Map<Currency,CurveId> discountCurveIds, Map<StandardId,CurveId> recoveryRateCurveIds)
Obtains an instance based on a maps for credit, discount and recovery rate curves.- Parameters:
creditCurveIds
- the credit curve identifiers, keyed by legal entity ID and currencydiscountCurveIds
- the discount curve identifiers, keyed by currencyrecoveryRateCurveIds
- the recovery rate curve identifiers, keyed by legal entity ID- Returns:
- the rates lookup containing the specified curves
-
of
static CreditRatesMarketDataLookup of(Map<Pair<StandardId,Currency>,CurveId> creditCurveIds, Map<Currency,CurveId> discountCurveIds, Map<StandardId,CurveId> recoveryRateCurveIds, ObservableSource observableSource)
Obtains an instance based on a maps for credit, discount and recovery rate curves.- Parameters:
creditCurveIds
- the credit curve identifiers, keyed by legal entity ID and currencydiscountCurveIds
- the discount curve identifiers, keyed by currencyrecoveryRateCurveIds
- the recovery rate curve identifiers, keyed by legal entity IDobservableSource
- the source of market data for quotes and other observable market data- Returns:
- the rates lookup containing the specified curves
-
queryType
default Class<? extends CalculationParameter> queryType()
Gets the type that the lookup will be queried by.This returns
CreditRatesMarketDataLookup.class
. When querying parameters usingCalculationParameters.findParameter(Class)
,CreditRatesMarketDataLookup.class
must be passed in to find the instance.- Specified by:
queryType
in interfaceCalculationParameter
- Returns:
- the type of the parameter implementation
-
getDiscountCurrencies
ImmutableSet<Currency> getDiscountCurrencies()
Gets the set of currencies that discount factors are provided for.- Returns:
- the set of discount curve currencies
-
getDiscountMarketDataIds
ImmutableSet<MarketDataId<?>> getDiscountMarketDataIds(Currency currency)
Gets the identifiers used to obtain the discount factors for the specified currency.In most cases, the identifier will refer to a curve. If the currency is not found, an exception is thrown.
- Parameters:
currency
- the currency for which identifiers are required- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the currency is not found
-
getCreditLegalEntities
ImmutableSet<Pair<StandardId,Currency>> getCreditLegalEntities()
Gets the set of pairs of legal entity ID and currency that credit curves are provided for.- Returns:
- the set of pairs of legal entity ID and currency
-
getCreditMarketDataIds
ImmutableSet<MarketDataId<?>> getCreditMarketDataIds(StandardId standardId, Currency currency)
Gets the identifiers used to obtain the credit curve for the pair of legal entity ID and currency.In most cases, the identifier will refer to a curve. If the pair is not found, an exception is thrown.
- Parameters:
standardId
- the legal entity IDcurrency
- the currency- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the pair is not found
-
getRecoveryRateLegalEntities
ImmutableSet<StandardId> getRecoveryRateLegalEntities()
Gets the set of legal entity IDs that recovery rate curves are provided for.- Returns:
- the set of legal entity IDs
-
getRecoveryRateMarketDataIds
ImmutableSet<MarketDataId<?>> getRecoveryRateMarketDataIds(StandardId standardId)
Gets the identifiers used to obtain the recovery rate curve for the legal entity ID.In most cases, the identifier will refer to a curve. If the ID is not found, an exception is thrown.
- Parameters:
standardId
- the legal entity ID- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the ID is not found
-
requirements
FunctionRequirements requirements(StandardId legalEntityId, Currency currency)
Creates market data requirements for the specified standard ID and currency.- Parameters:
legalEntityId
- legal entity IDcurrency
- the currency- Returns:
- the requirements
- Throws:
IllegalArgumentException
- if unable to create requirements
-
marketDataView
default CreditRatesScenarioMarketData marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.This method returns an instance that binds the lookup to the market data. The input is
ScenarioMarketData
, which contains market data for all scenarios.- Parameters:
marketData
- the complete set of market data for all scenarios- Returns:
- the filtered market data
-
marketDataView
default CreditRatesMarketData marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.This method returns an instance that binds the lookup to the market data. The input is
MarketData
, which contains market data for one scenario.- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the filtered market data
-
creditRatesProvider
CreditRatesProvider creditRatesProvider(MarketData marketData)
Obtains credit rates provider based on the specified market data.This provides
CreditRatesProvider
suitable for pricing credit products. Although this method can be used directly, it is typically invoked indirectly viaCreditRatesMarketData
:// bind the baseData to this lookup CreditRatesMarketData view = lookup.marketView(baseData); // pass around CreditRatesMarketData within the function to use in pricing CreditRatesProvider provider = view.creditRatesProvider();
- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the rates provider
-
-