public interface RatesMarketDataLookup extends FxRateLookup, CalculationParameter
The rates market lookup provides access to discount curves and forward curves. This includes Ibor index rates, Overnight index rates, Price index rates, FX rates and discounting.
The lookup implements CalculationParameter and is used by passing it
as an argument to CalculationRules. It provides the link between the
data that the function needs and the data that is available in ScenarioMarketData.
Implementations of this interface must be immutable.
| Modifier and Type | Method and Description |
|---|---|
FxRateProvider |
fxRateProvider(MarketData marketData)
Obtains an FX rate provider based on the specified market data.
|
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<Index> |
getForwardIndices()
Gets the set of indices that forward rates are provided for.
|
ImmutableSet<MarketDataId<?>> |
getForwardMarketDataIds(Index index)
Gets the identifiers used to obtain the forward rates for the specified index.
|
default FxRateLookup |
getFxRateLookup()
Gets the underlying FX lookup.
|
default ObservableSource |
getObservableSource()
Gets the observable source.
|
default RatesMarketData |
marketDataView(MarketData marketData)
Obtains a filtered view of the complete set of market data.
|
default RatesScenarioMarketData |
marketDataView(ScenarioMarketData marketData)
Obtains a filtered view of the complete set of market data.
|
static RatesMarketDataLookup |
of(CurveGroupName groupName,
Map<Currency,CurveName> discountCurves,
Map<? extends Index,CurveName> forwardCurves)
Obtains an instance based on a group of discount and forward curves.
|
static RatesMarketDataLookup |
of(Map<Currency,CurveId> discountCurveIds,
Map<Index,CurveId> forwardCurveIds)
Obtains an instance based on a map of discount and forward curve identifiers.
|
static RatesMarketDataLookup |
of(Map<Currency,CurveId> discountCurveIds,
Map<Index,CurveId> forwardCurveIds,
ObservableSource obsSource,
FxRateLookup fxLookup)
Obtains an instance based on a map of discount and forward curve identifiers,
specifying the source of FX rates.
|
static RatesMarketDataLookup |
of(RatesCurveGroup curveGroup)
Obtains an instance based on a curve group.
|
static RatesMarketDataLookup |
of(RatesCurveGroupDefinition curveGroupDefinition)
Obtains an instance based on a curve group definition.
|
static RatesMarketDataLookup |
of(RatesCurveGroupDefinition curveGroupDefinition,
ObservableSource observableSource,
FxRateLookup fxLookup)
Obtains an instance based on a curve group definition.
|
default Class<? extends CalculationParameter> |
queryType()
Gets the type that the lookup will be queried by.
|
RatesProvider |
ratesProvider(MarketData marketData)
Obtains a rates provider based on the specified market data.
|
default FunctionRequirements |
requirements(Currency currency,
Index... indices)
Creates market data requirements for the specified currency and indices.
|
default FunctionRequirements |
requirements(Set<Currency> currencies)
Creates market data requirements for the specified currencies.
|
FunctionRequirements |
requirements(Set<Currency> currencies,
Set<? extends Index> indices)
Creates market data requirements for the specified currencies and indices.
|
ofMatrix, ofMatrix, ofRates, ofRates, ofRates, ofRatesfilterstatic RatesMarketDataLookup of(Map<Currency,CurveId> discountCurveIds, Map<Index,CurveId> forwardCurveIds)
The discount and forward curves refer to the curve identifier.
The curves themselves are provided in ScenarioMarketData
using CurveId as the identifier.
discountCurveIds - the discount curve identifiers, keyed by currencyforwardCurveIds - the forward curves identifiers, keyed by indexstatic RatesMarketDataLookup of(Map<Currency,CurveId> discountCurveIds, Map<Index,CurveId> forwardCurveIds, ObservableSource obsSource, FxRateLookup fxLookup)
The discount and forward curves refer to the curve identifier.
The curves themselves are provided in ScenarioMarketData
using CurveId as the identifier.
The source of market data is rarely needed, as most applications use only one
underlying data source.
discountCurveIds - the discount curve identifiers, keyed by currencyforwardCurveIds - the forward curves identifiers, keyed by indexobsSource - the source of market data for quotes and other observable market datafxLookup - the lookup used to obtain FX ratesstatic RatesMarketDataLookup of(CurveGroupName groupName, Map<Currency,CurveName> discountCurves, Map<? extends Index,CurveName> forwardCurves)
The discount and forward curves refer to the curve name.
The curves themselves are provided in ScenarioMarketData
using CurveId as the identifier.
groupName - the curve group namediscountCurves - the discount curves, keyed by currencyforwardCurves - the forward curves, keyed by indexstatic RatesMarketDataLookup of(RatesCurveGroup curveGroup)
The discount curves and forward curves from the group are extracted and used to build the lookup.
curveGroup - the curve group to base the lookup onstatic RatesMarketDataLookup of(RatesCurveGroupDefinition curveGroupDefinition)
The discount curves and forward curves from the group are extracted and used to build the lookup.
curveGroupDefinition - the curve group to base the lookup onstatic RatesMarketDataLookup of(RatesCurveGroupDefinition curveGroupDefinition, ObservableSource observableSource, FxRateLookup fxLookup)
The discount curves and forward curves from the group are extracted and used to build the lookup.
curveGroupDefinition - the curve group to base the lookup onobservableSource - the source of market data for quotes and other observable market datafxLookup - the lookup used to obtain FX ratesdefault Class<? extends CalculationParameter> queryType()
This returns RatesMarketLookup.class.
When querying parameters using CalculationParameters.findParameter(Class),
RatesMarketLookup.class must be passed in to find the instance.
queryType in interface CalculationParameterqueryType in interface FxRateLookupImmutableSet<Currency> getDiscountCurrencies()
ImmutableSet<MarketDataId<?>> getDiscountMarketDataIds(Currency currency)
In most cases, the identifier will refer to a curve. If the currency is not found, an exception is thrown.
currency - the currency for which identifiers are requiredIllegalArgumentException - if the currency is not foundImmutableSet<Index> getForwardIndices()
ImmutableSet<MarketDataId<?>> getForwardMarketDataIds(Index index)
In most cases, the identifier will refer to a curve. If the index is not found, an exception is thrown.
index - the index for which identifiers are requiredIllegalArgumentException - if the index is not founddefault FunctionRequirements requirements(Set<Currency> currencies)
This is used when discount factors are required, but forward curves are not.
currencies - the currencies, for which discount factors will be neededIllegalArgumentException - if unable to create requirementsdefault FunctionRequirements requirements(Currency currency, Index... indices)
currency - the currency, for which discount factors are neededindices - the indices, for which forward curves and time-series will be neededIllegalArgumentException - if unable to create requirementsFunctionRequirements requirements(Set<Currency> currencies, Set<? extends Index> indices)
currencies - the currencies, for which discount factors will be neededindices - the indices, for which forward curves and time-series will be neededIllegalArgumentException - if unable to create requirementsdefault RatesScenarioMarketData marketDataView(ScenarioMarketData marketData)
This method returns an instance that binds the lookup to the market data.
The input is ScenarioMarketData, which contains market data for all scenarios.
marketData - the complete set of market data for all scenariosdefault RatesMarketData marketDataView(MarketData marketData)
This method returns an instance that binds the lookup to the market data.
The input is MarketData, which contains market data for one scenario.
marketData - the complete set of market data for one scenarioRatesProvider ratesProvider(MarketData marketData)
This provides a RatesProvider suitable for pricing a rates product.
Although this method can be used directly, it is typically invoked indirectly
via RatesMarketData:
// bind the baseData to this lookup RatesMarketData view = lookup.marketView(baseData); // pass around RatesMarketData within the function to use in pricing RatesProvider provider = view.ratesProvider();
marketData - the complete set of market data for one scenarioFxRateProvider fxRateProvider(MarketData marketData)
This provides an FxRateProvider suitable for obtaining FX rates.
Although this method can be used directly, it is typically invoked indirectly
via RatesMarketData:
// bind the baseData to this lookup RatesMarketData view = lookup.marketView(baseData); // pass around RatesMarketData within the function to use in pricing RatesProvider provider = view.fxRateProvider();
fxRateProvider in interface FxRateLookupmarketData - the complete set of market data for one scenariodefault ObservableSource getObservableSource()
default FxRateLookup getFxRateLookup()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.