Class Cds

  • All Implemented Interfaces:
    Resolvable<ResolvedCds>, Product, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class Cds
    extends Object
    implements Product, Resolvable<ResolvedCds>, org.joda.beans.ImmutableBean, Serializable
    A single-name credit default swap (CDS).

    A CDS is a financial instrument where the protection seller agrees to compensate the protection buyer when the reference entity suffers a default. The protection seller is paid premium regularly from the protection buyer until the expiry of the CDS contract or the reference entity defaults before the expiry.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static Cds of​(BuySell buySell,
                             StandardId legalEntityId,
                             Currency currency,
                             double notional,
                             LocalDate startDate,
                             LocalDate endDate,
                             Frequency paymentFrequency,
                             HolidayCalendarId calendar,
                             double fixedRate)
        Creates an instance of a standardized CDS.
        Parameters:
        buySell - buy or sell
        legalEntityId - the legal entity ID
        currency - the currency
        notional - the notional
        startDate - the start date
        endDate - the end date
        calendar - the calendar
        fixedRate - the fixed coupon rate
        paymentFrequency - the payment frequency
        Returns:
        the instance
      • allCurrencies

        public ImmutableSet<Currency> allCurrencies()
        Description copied from interface: Product
        Returns the set of currencies the product refers to.

        This returns the complete set of currencies, not just the payment currencies. For example, the sets will differ when one of the currencies is non-deliverable.

        Specified by:
        allCurrencies in interface Product
        Returns:
        the set of currencies the product refers to
      • resolve

        public ResolvedCds resolve​(ReferenceData refData)
        Description copied from interface: Resolvable
        Resolves this object using the specified reference data.

        This converts the object implementing this interface to the equivalent resolved form. All ReferenceDataId identifiers in this instance will be resolved. The resolved form will typically be a type that is optimized for pricing.

        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.

        Specified by:
        resolve in interface Resolvable<ResolvedCds>
        Parameters:
        refData - the reference data to use when resolving
        Returns:
        the resolved instance
      • meta

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

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

        public Cds.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getBuySell

        public BuySell getBuySell()
        Gets whether the CDS is buy or sell.

        A value of 'Buy' implies buying protection, where the fixed coupon is paid and the protection is received in the event of default. A value of 'Sell' implies selling protection, where the fixed coupon is received and the protection is paid in the event of default.

        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
      • getCurrency

        public Currency getCurrency()
        Gets the currency of the CDS.

        The amounts of the notional are expressed in terms of this currency.

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

        public double getNotional()
        Gets the notional amount, must be non-negative.

        The fixed notional amount applicable during the lifetime of the CDS. The currency of the notional is specified by currency.

        Returns:
        the value of the property
      • getPaymentSchedule

        public PeriodicSchedule getPaymentSchedule()
        Gets the payment schedule.

        This is used to define the payment periods.

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

        public double getFixedRate()
        Gets the fixed coupon rate.

        This must be represented in decimal form.

        Returns:
        the value of the property
      • getDayCount

        public DayCount getDayCount()
        Gets the day count convention.

        This is used to convert dates to a numerical value.

        When building, this will default to 'Act/360'.

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

        public PaymentOnDefault getPaymentOnDefault()
        Gets the payment on default.

        Whether the accrued premium is paid in the event of a default.

        When building, this will default to 'AccruedPremium'.

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

        public ProtectionStartOfDay getProtectionStart()
        Gets the protection start of the day.

        When the protection starts on the start date.

        When building, this will default to 'Beginning'.

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

        public DaysAdjustment getStepinDateOffset()
        Gets the number of days between valuation date and step-in date.

        The step-in date is also called protection effective date. It is usually 1 calendar day for standardized CDS contracts.

        When building, this will default to 1 calendar day.

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

        public DaysAdjustment getSettlementDateOffset()
        Gets the number of days between valuation date and settlement date.

        It is usually 3 business days for standardized CDS contracts.

        When building, this will default to 3 business days in the calendar of the payment schedule.

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

        public Cds.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object