public final class ImmutableThreeLegBasisSwapConvention extends Object implements ThreeLegBasisSwapConvention, org.joda.beans.ImmutableBean, Serializable
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
ImmutableThreeLegBasisSwapConvention.Builder
The bean-builder for
ImmutableThreeLegBasisSwapConvention. |
static class |
ImmutableThreeLegBasisSwapConvention.Meta
The meta-bean for
ImmutableThreeLegBasisSwapConvention. |
| Modifier and Type | Method and Description |
|---|---|
static ImmutableThreeLegBasisSwapConvention.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
IborRateSwapLegConvention |
getFlatFloatingLeg()
Gets the market convention of the floating leg that does not have the spread applied.
|
String |
getName()
Gets the convention name.
|
DaysAdjustment |
getSpotDateOffset()
Gets the offset of the spot value date from the trade date.
|
IborRateSwapLegConvention |
getSpreadFloatingLeg()
Gets the market convention of the floating leg to which the spread leg is added.
|
FixedRateSwapLegConvention |
getSpreadLeg()
Gets the market convention of the fixed leg for the spread.
|
int |
hashCode() |
static ImmutableThreeLegBasisSwapConvention.Meta |
meta()
The meta-bean for
ImmutableThreeLegBasisSwapConvention. |
ImmutableThreeLegBasisSwapConvention.Meta |
metaBean() |
static ImmutableThreeLegBasisSwapConvention |
of(String name,
FixedRateSwapLegConvention spreadLeg,
IborRateSwapLegConvention spreadFloatingLeg,
IborRateSwapLegConvention flatFloatingLeg)
Obtains a convention based on the specified name and leg conventions.
|
static ImmutableThreeLegBasisSwapConvention |
of(String name,
FixedRateSwapLegConvention spreadLeg,
IborRateSwapLegConvention spreadFloatingLeg,
IborRateSwapLegConvention flatFloatingLeg,
DaysAdjustment spotDateOffset)
Obtains a convention based on the specified name and leg conventions.
|
ImmutableThreeLegBasisSwapConvention.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
SwapTrade |
toTrade(TradeInfo tradeInfo,
LocalDate startDate,
LocalDate endDate,
BuySell buySell,
double notional,
double spread)
Creates a trade based on this convention.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcreateTrade, createTrade, extendedEnum, of, toTradecalculateSpotDateFromTradeDatepublic static ImmutableThreeLegBasisSwapConvention of(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg)
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 FixedRateSwapLegConvention and to be applied to floatingSpreadLeg.
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 legpublic static ImmutableThreeLegBasisSwapConvention of(String name, FixedRateSwapLegConvention spreadLeg, IborRateSwapLegConvention spreadFloatingLeg, IborRateSwapLegConvention flatFloatingLeg, DaysAdjustment spotDateOffset)
The two leg conventions must be in the same currency.
The spread is represented by FixedRateSwapLegConvention and to be applied to floatingSpreadLeg.
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 datepublic SwapTrade toTrade(TradeInfo tradeInfo, LocalDate startDate, LocalDate endDate, BuySell buySell, double notional, double spread)
ThreeLegBasisSwapConventionThis 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.
toTrade in interface SingleCurrencySwapConventiontoTrade in interface ThreeLegBasisSwapConventiontradeInfo - additional information about the tradestartDate - the start dateendDate - the end datebuySell - the buy/sell flagnotional - the notional amountspread - the spread, typically derived from the marketpublic static ImmutableThreeLegBasisSwapConvention.Meta meta()
ImmutableThreeLegBasisSwapConvention.public static ImmutableThreeLegBasisSwapConvention.Builder builder()
public ImmutableThreeLegBasisSwapConvention.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic String getName()
getName in interface NamedgetName in interface SingleCurrencySwapConventiongetName in interface ThreeLegBasisSwapConventionpublic FixedRateSwapLegConvention getSpreadLeg()
This is to be applied to floatingSpreadLeg.
getSpreadLeg in interface ThreeLegBasisSwapConventionpublic IborRateSwapLegConvention getSpreadFloatingLeg()
getSpreadFloatingLeg in interface ThreeLegBasisSwapConventionpublic IborRateSwapLegConvention getFlatFloatingLeg()
getFlatFloatingLeg in interface ThreeLegBasisSwapConventionpublic DaysAdjustment getSpotDateOffset()
The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".
getSpotDateOffset in interface SingleCurrencySwapConventionpublic ImmutableThreeLegBasisSwapConvention.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.