Class FixedOvernightSwapTemplate
- java.lang.Object
-
- com.opengamma.strata.product.swap.type.FixedOvernightSwapTemplate
-
- All Implemented Interfaces:
FixedFloatSwapTemplate,TradeTemplate,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class FixedOvernightSwapTemplate extends Object implements FixedFloatSwapTemplate, org.joda.beans.ImmutableBean, Serializable
A template for creating Fixed-Overnight swap trades.This defines almost all the data necessary to create a Fixed-Overnight single currency
SwapTrade. The 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 price for a trade based on the template. The market price is typically quoted as a bid/ask on the fixed rate.The template references four dates.
- Trade date, the date that the trade is agreed
- Spot date, the base for date calculations, typically 2 business days after the trade date
- Start date, the date on which accrual starts
- End date, the date on which accrual ends
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFixedOvernightSwapTemplate.BuilderThe bean-builder forFixedOvernightSwapTemplate.static classFixedOvernightSwapTemplate.MetaThe meta-bean forFixedOvernightSwapTemplate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FixedOvernightSwapTemplate.Builderbuilder()Returns a builder used to create an instance of the bean.SwapTradecreateTrade(LocalDate tradeDate, BuySell buySell, double notional, double fixedRate, ReferenceData refData)Creates a trade based on this template.booleanequals(Object obj)FixedOvernightSwapConventiongetConvention()Gets the market convention of the swap.PeriodgetPeriodToStart()Gets the period between the spot value date and the start date.TenorgetTenor()Gets the tenor of the swap.inthashCode()static FixedOvernightSwapTemplate.Metameta()The meta-bean forFixedOvernightSwapTemplate.FixedOvernightSwapTemplate.MetametaBean()static FixedOvernightSwapTemplateof(Tenor tenor, FixedOvernightSwapConvention convention)Obtains a template based on the specified tenor and convention.static FixedOvernightSwapTemplateof(Period periodToStart, Tenor tenor, FixedOvernightSwapConvention convention)Obtains a template based on the specified period, tenor and convention.FixedOvernightSwapTemplate.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()
-
-
-
Method Detail
-
of
public static FixedOvernightSwapTemplate of(Tenor tenor, FixedOvernightSwapConvention convention)
Obtains a template based on the specified tenor and convention.The swap will start on the spot date.
- Parameters:
tenor- the tenor of the swapconvention- the market convention- Returns:
- the template
-
of
public static FixedOvernightSwapTemplate of(Period periodToStart, Tenor tenor, FixedOvernightSwapConvention convention)
Obtains a template based on the specified period, tenor and convention.The period from the spot date to the start date is specified.
- Parameters:
periodToStart- the period between the spot date and the start datetenor- the tenor of the swapconvention- the market convention- Returns:
- the template
-
createTrade
public SwapTrade createTrade(LocalDate tradeDate, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
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 swap, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the swap, the floating rate is paid to the counterparty, with the fixed rate being received.
- Specified by:
createTradein interfaceFixedFloatSwapTemplate- Parameters:
tradeDate- 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
- Throws:
ReferenceDataNotFoundException- if an identifier cannot be resolved in the reference data
-
meta
public static FixedOvernightSwapTemplate.Meta meta()
The meta-bean forFixedOvernightSwapTemplate.- Returns:
- the meta-bean, not null
-
builder
public static FixedOvernightSwapTemplate.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public FixedOvernightSwapTemplate.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getPeriodToStart
public Period getPeriodToStart()
Gets the period between the spot value date and the start date.This is often zero, but can be greater if the swap if forward starting. This must not be negative.
- Returns:
- the value of the property, not null
-
getTenor
public Tenor getTenor()
Gets the tenor of the swap.This is the period from the first accrual date to the last accrual date.
- Specified by:
getTenorin interfaceFixedFloatSwapTemplate- Returns:
- the value of the property, not null
-
getConvention
public FixedOvernightSwapConvention getConvention()
Gets the market convention of the swap.- Specified by:
getConventionin interfaceFixedFloatSwapTemplate- Returns:
- the value of the property, not null
-
toBuilder
public FixedOvernightSwapTemplate.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-