Class ImmutableIborFixingDepositConvention
- java.lang.Object
-
- com.opengamma.strata.product.deposit.type.ImmutableIborFixingDepositConvention
-
- All Implemented Interfaces:
Named
,IborFixingDepositConvention
,TradeConvention
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class ImmutableIborFixingDepositConvention extends Object implements IborFixingDepositConvention, org.joda.beans.ImmutableBean, Serializable
A convention for Ibor fixing deposit trades.This defines the convention for an Ibor fixing deposit against a particular index. In most cases, the index contains sufficient information to fully define the convention. As such, no other fields need to be specified when creating an instance. The name of the convention is the same as the name of the index by default. The getters will default any missing information on the fly, avoiding both null and
Optional
.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
IborFixingDepositTemplate
, not by this convention. However, the period is typically equal to the tenor of the index.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableIborFixingDepositConvention.Builder
The bean-builder forImmutableIborFixingDepositConvention
.static class
ImmutableIborFixingDepositConvention.Meta
The meta-bean forImmutableIborFixingDepositConvention
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableIborFixingDepositConvention.Builder
builder()
Returns a builder used to create an instance of the bean.IborFixingDepositTrade
createTrade(LocalDate tradeDate, Period depositPeriod, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
Creates a trade based on this convention.boolean
equals(Object obj)
BusinessDayAdjustment
getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date, providing a default result if no override specified.Currency
getCurrency()
Gets the primary currency, providing a default result if no override specified.DayCount
getDayCount()
Gets the day count convention applicable, providing a default result if no override specified.DaysAdjustment
getFixingDateOffset()
Gets the offset of the fixing date from the start date, providing a default result if no override specified.IborIndex
getIndex()
Gets the Ibor index.String
getName()
Gets the convention name, such as 'GBP-LIBOR-3M'.DaysAdjustment
getSpotDateOffset()
Gets the offset of the spot value date from the trade date, providing a default result if no override specified.int
hashCode()
static ImmutableIborFixingDepositConvention.Meta
meta()
The meta-bean forImmutableIborFixingDepositConvention
.ImmutableIborFixingDepositConvention.Meta
metaBean()
static ImmutableIborFixingDepositConvention
of(IborIndex index)
Obtains a convention based on the specified index.ImmutableIborFixingDepositConvention.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
IborFixingDepositTrade
toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate)
Creates a trade based on this convention.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.deposit.type.IborFixingDepositConvention
calculateSpotDateFromTradeDate, toTrade
-
-
-
-
Method Detail
-
of
public static ImmutableIborFixingDepositConvention of(IborIndex index)
Obtains a convention based on the specified index.The standard convention for an Ibor fixing deposit is based exclusively on the index. This creates an instance that contains the index. The instance is not dereferenced using the
FraConvention
name, as such the result of this method andIborFixingDepositConvention.of(IborIndex)
can differ.Use the builder for unusual conventions.
- Parameters:
index
- the index, the convention values are extracted from the index- Returns:
- the convention
-
getName
public String getName()
Gets the convention name, such as 'GBP-LIBOR-3M'.This will default to the name of the index if not specified.
- Specified by:
getName
in interfaceIborFixingDepositConvention
- Specified by:
getName
in interfaceNamed
- Returns:
- the convention name
-
getCurrency
public Currency getCurrency()
Gets the primary currency, providing a default result if no override specified.This is the currency of the Ibor fixing deposit and the currency that payment is made in. The data model permits this currency to differ from that of the index, however the two are typically the same.
This will default to the currency of the index if not specified.
- Returns:
- the currency, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention applicable, providing a default result if no override specified.This is used to convert dates to a numerical value. The data model permits the day count to differ from that of the index, however the two are typically the same.
This will default to the day count of the index if not specified.
- Returns:
- the day count, not null
-
getSpotDateOffset
public DaysAdjustment getSpotDateOffset()
Gets the offset of the spot value date from the trade date, providing a default result if no override specified.The offset is applied to the trade date and is typically plus 2 business days. The start and end date of the term are relative to the spot date.
This will default to the effective date offset of the index if not specified.
- Specified by:
getSpotDateOffset
in interfaceIborFixingDepositConvention
- Returns:
- the spot date offset, not null
-
getBusinessDayAdjustment
public BusinessDayAdjustment getBusinessDayAdjustment()
Gets the business day adjustment to apply to the start and end date, providing a default result if no override specified.The start and end date are typically defined as valid business days and thus do not need to be adjusted. If this optional property is present, then the start and end date will be adjusted as defined here.
This will default to 'ModifiedFollowing' using the index fixing calendar if not specified.
- Returns:
- the business day adjustment, not null
-
getFixingDateOffset
public DaysAdjustment getFixingDateOffset()
Gets the offset of the fixing date from the start date, providing a default result if no override specified.The offset is applied to the start date and is typically minus 2 business days. The data model permits the offset to differ from that of the index, however the two are typically the same.
This will default to the fixing date offset of the index if not specified.
- Returns:
- the fixing date offset, not null
-
createTrade
public IborFixingDepositTrade createTrade(LocalDate tradeDate, Period depositPeriod, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
Description copied from interface:IborFixingDepositConvention
Creates a trade based on this convention.This returns a trade based on the specified deposit period.
The notional is unsigned, with buy/sell determining the direction of the trade. If buying the Ibor fixing deposit, the floating rate is paid to the counterparty, with the fixed rate being received. If selling the Ibor fixing deposit, the floating rate is received from the counterparty, with the fixed rate being paid.
- Specified by:
createTrade
in interfaceIborFixingDepositConvention
- Parameters:
tradeDate
- the date of the tradedepositPeriod
- the period between the start date and the end datebuySell
- 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
-
toTrade
public IborFixingDepositTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double fixedRate)
Description copied from interface:IborFixingDepositConvention
Creates a trade based on this convention.This returns a trade based on the specified dates. The notional is unsigned, with buy/sell determining the direction of the trade. If buying the Ibor fixing deposit, the floating rate is paid to the counterparty, with the fixed rate being received. If selling the Ibor fixing deposit, the floating rate is received from the counterparty, with the fixed rate being paid.
- Specified by:
toTrade
in interfaceIborFixingDepositConvention
- Parameters:
tradeInfo
- additional information about the tradestartDate
- the start dateendDate
- the end datebuySell
- the buy/sell flagnotional
- the notional amount, in the payment currency of the templatefixedRate
- the fixed rate, typically derived from the market- Returns:
- the trade
-
meta
public static ImmutableIborFixingDepositConvention.Meta meta()
The meta-bean forImmutableIborFixingDepositConvention
.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableIborFixingDepositConvention.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableIborFixingDepositConvention.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getIndex
public IborIndex getIndex()
Gets the Ibor index.The floating rate to be paid or received is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'.
- Specified by:
getIndex
in interfaceIborFixingDepositConvention
- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableIborFixingDepositConvention.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-