Interface ThreeLegBasisSwapConvention

  • All Superinterfaces:
    Named, SingleCurrencySwapConvention, TradeConvention
    All Known Implementing Classes:
    ImmutableThreeLegBasisSwapConvention

    public interface ThreeLegBasisSwapConvention
    extends SingleCurrencySwapConvention, Named
    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.

    To manually create a convention, see ImmutableThreeLegBasisSwapConvention. To register a specific convention, see ThreeLegBasisSwapConvention.ini.

    • Method Detail

      • extendedEnum

        static ExtendedEnum<ThreeLegBasisSwapConvention> extendedEnum()
        Gets the extended enum helper.

        This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.

        Returns:
        the extended enum helper
      • getSpreadLeg

        FixedRateSwapLegConvention getSpreadLeg()
        Gets the market convention of the spread leg.
        Returns:
        the spread leg convention
      • getSpreadFloatingLeg

        IborRateSwapLegConvention getSpreadFloatingLeg()
        Gets the market convention of the floating leg to which the spread leg is added.
        Returns:
        the spread floating leg convention
      • getFlatFloatingLeg

        IborRateSwapLegConvention getFlatFloatingLeg()
        Gets the market convention of the floating leg that does not have the spread applied.
        Returns:
        the flat floating leg convention
      • createTrade

        default SwapTrade createTrade​(LocalDate tradeDate,
                                      Tenor tenor,
                                      BuySell buySell,
                                      double notional,
                                      double spread,
                                      ReferenceData refData)
        Creates a spot-starting trade based on this convention.

        This returns a trade based on the specified tenor. For example, a tenor of 5 years creates a swap starting on the spot date and maturing 5 years later.

        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:
        createTrade in interface SingleCurrencySwapConvention
        Parameters:
        tradeDate - the date of the trade
        tenor - the tenor of the swap
        buySell - the buy/sell flag
        notional - the notional amount
        spread - the spread, typically derived from the market
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
        Throws:
        ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
      • createTrade

        default SwapTrade createTrade​(LocalDate tradeDate,
                                      Period periodToStart,
                                      Tenor tenor,
                                      BuySell buySell,
                                      double notional,
                                      double spread,
                                      ReferenceData refData)
        Creates a forward-starting trade based on this convention.

        This returns a trade based on the specified period and tenor. For example, a period of 3 months and a tenor of 5 years creates a swap starting three months after the spot date and maturing 5 years later.

        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:
        createTrade in interface SingleCurrencySwapConvention
        Parameters:
        tradeDate - the date of the trade
        periodToStart - the period between the spot date and the start date
        tenor - the tenor of the swap
        buySell - the buy/sell flag
        notional - the notional amount
        spread - the spread, typically derived from the market
        refData - the reference data, used to resolve the trade dates
        Returns:
        the trade
        Throws:
        ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
      • toTrade

        default SwapTrade toTrade​(LocalDate tradeDate,
                                  LocalDate startDate,
                                  LocalDate endDate,
                                  BuySell buySell,
                                  double notional,
                                  double spread)
        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 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:
        toTrade in interface SingleCurrencySwapConvention
        Parameters:
        tradeDate - the date of 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
      • toTrade

        SwapTrade toTrade​(TradeInfo tradeInfo,
                          LocalDate startDate,
                          LocalDate endDate,
                          BuySell buySell,
                          double notional,
                          double spread)
        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 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:
        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