Class ImmutableIborIborSwapConvention

  • All Implemented Interfaces:
    Named, IborIborSwapConvention, SingleCurrencySwapConvention, TradeConvention, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class ImmutableIborIborSwapConvention
    extends Object
    implements IborIborSwapConvention, org.joda.beans.ImmutableBean, Serializable
    A market convention for Ibor-Ibor swap trades.

    This defines the market convention for a Ibor-Ibor single currency swap. The convention is formed by combining two swap leg conventions in the same currency.

    The market price is for the difference (spread) between the values of the two legs. This convention has two legs, the "spread leg" and the "flat leg". The spread will be added to the "spread leg", which is typically the leg with the shorter underlying tenor. The payment frequency is typically determined by the longer underlying tenor, with compounding applied.

    For example, a 'USD 3s1s' basis swap has 'USD-LIBOR-1M' as the spread leg and 'USD-LIBOR-3M' as the flat leg. Payment is every 3 months, with the one month leg compounded.

    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
    • Method Detail

      • of

        public static ImmutableIborIborSwapConvention of​(String name,
                                                         IborRateSwapLegConvention spreadLeg,
                                                         IborRateSwapLegConvention flatLeg)
        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 leg.

        Parameters:
        name - the unique name of the convention
        spreadLeg - the market convention for the leg that the spread is added to
        flatLeg - the market convention for the other leg, known as the flat leg
        Returns:
        the convention
      • of

        public static ImmutableIborIborSwapConvention of​(String name,
                                                         IborRateSwapLegConvention spreadLeg,
                                                         IborRateSwapLegConvention flatLeg,
                                                         DaysAdjustment spotDateOffset)
        Obtains a convention based on the specified name and leg conventions.

        The two leg conventions must be in the same currency.

        Parameters:
        name - the unique name of the convention
        spreadLeg - the market convention for the leg that the spread is added to
        flatLeg - the market convention for the other leg, known as the flat leg
        spotDateOffset - 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: IborIborSwapConvention
        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 swap, the rate of the flat leg is received from the counterparty, with the rate of the spread leg being paid. If selling the swap, the opposite occurs.

        Specified by:
        toTrade in interface IborIborSwapConvention
        Specified by:
        toTrade in interface SingleCurrencySwapConvention
        Parameters:
        tradeInfo - additional information about the trade
        startDate - the start date
        endDate - the end date
        buySell - the buy/sell flag
        notional - the notional amount
        spread - the spread, typically derived from the market
        Returns:
        the trade
      • getSpreadLeg

        public IborRateSwapLegConvention getSpreadLeg()
        Gets the market convention of the floating leg that has the spread applied.

        The spread is the market price of the instrument. It is added to the observed interest rate.

        Specified by:
        getSpreadLeg in interface IborIborSwapConvention
        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:
        getSpotDateOffset in interface SingleCurrencySwapConvention
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object