Class CdsIsdaCreditCurveNode
- java.lang.Object
-
- com.opengamma.strata.market.curve.node.CdsIsdaCreditCurveNode
-
- All Implemented Interfaces:
IsdaCreditCurveNode
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class CdsIsdaCreditCurveNode extends Object implements IsdaCreditCurveNode, org.joda.beans.ImmutableBean, Serializable
An ISDA compliant curve node whose instrument is a credit default swap.The trade produced by the node will be a protection receiver (BUY) for a positive quantity and a protection payer (SELL) for a negative quantity.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CdsIsdaCreditCurveNode.Builder
The bean-builder forCdsIsdaCreditCurveNode
.static class
CdsIsdaCreditCurveNode.Meta
The meta-bean forCdsIsdaCreditCurveNode
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CdsIsdaCreditCurveNode.Builder
builder()
Returns a builder used to create an instance of the bean.LocalDate
date(LocalDate tradeDate, ReferenceData refData)
Calculates the date associated with the node.boolean
equals(Object obj)
OptionalDouble
getFixedRate()
Gets the fixed coupon rate.String
getLabel()
Gets the label to use for the node.StandardId
getLegalEntityId()
Gets the legal entity identifier.ObservableId
getObservableId()
Gets the identifier of the market data value that provides the quoted value.CdsQuoteConvention
getQuoteConvention()
Gets the market quote convention.CdsTemplate
getTemplate()
Gets the template for the CDS associated with this node.int
hashCode()
static CdsIsdaCreditCurveNode.Meta
meta()
The meta-bean forCdsIsdaCreditCurveNode
.CdsIsdaCreditCurveNode.Meta
metaBean()
DatedParameterMetadata
metadata(LocalDate nodeDate)
Returns metadata for the node from the node date.static CdsIsdaCreditCurveNode
ofParSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId)
Returns a curve node with par spread convention.static CdsIsdaCreditCurveNode
ofPointsUpfront(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with points upfront convention.static CdsIsdaCreditCurveNode
ofQuotedSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with quoted spread convention.CdsIsdaCreditCurveNode.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
CdsCalibrationTrade
trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the CDS at the node.
-
-
-
Method Detail
-
ofParSpread
public static CdsIsdaCreditCurveNode ofParSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId)
Returns a curve node with par spread convention.- Parameters:
template
- the templateobservableId
- the observable IDlegalEntityId
- the legal entity ID- Returns:
- the curve node
-
ofPointsUpfront
public static CdsIsdaCreditCurveNode ofPointsUpfront(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with points upfront convention.- Parameters:
template
- the templateobservableId
- the observable IDlegalEntityId
- the legal entity IDfixedRate
- the fixed rate- Returns:
- the curve node
-
ofQuotedSpread
public static CdsIsdaCreditCurveNode ofQuotedSpread(CdsTemplate template, ObservableId observableId, StandardId legalEntityId, Double fixedRate)
Returns a curve node with quoted spread convention.- Parameters:
template
- the templateobservableId
- the observable IDlegalEntityId
- the legal entity IDfixedRate
- the fixed rate- Returns:
- the curve node
-
date
public LocalDate date(LocalDate tradeDate, ReferenceData refData)
Description copied from interface:IsdaCreditCurveNode
Calculates the date associated with the node.Each curve node has an associated date which defines the x-value in the curve. This is typically the adjusted end date of the instrument.
- Specified by:
date
in interfaceIsdaCreditCurveNode
- Parameters:
tradeDate
- the trade daterefData
- the reference data- Returns:
- the node date
-
metadata
public DatedParameterMetadata metadata(LocalDate nodeDate)
Description copied from interface:IsdaCreditCurveNode
Returns metadata for the node from the node date.The node date must be computed by
IsdaCreditCurveNode.date(LocalDate, ReferenceData)
.- Specified by:
metadata
in interfaceIsdaCreditCurveNode
- Parameters:
nodeDate
- the node date used when calibrating the curve- Returns:
- metadata for the node
-
trade
public CdsCalibrationTrade trade(double quantity, MarketData marketData, ReferenceData refData)
Creates a trade representing the CDS at the node.This uses the observed market data to build the CDS trade that the node represents. 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
-
meta
public static CdsIsdaCreditCurveNode.Meta meta()
The meta-bean forCdsIsdaCreditCurveNode
.- Returns:
- the meta-bean, not null
-
builder
public static CdsIsdaCreditCurveNode.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public CdsIsdaCreditCurveNode.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getTemplate
public CdsTemplate getTemplate()
Gets the template for the CDS associated with this node.- Returns:
- the value of the property, not null
-
getLabel
public String getLabel()
Gets the label to use for the node.When building, this will default based on
template
if not specified.- Specified by:
getLabel
in interfaceIsdaCreditCurveNode
- Returns:
- the value of the property, not empty
-
getObservableId
public ObservableId getObservableId()
Gets the identifier of the market data value that provides the quoted value.- Specified by:
getObservableId
in interfaceIsdaCreditCurveNode
- Returns:
- the value of the property, not null
-
getLegalEntityId
public StandardId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the reference legal entity of the CDS.
- Returns:
- the value of the property, not null
-
getQuoteConvention
public CdsQuoteConvention getQuoteConvention()
Gets the market quote convention.The CDS is quoted in par spread, points upfront or quoted spread. See
CdsQuoteConvention
for detail.- Returns:
- the value of the property, not null
-
getFixedRate
public OptionalDouble getFixedRate()
Gets the fixed coupon rate.This must be represented in decimal form.
- Returns:
- the optional value of the property, not null
-
toBuilder
public CdsIsdaCreditCurveNode.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-