Interface RatesProvider
-
- All Superinterfaces:
BaseProvider
,FxRateProvider
- All Known Implementing Classes:
ImmutableRatesProvider
public interface RatesProvider extends BaseProvider
A provider of rates, such as Ibor and Overnight, used for pricing financial instruments.This provides the environmental information against which pricing occurs. The valuation date, FX rates, discount factors, time-series and forward curves are included.
The standard independent implementation is
ImmutableRatesProvider
.All implementations of this interface must be immutable and thread-safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default MultiCurrencyAmount
currencyExposure(PointSensitivities pointSensitivities)
Computes the currency exposure.<T> Optional<T>
findData(MarketDataName<T> name)
Finds the market data with the specified name.FxForwardRates
fxForwardRates(CurrencyPair currencyPair)
Gets the forward FX rates for a currency pair.FxIndexRates
fxIndexRates(FxIndex index)
Gets the rates for an FX index.Set<IborIndex>
getIborIndices()
Gets the set of Ibor indices that are available.Set<OvernightIndex>
getOvernightIndices()
Gets the set of Overnight indices that are available.Set<PriceIndex>
getPriceIndices()
Gets the set of Price indices that are available.Set<Index>
getTimeSeriesIndices()
Gets the set of indices that have time-series available.IborIndexRates
iborIndexRates(IborIndex index)
Gets the rates for an Ibor index.default Stream<Index>
indices()
Gets the forward indices that are available.OvernightIndexRates
overnightIndexRates(OvernightIndex index)
Gets the rates for an Overnight index.default CurrencyParameterSensitivities
parameterSensitivity(PointSensitivities pointSensitivities)
Computes the parameter sensitivity.PriceIndexValues
priceIndexValues(PriceIndex index)
Gets the values for an Price index.LocalDateDoubleTimeSeries
timeSeries(Index index)
Gets the time series.ImmutableRatesProvider
toImmutableRatesProvider()
Converts this provider to an equivalentImmutableRatesProvider
.-
Methods inherited from interface com.opengamma.strata.pricer.BaseProvider
data, discountFactor, discountFactors, fxRate, fxRate, getDiscountCurrencies, getValuationDate
-
Methods inherited from interface com.opengamma.strata.basics.currency.FxRateProvider
convert, convert
-
-
-
-
Method Detail
-
indices
default Stream<Index> indices()
Gets the forward indices that are available.Normally this will only return Ibor, Overnight and Price indices, however it may return other types of index.
- Returns:
- the indices
-
getIborIndices
Set<IborIndex> getIborIndices()
Gets the set of Ibor indices that are available.If an index is present in the result of this method, then
iborIndexRates(IborIndex)
should not throw an exception.- Returns:
- the set of Ibor indices
-
getOvernightIndices
Set<OvernightIndex> getOvernightIndices()
Gets the set of Overnight indices that are available.If an index is present in the result of this method, then
overnightIndexRates(OvernightIndex)
should not throw an exception.- Returns:
- the set of Overnight indices
-
getPriceIndices
Set<PriceIndex> getPriceIndices()
Gets the set of Price indices that are available.If an index is present in the result of this method, then
priceIndexValues(PriceIndex)
should not throw an exception.- Returns:
- the set of Price indices
-
getTimeSeriesIndices
Set<Index> getTimeSeriesIndices()
Gets the set of indices that have time-series available.Note that the method
timeSeries(Index)
returns an empty time-series when the index is not known, thus this method is useful to determine if there actually is a time-series in the underlying data.- Returns:
- the set of indices with time-series
-
fxIndexRates
FxIndexRates fxIndexRates(FxIndex index)
Gets the rates for an FX index.This returns an object that can provide historic and forward rates for the specified index.
An FX rate is the conversion rate between two currencies. An FX index is the rate as published by a specific organization, typically at a well-known time-of-day.
- Parameters:
index
- the index to find rates for- Returns:
- the rates for the specified index
- Throws:
IllegalArgumentException
- if the rates are not available
-
fxForwardRates
FxForwardRates fxForwardRates(CurrencyPair currencyPair)
Gets the forward FX rates for a currency pair.This returns an object that can provide forward rates for the specified currency pair. See
fxIndexRates(FxIndex)
for forward rates with daily fixings.- Parameters:
currencyPair
- the currency pair to find forward rates for- Returns:
- the forward rates for the specified currency pair
- Throws:
IllegalArgumentException
- if the rates are not available
-
iborIndexRates
IborIndexRates iborIndexRates(IborIndex index)
Gets the rates for an Ibor index.The rate of the Ibor index, such as 'GBP-LIBOR-3M', varies over time. This returns an object that can provide historic and forward rates for the specified index.
- Parameters:
index
- the index to find rates for- Returns:
- the rates for the specified index
- Throws:
IllegalArgumentException
- if the rates are not available
-
overnightIndexRates
OvernightIndexRates overnightIndexRates(OvernightIndex index)
Gets the rates for an Overnight index.The rate of the Overnight index, such as 'EUR-EONIA', varies over time. This returns an object that can provide historic and forward rates for the specified index.
- Parameters:
index
- the index to find rates for- Returns:
- the rates for the specified index
- Throws:
IllegalArgumentException
- if the rates are not available
-
priceIndexValues
PriceIndexValues priceIndexValues(PriceIndex index)
Gets the values for an Price index.The value of the Price index, such as 'US-CPI-U', varies over time. This returns an object that can provide historic and forward values for the specified index.
- Parameters:
index
- the index to find values for- Returns:
- the values for the specified index
- Throws:
IllegalArgumentException
- if the values are not available
-
parameterSensitivity
default 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 internal parameters representation.For example, the point sensitivities could represent the sensitivity to a date on the first of each month in a year relative to a specific forward curve. This method converts to the point sensitivities to be relative to each parameter on the underlying curve, such as the 1 day, 1 week, 1 month, 3 month, 12 month and 5 year nodal points.
- Parameters:
pointSensitivities
- the point sensitivities- Returns:
- the sensitivity to the curve parameters
-
currencyExposure
default MultiCurrencyAmount currencyExposure(PointSensitivities pointSensitivities)
Computes the currency exposure.This computes the currency exposure in the form of a
MultiCurrencyAmount
associated with thePointSensitivities
. This corresponds to the projection of the point sensitivity to the currency exposure associated to anFxIndexSensitivity
.For example, the point sensitivities could represent the sensitivity to a FX Index. This method produces the implicit currency exposure embedded in the FX index sensitivity.
Reference: Currency Exposure and FX index, OpenGamma Documentation 32, July 2015.
- Parameters:
pointSensitivities
- the point sensitivities- Returns:
- the currency exposure
-
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
-
timeSeries
LocalDateDoubleTimeSeries timeSeries(Index index)
Gets the time series.This returns time series for the index.
- Parameters:
index
- the index- Returns:
- the time series, empty if time-series not found
-
toImmutableRatesProvider
ImmutableRatesProvider toImmutableRatesProvider()
Converts this provider to an equivalentImmutableRatesProvider
.- Returns:
- the equivalent immutable rates provider
-
-