Class IborFixingDepositTemplate
- java.lang.Object
-
- com.opengamma.strata.product.deposit.type.IborFixingDepositTemplate
-
- All Implemented Interfaces:
TradeTemplate
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class IborFixingDepositTemplate extends Object implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
A template for creating an Ibor fixing deposit trade.This defines almost all the data necessary to create a
IborFixingDepositTrade
. 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 convention is defined by four dates.
- Trade date, the date that the trade is agreed
- Start date or spot date, the date on which the deposit starts, typically 2 business days after the trade date
- End date, the date on which deposit ends, typically a number of months after the start date
- Fixing date, the date on which the index is to be observed, typically 2 business days before the start date
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IborFixingDepositTemplate.Builder
The bean-builder forIborFixingDepositTemplate
.static class
IborFixingDepositTemplate.Meta
The meta-bean forIborFixingDepositTemplate
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IborFixingDepositTemplate.Builder
builder()
Returns a builder used to create an instance of the bean.IborFixingDepositTrade
createTrade(LocalDate tradeDate, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
Creates a trade based on this template.boolean
equals(Object obj)
IborFixingDepositConvention
getConvention()
Gets the underlying Ibor fixing deposit convention.Period
getDepositPeriod()
Gets the period between the start date and the end date.int
hashCode()
static IborFixingDepositTemplate.Meta
meta()
The meta-bean forIborFixingDepositTemplate
.IborFixingDepositTemplate.Meta
metaBean()
static IborFixingDepositTemplate
of(IborIndex index)
Obtains a template based on the specified index.static IborFixingDepositTemplate
of(Period depositPeriod, IborIndex index)
Obtains a template based on the specified period and index.static IborFixingDepositTemplate
of(Period depositPeriod, IborFixingDepositConvention convention)
Obtains a template based on the specified periods and convention.IborFixingDepositTemplate.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
of
public static IborFixingDepositTemplate of(IborIndex index)
Obtains a template based on the specified index.The period from the start date to the end date will be the tenor of the index. The convention will be created based on the index.
- Parameters:
index
- the index that defines the market convention- Returns:
- the template
-
of
public static IborFixingDepositTemplate of(Period depositPeriod, IborIndex index)
Obtains a template based on the specified period and index.The period from the start date to the end is specified. The convention will be created based on the index.
- Parameters:
depositPeriod
- the period between the start date and the end dateindex
- the index that defines the market convention- Returns:
- the template
-
of
public static IborFixingDepositTemplate of(Period depositPeriod, IborFixingDepositConvention convention)
Obtains a template based on the specified periods and convention.- Parameters:
depositPeriod
- the period between the start date and the end dateconvention
- the market convention- Returns:
- the template
-
createTrade
public IborFixingDepositTrade 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 date. The notional is unsigned, with buy/sell determining the direction of the trade. If buying the Ibor fixing deposit, the floating rate is paid from the counterparty, with the fixed rate being received. If selling the Ibor fixing deposit, the floating received is paid to the counterparty, with the fixed rate being paid.
- Parameters:
tradeDate
- the date of the tradebuySell
- the buy/sell flag, seeIborFixingDeposit.getBuySell()
notional
- 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 IborFixingDepositTemplate.Meta meta()
The meta-bean forIborFixingDepositTemplate
.- Returns:
- the meta-bean, not null
-
builder
public static IborFixingDepositTemplate.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public IborFixingDepositTemplate.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getDepositPeriod
public Period getDepositPeriod()
Gets the period between the start date and the end date.The difference between the start date and the end date typically matches the tenor of the index, however this is not validated.
- Returns:
- the value of the property, not null
-
getConvention
public IborFixingDepositConvention getConvention()
Gets the underlying Ibor fixing deposit convention.This specifies the standard convention of the Ibor fixing deposit to be created.
- Returns:
- the value of the property, not null
-
toBuilder
public IborFixingDepositTemplate.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-