Class TenorCdsTemplate
- java.lang.Object
-
- com.opengamma.strata.product.credit.type.TenorCdsTemplate
-
- All Implemented Interfaces:
CdsTemplate
,TradeTemplate
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class TenorCdsTemplate extends Object implements CdsTemplate, org.joda.beans.ImmutableBean, 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 defined in terms ofAccrualStart
andTenor
.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. The start date (if it is not the next day) and end date are computed from trade date with the standard semi-annual roll convention.
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TenorCdsTemplate.Meta
The meta-bean forTenorCdsTemplate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CdsTrade
createTrade(StandardId legalEntityId, LocalDate tradeDate, BuySell buySell, double notional, double fixedRate, AdjustablePayment upFrontFee, ReferenceData refData)
Creates a trade based on this template.CdsTrade
createTrade(StandardId legalEntityId, LocalDate tradeDate, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
Creates a trade based on this template.boolean
equals(Object obj)
AccrualStart
getAccrualStart()
Gets the accrual start.CdsConvention
getConvention()
Gets the market convention of the credit default swap.Tenor
getTenor()
Gets the tenor of the credit default swap.int
hashCode()
static TenorCdsTemplate.Meta
meta()
The meta-bean forTenorCdsTemplate
.TenorCdsTemplate.Meta
metaBean()
static TenorCdsTemplate
of(Tenor tenor, CdsConvention convention)
Obtains a template based on the specified tenor and convention.static TenorCdsTemplate
of(AccrualStart accrualStart, Tenor tenor, CdsConvention convention)
Obtains a template based on the specified tenor and convention.String
toString()
-
-
-
Method Detail
-
of
public static TenorCdsTemplate of(AccrualStart accrualStart, Tenor tenor, CdsConvention convention)
Obtains a template based on the specified tenor and convention.The protection end will be calculated based on standard semi-annual roll convention.
- Parameters:
accrualStart
- the accrual starttenor
- the tenor of the CDSconvention
- the market convention- Returns:
- the template
-
of
public static TenorCdsTemplate of(Tenor tenor, CdsConvention convention)
Obtains a template based on the specified tenor and convention.The start and end dates will be calculated based on standard semi-annual roll convention.
- Parameters:
tenor
- the tenor of the CDSconvention
- the market convention- Returns:
- the template
-
createTrade
public CdsTrade createTrade(StandardId legalEntityId, 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 interfaceCdsTemplate
- Parameters:
legalEntityId
- the legal entity IDtradeDate
- the date of the tradebuySell
- the buy/sell flagnotional
- the notional amount, in the payment currency of the templatefixedRate
- the fixed rate, typically derived from the marketrefData
- the reference data, used to resolve the trade dates- Returns:
- the trade
-
createTrade
public CdsTrade createTrade(StandardId legalEntityId, 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 interfaceCdsTemplate
- Parameters:
legalEntityId
- the legal entity IDtradeDate
- the date of the tradebuySell
- the buy/sell flagnotional
- the notional amount, in the payment currency of the templatefixedRate
- the fixed rate, typically derived from the marketupFrontFee
- the reference datarefData
- the reference data, used to resolve the trade dates- Returns:
- the trade
-
meta
public static TenorCdsTemplate.Meta meta()
The meta-bean forTenorCdsTemplate
.- Returns:
- the meta-bean, not null
-
metaBean
public TenorCdsTemplate.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getAccrualStart
public AccrualStart getAccrualStart()
Gets the accrual start.Whether the accrual start is the next day or the previous IMM date.
- Returns:
- the value of the property, not null
-
getTenor
public Tenor getTenor()
Gets the tenor of the credit default swap.This is the period to the protection end.
- 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 interfaceCdsTemplate
- Returns:
- the value of the property, not null
-
-