Class DatesCdsTemplate

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

    public final class DatesCdsTemplate
    extends java.lang.Object
    implements CdsTemplate, ImmutableBean, java.io.Serializable
    A template for creating credit default swap trades.

    This defines almost all the data necessary to create a credit default swap CdsTrade. The start and end of the trade are specified by LocalDate. Use TenorCdsTemplate for standard CDS trades.

    The legal entity ID, trade date, notional and fixed rate are required to complete the template and create the trade. As such, it is often possible to get a market quote for a trade based on the template.

    A CDS is quoted in points upfront, par spread, or quoted spread. For the latter two cases, the market quotes are passed as the fixed rate.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static DatesCdsTemplate of​(java.time.LocalDate startDate,
                                          java.time.LocalDate endDate,
                                          CdsConvention convention)
        Obtains a template based on the specified dates and convention.
        Parameters:
        startDate - the start date
        endDate - the end date
        convention - the convention
        Returns:
        the template
      • createTrade

        public CdsTrade createTrade​(StandardId legalEntityId,
                                    java.time.LocalDate tradeDate,
                                    BuySell buySell,
                                    double notional,
                                    double fixedRate,
                                    ReferenceData refData)
        Description copied from interface: CdsTemplate
        Creates a trade based on this template.

        This returns a trade based on the specified trade date.

        The notional is unsigned, with buy/sell determining the direction of the trade. If buying the CDS, the protection is received from the counterparty on default, with the fixed coupon being paid. If selling the CDS, the protection is paid to the counterparty on default, with the fixed coupon being received.

        Specified by:
        createTrade in interface CdsTemplate
        Parameters:
        legalEntityId - the legal entity ID
        tradeDate - the date of the trade
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - the fixed rate, typically derived from the market
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
      • createTrade

        public CdsTrade createTrade​(StandardId legalEntityId,
                                    java.time.LocalDate tradeDate,
                                    BuySell buySell,
                                    double notional,
                                    double fixedRate,
                                    AdjustablePayment upFrontFee,
                                    ReferenceData refData)
        Description copied from interface: CdsTemplate
        Creates a trade based on this template.

        This returns a trade based on the specified trade date and upfront fee.

        The notional is unsigned, with buy/sell determining the direction of the trade. If buying the CDS, the protection is received from the counterparty on default, with the fixed coupon being paid. If selling the CDS, the protection is paid to the counterparty on default, with the fixed coupon being received.

        Specified by:
        createTrade in interface CdsTemplate
        Parameters:
        legalEntityId - the legal entity ID
        tradeDate - the date of the trade
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - the fixed rate, typically derived from the market
        upFrontFee - the reference data
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
      • meta

        public static DatesCdsTemplate.Meta meta()
        The meta-bean for DatesCdsTemplate.
        Returns:
        the meta-bean, not null
      • getStartDate

        public java.time.LocalDate getStartDate()
        Gets the start date.

        The start date of the underling CDS product. This date can be modified following the rule in convention.

        Returns:
        the value of the property, not null
      • getEndDate

        public java.time.LocalDate getEndDate()
        Gets the end date.

        The end date of the underling CDS product. This date can be modified following the rule in convention.

        Returns:
        the value of the property, not null
      • getConvention

        public CdsConvention getConvention()
        Gets the market convention of the credit default swap.
        Specified by:
        getConvention in interface CdsTemplate
        Returns:
        the value of the property, 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