Interface CurveNode
-
- All Known Implementing Classes:
FixedIborSwapCurveNode
,FixedInflationSwapCurveNode
,FixedOvernightSwapCurveNode
,FraCurveNode
,FxSwapCurveNode
,IborFixingDepositCurveNode
,IborFutureCurveNode
,IborIborSwapCurveNode
,OvernightFutureCurveNode
,OvernightIborSwapCurveNode
,TermDepositCurveNode
,ThreeLegBasisSwapCurveNode
,XCcyIborIborSwapCurveNode
public interface CurveNode
A node in the configuration specifying how to calibrate a curve.A curve node is associated with an instrument and provides a method to create a trade representing the instrument.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description LocalDate
date(LocalDate valuationDate, ReferenceData refData)
Calculates the date associated with the node.CurveNodeDateOrder
getDateOrder()
Gets the date order rules that apply to this node within the curve.String
getLabel()
Gets the label to use for the node.double
initialGuess(MarketData marketData, ValueType valueType)
Gets the initial guess used for calibrating the node.DatedParameterMetadata
metadata(LocalDate valuationDate, ReferenceData refData)
Returns metadata for the node.Set<? extends MarketDataId<?>>
requirements()
Determines the market data that is required by the node.ResolvedTrade
resolvedTrade(double quantity, MarketData marketData, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.default ResolvedTrade
sampleResolvedTrade(LocalDate valuationDate, FxRateProvider fxProvider, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.Trade
trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the instrument at the node.
-
-
-
Method Detail
-
getLabel
String getLabel()
Gets the label to use for the node.- Returns:
- the label, not empty
-
getDateOrder
CurveNodeDateOrder getDateOrder()
Gets the date order rules that apply to this node within the curve.Each curve node has an associated date which defines the x-value in the curve, available via
date(LocalDate, ReferenceData)
. Restrictions may be placed on the node to prevent it from being too close, before or after another node.- Returns:
- the date order rules
-
requirements
Set<? extends MarketDataId<?>> requirements()
Determines the market data that is required by the node.This returns the market data needed to build the trade that the node represents.
- Returns:
- requirements for the market data needed to build a trade representing the instrument at the node
-
date
LocalDate date(LocalDate valuationDate, ReferenceData refData)
Calculates the date associated with the node.Each curve node has an associated date which defines the x-value in the curve. This date is visible in the parameter metadata.
- Parameters:
valuationDate
- the valuation date used when calibrating the curverefData
- the reference data to use to resolve the trade- Returns:
- the date associated with the node
-
metadata
DatedParameterMetadata metadata(LocalDate valuationDate, ReferenceData refData)
Returns metadata for the node.This provides curve metadata for the node at the specified valuation date.
- Parameters:
valuationDate
- the valuation date used when calibrating the curverefData
- the reference data to use to resolve the trade- Returns:
- metadata for the node
-
trade
Trade trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the instrument at the node.This uses the observed market data to build the trade that the node represents. The reference data is typically used to find the start date of the trade from the valuation date. The resulting trade is not resolved. The notional of the trade is taken from the 'quantity' variable. The quantity is signed and will affect whether the trade is Buy or Sell. The valuation date is defined by the market data.
- Parameters:
quantity
- the quantity or notional of the trademarketData
- the market data required to build a trade for the instrument, including the valuation daterefData
- the reference data, used to resolve the trade dates- Returns:
- a trade representing the instrument at the node
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if unable to resolve due to an invalid definition
-
resolvedTrade
ResolvedTrade resolvedTrade(double quantity, MarketData marketData, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.This uses the observed market data to build the trade that the node represents. The trade is then resolved using the specified reference data if necessary. The valuation date is defined by the market data.
Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Parameters:
quantity
- the quantity or notional of the trademarketData
- the market data required to build a trade for the instrument, including the valuation daterefData
- the reference data, used to resolve the trade- Returns:
- a trade representing the instrument at the node
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if unable to resolve due to an invalid definition
-
sampleResolvedTrade
default ResolvedTrade sampleResolvedTrade(LocalDate valuationDate, FxRateProvider fxProvider, ReferenceData refData)
Creates a resolved trade representing the instrument at the node.This uses an arbitrary quantity, typically 1, and an arbitrary market data quote, typically 0, to create a trade. This is useful when the trade is to be used to calculate the current par value. The FX provider is typically only used for cross-currency trades. In many cases,
FxRateProvider.minimal()
can be passed in.Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Parameters:
valuationDate
- the valuation datefxProvider
- the FX rate providerrefData
- the reference data, used to resolve the trade- Returns:
- a trade representing the instrument at the node
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if unable to resolve due to an invalid definition
-
initialGuess
double initialGuess(MarketData marketData, ValueType valueType)
Gets the initial guess used for calibrating the node.This uses the observed market data to select a suitable initial guess. For example, a Fixed-Ibor swap would return the market quote, which is the fixed rate, providing that the value type is 'ZeroRate'. The valuation date is defined by the market data.
This is primarily used as a performance hint. Since the guess is refined by calibration, in most cases any suitable number can be returned, such as zero.
- Parameters:
marketData
- the market data required to build a trade for the instrument, including the valuation datevalueType
- the type of y-value that the curve will contain- Returns:
- the initial guess of the calibrated value
-
-