Class ImmutableThreeLegBasisSwapConvention
- java.lang.Object
-
- com.opengamma.strata.product.swap.type.ImmutableThreeLegBasisSwapConvention
-
- All Implemented Interfaces:
Named,SingleCurrencySwapConvention,ThreeLegBasisSwapConvention,TradeConvention,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ImmutableThreeLegBasisSwapConvention extends Object implements ThreeLegBasisSwapConvention, org.joda.beans.ImmutableBean, Serializable
A market convention for three leg basis swap trades.This defines the market convention for a single currency basis swap. The convention is formed by combining three swap leg conventions in the same currency.
The market price is for the difference (spread) between the values of the two floating legs. This convention has three legs, the "spread leg", the "spread floating leg" and the "flat floating leg". The "spread leg" represented by the fixed leg will be added to the "spread floating leg" which is typically the leg with the shorter underlying tenor. Thus the "spread leg" and "spread floating leg" will have the same pay/receive direction.
The convention is defined by four key 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 the interest calculation starts, often the same as the spot date
- End date, the date on which the interest calculation ends, typically a number of years after the start date
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableThreeLegBasisSwapConvention.BuilderThe bean-builder forImmutableThreeLegBasisSwapConvention.static classImmutableThreeLegBasisSwapConvention.MetaThe meta-bean forImmutableThreeLegBasisSwapConvention.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableThreeLegBasisSwapConvention.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)IborRateSwapLegConventiongetFlatFloatingLeg()Gets the market convention of the floating leg that does not have the spread applied.StringgetName()Gets the convention name.DaysAdjustmentgetSpotDateOffset()Gets the offset of the spot value date from the trade date.IborRateSwapLegConventiongetSpreadFloatingLeg()Gets the market convention of the floating leg to which the spread leg is added.FixedRateSwapLegConventiongetSpreadLeg()Gets the market convention of the fixed leg for the spread.inthashCode()static ImmutableThreeLegBasisSwapConvention.Metameta()The meta-bean forImmutableThreeLegBasisSwapConvention.ImmutableThreeLegBasisSwapConvention.MetametaBean()static ImmutableThreeLegBasisSwapConventionof(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg)Obtains a convention based on the specified name and leg conventions.static ImmutableThreeLegBasisSwapConventionof(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg, DaysAdjustment spotDateOffset)Obtains a convention based on the specified name and leg conventions.ImmutableThreeLegBasisSwapConvention.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()SwapTradetoTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double spread)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.swap.type.SingleCurrencySwapConvention
calculateSpotDateFromTradeDate
-
Methods inherited from interface com.opengamma.strata.product.swap.type.ThreeLegBasisSwapConvention
createTrade, createTrade, toTrade
-
-
-
-
Method Detail
-
of
public static ImmutableThreeLegBasisSwapConvention of(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg)
Obtains a convention based on the specified name and leg conventions.The two leg conventions must be in the same currency. The spot date offset is set to be the effective date offset of the index of the spread floating leg.
The spread is represented by
FixedRateSwapLegConventionand to be applied tofloatingSpreadLeg.- Parameters:
name- the unique name of the conventionspreadLeg- the market convention for the spread leg added to one of the floating legspreadFloatingLeg- the market convention for the spread floating legflatFloatingLeg- the market convention for the flat floating leg- Returns:
- the convention
-
of
public static ImmutableThreeLegBasisSwapConvention of(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg, DaysAdjustment spotDateOffset)
Obtains a convention based on the specified name and leg conventions.The two leg conventions must be in the same currency.
The spread is represented by
FixedRateSwapLegConventionand to be applied tofloatingSpreadLeg.- Parameters:
name- the unique name of the conventionspreadLeg- the market convention for the spread leg added to one of the floating legspreadFloatingLeg- the market convention for the spread floating legflatFloatingLeg- the market convention for the flat floating legspotDateOffset- the offset of the spot value date from the trade date- Returns:
- the convention
-
toTrade
public SwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double spread)
Description copied from interface:ThreeLegBasisSwapConventionCreates 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 swap, the rate of the floating flat leg is received from the counterparty, with the rate of the floating spread leg and the spread of the fixed leg being paid. If selling the swap, the opposite occurs.
- Specified by:
toTradein interfaceSingleCurrencySwapConvention- Specified by:
toTradein interfaceThreeLegBasisSwapConvention- Parameters:
tradeInfo- additional information about the tradestartDate- the start dateendDate- the end datebuySell- the buy/sell flagnotional- the notional amountspread- the spread, typically derived from the market- Returns:
- the trade
-
meta
public static ImmutableThreeLegBasisSwapConvention.Meta meta()
The meta-bean forImmutableThreeLegBasisSwapConvention.- Returns:
- the meta-bean, not null
-
builder
public static ImmutableThreeLegBasisSwapConvention.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public ImmutableThreeLegBasisSwapConvention.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getName
public String getName()
Gets the convention name.- Specified by:
getNamein interfaceNamed- Specified by:
getNamein interfaceSingleCurrencySwapConvention- Specified by:
getNamein interfaceThreeLegBasisSwapConvention- Returns:
- the value of the property, not null
-
getSpreadLeg
public FixedRateSwapLegConvention getSpreadLeg()
Gets the market convention of the fixed leg for the spread.This is to be applied to
floatingSpreadLeg.- Specified by:
getSpreadLegin interfaceThreeLegBasisSwapConvention- Returns:
- the value of the property, not null
-
getSpreadFloatingLeg
public IborRateSwapLegConvention getSpreadFloatingLeg()
Gets the market convention of the floating leg to which the spread leg is added.- Specified by:
getSpreadFloatingLegin interfaceThreeLegBasisSwapConvention- Returns:
- the value of the property, not null
-
getFlatFloatingLeg
public IborRateSwapLegConvention getFlatFloatingLeg()
Gets the market convention of the floating leg that does not have the spread applied.- Specified by:
getFlatFloatingLegin interfaceThreeLegBasisSwapConvention- Returns:
- the value of the property, not null
-
getSpotDateOffset
public DaysAdjustment getSpotDateOffset()
Gets the offset of the spot value date from the trade date.The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".
- Specified by:
getSpotDateOffsetin interfaceSingleCurrencySwapConvention- Returns:
- the value of the property, not null
-
toBuilder
public ImmutableThreeLegBasisSwapConvention.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-