Class Cds
- java.lang.Object
-
- com.opengamma.strata.product.credit.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCds.BuilderThe bean-builder forCds.static classCds.MetaThe meta-bean forCds.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableSet<Currency>allCurrencies()Returns the set of currencies the product refers to.static Cds.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)BuySellgetBuySell()Gets whether the CDS is buy or sell.CurrencygetCurrency()Gets the currency of the CDS.DayCountgetDayCount()Gets the day count convention.doublegetFixedRate()Gets the fixed coupon rate.StandardIdgetLegalEntityId()Gets the legal entity identifier.doublegetNotional()Gets the notional amount, must be non-negative.PaymentOnDefaultgetPaymentOnDefault()Gets the payment on default.PeriodicSchedulegetPaymentSchedule()Gets the payment schedule.ProtectionStartOfDaygetProtectionStart()Gets the protection start of the day.DaysAdjustmentgetSettlementDateOffset()Gets the number of days between valuation date and settlement date.DaysAdjustmentgetStepinDateOffset()Gets the number of days between valuation date and step-in date.inthashCode()static Cds.Metameta()The meta-bean forCds.Cds.MetametaBean()static Cdsof(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.ResolvedCdsresolve(ReferenceData refData)Resolves this object using the specified reference data.Cds.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Product
allPaymentCurrencies, isCrossCurrency
-
-
-
-
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 selllegalEntityId- the legal entity IDcurrency- the currencynotional- the notionalstartDate- the start dateendDate- the end datecalendar- the calendarfixedRate- the fixed coupon ratepaymentFrequency- the payment frequency- Returns:
- the instance
-
allCurrencies
public ImmutableSet<Currency> allCurrencies()
Description copied from interface:ProductReturns 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:
allCurrenciesin interfaceProduct- Returns:
- the set of currencies the product refers to
-
resolve
public ResolvedCds resolve(ReferenceData refData)
Description copied from interface:ResolvableResolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataIdidentifiers 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:
resolvein interfaceResolvable<ResolvedCds>- Parameters:
refData- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static Cds.Meta meta()
The meta-bean forCds.- 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:
metaBeanin interfaceorg.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
-
-