Class CdsIsdaCreditCurveNode

  • All Implemented Interfaces:
    IsdaCreditCurveNode, java.io.Serializable, Bean, ImmutableBean

    public final class CdsIsdaCreditCurveNode
    extends java.lang.Object
    implements IsdaCreditCurveNode, ImmutableBean, java.io.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
    • Method Detail

      • ofParSpread

        public static CdsIsdaCreditCurveNode ofParSpread​(CdsTemplate template,
                                                         ObservableId observableId,
                                                         StandardId legalEntityId)
        Returns a curve node with par spread convention.
        Parameters:
        template - the template
        observableId - the observable ID
        legalEntityId - the legal entity ID
        Returns:
        the curve node
      • ofPointsUpfront

        public static CdsIsdaCreditCurveNode ofPointsUpfront​(CdsTemplate template,
                                                             ObservableId observableId,
                                                             StandardId legalEntityId,
                                                             java.lang.Double fixedRate)
        Returns a curve node with points upfront convention.
        Parameters:
        template - the template
        observableId - the observable ID
        legalEntityId - the legal entity ID
        fixedRate - the fixed rate
        Returns:
        the curve node
      • ofQuotedSpread

        public static CdsIsdaCreditCurveNode ofQuotedSpread​(CdsTemplate template,
                                                            ObservableId observableId,
                                                            StandardId legalEntityId,
                                                            java.lang.Double fixedRate)
        Returns a curve node with quoted spread convention.
        Parameters:
        template - the template
        observableId - the observable ID
        legalEntityId - the legal entity ID
        fixedRate - the fixed rate
        Returns:
        the curve node
      • date

        public java.time.LocalDate date​(java.time.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 interface IsdaCreditCurveNode
        Parameters:
        tradeDate - the trade date
        refData - the reference data
        Returns:
        the node date
      • 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 trade
        marketData - the market data required to build a trade for the instrument, including the valuation date
        refData - the reference data, used to resolve the trade dates
        Returns:
        a trade representing the instrument at the node
      • builder

        public static CdsIsdaCreditCurveNode.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • getTemplate

        public CdsTemplate getTemplate()
        Gets the template for the CDS associated with this node.
        Returns:
        the value of the property, not null
      • getLabel

        public java.lang.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 interface IsdaCreditCurveNode
        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 interface IsdaCreditCurveNode
        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 java.util.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
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object