Class ResolvedCds
- java.lang.Object
-
- com.opengamma.strata.product.credit.ResolvedCds
-
- All Implemented Interfaces:
ResolvedProduct
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ResolvedCds extends Object implements ResolvedProduct, org.joda.beans.ImmutableBean, Serializable
A single-name credit default swap (CDS), resolved for pricing.This is the resolved form of
Cds
and is an input to the pricers. Applications will typically create aResolvedCds
from aCds
usingCds.resolve(ReferenceData)
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResolvedCds.Builder
The bean-builder forResolvedCds
.static class
ResolvedCds.Meta
The meta-bean forResolvedCds
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
accruedYearFraction(LocalDate stepinDate)
Calculates the accrued premium per fractional spread for unit notional.static ResolvedCds.Builder
builder()
Returns a builder used to create an instance of the bean.LocalDate
calculateEffectiveStartDate(LocalDate stepinDate)
Obtains the effective start date from the step-in date.LocalDate
calculateSettlementDateFromValuation(LocalDate valuationDate, ReferenceData refData)
Calculates the settlement date from the valuation date.boolean
equals(Object obj)
Optional<CreditCouponPaymentPeriod>
findPeriod(LocalDate date)
Finds the period that contains the specified date.LocalDate
getAccrualEndDate()
Obtains the accrual end date.LocalDate
getAccrualStartDate()
Obtains the accrual start date.BuySell
getBuySell()
Gets whether the CDS is buy or sell.Currency
getCurrency()
Obtains the currency.DayCount
getDayCount()
Gets the day count convention.double
getFixedRate()
Obtains the fixed coupon rate.StandardId
getLegalEntityId()
Gets the legal entity identifier.double
getNotional()
Obtains the notional.PaymentOnDefault
getPaymentOnDefault()
Gets the payment on default.ImmutableList<CreditCouponPaymentPeriod>
getPaymentPeriods()
Gets the periodic payments based on the fixed rate.LocalDate
getProtectionEndDate()
Gets the protection end date.ProtectionStartOfDay
getProtectionStart()
Gets the protection start of the day.DaysAdjustment
getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.DaysAdjustment
getStepinDateOffset()
Gets the number of days between valuation date and step-in date.int
hashCode()
static ResolvedCds.Meta
meta()
The meta-bean forResolvedCds
.ResolvedCds.Meta
metaBean()
ResolvedCds.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
getAccrualStartDate
public LocalDate getAccrualStartDate()
Obtains the accrual start date.In general this is different from the protection start date. Use
stepinDateOffset
to compute the protection start date.- Returns:
- the accrual start date
-
getAccrualEndDate
public LocalDate getAccrualEndDate()
Obtains the accrual end date.- Returns:
- the accrual end date
-
getNotional
public double getNotional()
Obtains the notional.- Returns:
- the notional
-
getCurrency
public Currency getCurrency()
Obtains the currency.- Returns:
- the currency
-
getFixedRate
public double getFixedRate()
Obtains the fixed coupon rate.- Returns:
- the fixed rate
-
calculateEffectiveStartDate
public LocalDate calculateEffectiveStartDate(LocalDate stepinDate)
Obtains the effective start date from the step-in date.- Parameters:
stepinDate
- the step-in date- Returns:
- the effective start date
-
calculateSettlementDateFromValuation
public LocalDate calculateSettlementDateFromValuation(LocalDate valuationDate, ReferenceData refData)
Calculates the settlement date from the valuation date.- Parameters:
valuationDate
- the valuation daterefData
- the reference data to use- Returns:
- the settlement date
-
findPeriod
public Optional<CreditCouponPaymentPeriod> findPeriod(LocalDate date)
Finds the period that contains the specified date.The search is performed using unadjusted dates.
- Parameters:
date
- the date to find the period for- Returns:
- the period, empty if not found
- Throws:
IllegalArgumentException
- if more than one period matches
-
accruedYearFraction
public double accruedYearFraction(LocalDate stepinDate)
Calculates the accrued premium per fractional spread for unit notional.- Parameters:
stepinDate
- the step-in date- Returns:
- the accrued year fraction
-
meta
public static ResolvedCds.Meta meta()
The meta-bean forResolvedCds
.- Returns:
- the meta-bean, not null
-
builder
public static ResolvedCds.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ResolvedCds.Meta metaBean()
- Specified by:
metaBean
in 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
-
getPaymentPeriods
public ImmutableList<CreditCouponPaymentPeriod> getPaymentPeriods()
Gets the periodic payments based on the fixed rate.Each payment period represents part of the life-time of the leg. In most cases, the periods do not overlap. However, since each payment period is essentially independent the data model allows overlapping periods.
- Returns:
- the value of the property, not empty
-
getProtectionEndDate
public LocalDate getProtectionEndDate()
Gets the protection end date.This may be different from the accrual end date of the last payment period in
periodicPayments
.- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention.This is used to convert dates to a numerical value.
- 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.
- 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.
- 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.
- 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.
- Returns:
- the value of the property, not null
-
toBuilder
public ResolvedCds.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-