Interface RatesMarketDataLookup
-
- All Superinterfaces:
CalculationParameter
,FxRateLookup
public interface RatesMarketDataLookup extends FxRateLookup, CalculationParameter
The lookup that provides access to rates in market data.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 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 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(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.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.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.-
Methods inherited from interface com.opengamma.strata.calc.runner.CalculationParameter
filter
-
-
-
-
Method Detail
-
of
static RatesMarketDataLookup of(Map<Currency,CurveId> discountCurveIds, Map<Index,CurveId> forwardCurveIds)
Obtains an instance based on a map of discount and forward curve identifiers.The discount and forward curves refer to the curve identifier. The curves themselves are provided in
ScenarioMarketData
usingCurveId
as the identifier.- Parameters:
discountCurveIds
- the discount curve identifiers, keyed by currencyforwardCurveIds
- the forward curves identifiers, keyed by index- Returns:
- the rates lookup containing the specified curves
-
of
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.The discount and forward curves refer to the curve identifier. The curves themselves are provided in
ScenarioMarketData
usingCurveId
as the identifier. The source of market data is rarely needed, as most applications use only one underlying data source.- Parameters:
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 rates- Returns:
- the rates lookup containing the specified curves
-
of
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.The discount and forward curves refer to the curve name. The curves themselves are provided in
ScenarioMarketData
usingCurveId
as the identifier.- Parameters:
groupName
- the curve group namediscountCurves
- the discount curves, keyed by currencyforwardCurves
- the forward curves, keyed by index- Returns:
- the rates lookup containing the specified curves
-
of
static RatesMarketDataLookup of(RatesCurveGroup curveGroup)
Obtains an instance based on a curve group.The discount curves and forward curves from the group are extracted and used to build the lookup.
- Parameters:
curveGroup
- the curve group to base the lookup on- Returns:
- the rates lookup based on the specified group
-
of
static RatesMarketDataLookup of(RatesCurveGroupDefinition curveGroupDefinition)
Obtains an instance based on a curve group definition.The discount curves and forward curves from the group are extracted and used to build the lookup.
- Parameters:
curveGroupDefinition
- the curve group to base the lookup on- Returns:
- the rates lookup based on the specified group
-
of
static RatesMarketDataLookup of(RatesCurveGroupDefinition curveGroupDefinition, ObservableSource observableSource, FxRateLookup fxLookup)
Obtains an instance based on a curve group definition.The discount curves and forward curves from the group are extracted and used to build the lookup.
- Parameters:
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 rates- Returns:
- the rates lookup based on the specified group
-
queryType
default Class<? extends CalculationParameter> queryType()
Gets the type that the lookup will be queried by.This returns
RatesMarketLookup.class
. When querying parameters usingCalculationParameters.findParameter(Class)
,RatesMarketLookup.class
must be passed in to find the instance.- Specified by:
queryType
in interfaceCalculationParameter
- Specified by:
queryType
in interfaceFxRateLookup
- 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
-
getForwardIndices
ImmutableSet<Index> getForwardIndices()
Gets the set of indices that forward rates are provided for.- Returns:
- the set of forward curve indices
-
getForwardMarketDataIds
ImmutableSet<MarketDataId<?>> getForwardMarketDataIds(Index index)
Gets the identifiers used to obtain the forward rates for the specified index.In most cases, the identifier will refer to a curve. If the index is not found, an exception is thrown.
- Parameters:
index
- the index for which identifiers are required- Returns:
- the set of market data identifiers
- Throws:
IllegalArgumentException
- if the index is not found
-
requirements
default FunctionRequirements requirements(Set<Currency> currencies)
Creates market data requirements for the specified currencies.This is used when discount factors are required, but forward curves are not.
- Parameters:
currencies
- the currencies, for which discount factors will be needed- Returns:
- the requirements
- Throws:
IllegalArgumentException
- if unable to create requirements
-
requirements
default FunctionRequirements requirements(Currency currency, Index... indices)
Creates market data requirements for the specified currency and indices.- Parameters:
currency
- the currency, for which discount factors are neededindices
- the indices, for which forward curves and time-series will be needed- Returns:
- the requirements
- Throws:
IllegalArgumentException
- if unable to create requirements
-
requirements
FunctionRequirements requirements(Set<Currency> currencies, Set<? extends Index> indices)
Creates market data requirements for the specified currencies and indices.- Parameters:
currencies
- the currencies, for which discount factors will be neededindices
- the indices, for which forward curves and time-series will be needed- Returns:
- the requirements
- Throws:
IllegalArgumentException
- if unable to create requirements
-
marketDataView
default RatesScenarioMarketData 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 RatesMarketData 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
-
ratesProvider
RatesProvider ratesProvider(MarketData marketData)
Obtains a rates provider based on the specified market data.This provides a
RatesProvider
suitable for pricing a rates product. Although this method can be used directly, it is typically invoked indirectly viaRatesMarketData
:// 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();
- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the rates provider
-
fxRateProvider
FxRateProvider fxRateProvider(MarketData marketData)
Obtains an FX rate provider based on the specified market data.This provides an
FxRateProvider
suitable for obtaining FX rates. Although this method can be used directly, it is typically invoked indirectly viaRatesMarketData
:// 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();
- Specified by:
fxRateProvider
in interfaceFxRateLookup
- Parameters:
marketData
- the complete set of market data for one scenario- Returns:
- the FX rate provider
-
getObservableSource
default ObservableSource getObservableSource()
Gets the observable source.- Returns:
- the observable source
-
getFxRateLookup
default FxRateLookup getFxRateLookup()
Gets the underlying FX lookup.- Returns:
- the underlying FX lookup
-
-