Class XCcyIborIborSwapTemplate

  • All Implemented Interfaces:
    TradeTemplate, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class XCcyIborIborSwapTemplate
    extends Object
    implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
    A template for creating cross-currency Ibor-Ibor swap trades.

    This defines almost all the data necessary to create a Ibor-Ibor cross-currency SwapTrade. The trade date, notional and spread are required to complete the template and create the trade. As such, it is often possible to get a market price for a trade based on the template. The market price is typically quoted as a spread on one leg.

    The template references four 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 accrual starts
    • End date, the date on which accrual ends
    Some of these dates are specified by the convention embedded within this template.
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static XCcyIborIborSwapTemplate of​(Tenor tenor,
                                                  XCcyIborIborSwapConvention convention)
        Obtains a template based on the specified tenor and convention.

        The swap will start on the spot date.

        Parameters:
        tenor - the tenor of the swap
        convention - the market convention
        Returns:
        the template
      • of

        public static XCcyIborIborSwapTemplate of​(Period periodToStart,
                                                  Tenor tenor,
                                                  XCcyIborIborSwapConvention convention)
        Obtains a template based on the specified period, tenor and convention.

        The period from the spot date to the start date is specified. The tenor from the start date to the end date is also specified.

        Parameters:
        periodToStart - the period between the spot date and the start date
        tenor - the tenor of the swap
        convention - the market convention
        Returns:
        the template
      • getCurrencyPair

        public CurrencyPair getCurrencyPair()
        Gets the currency pair of the template.
        Returns:
        the currency pair
      • createTrade

        public SwapTrade createTrade​(LocalDate tradeDate,
                                     BuySell buySell,
                                     double notionalSpreadLeg,
                                     double notionalFlatLeg,
                                     double spread,
                                     ReferenceData refData)
        Creates a trade based on this template.

        This returns a trade based on the specified trade date.

        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, with the rate of the spread leg being paid. If selling the swap, the opposite occurs.

        Parameters:
        tradeDate - the date of the trade
        buySell - the buy/sell flag
        notionalSpreadLeg - the notional amount for the spread leg
        notionalFlatLeg - the notional amount for the flat leg
        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
      • getPeriodToStart

        public Period getPeriodToStart()
        Gets the period between the spot value date and the start date.

        This is often zero, but can be greater if the swap if forward starting. This must not be negative.

        Returns:
        the value of the property, not null
      • getTenor

        public Tenor getTenor()
        Gets the tenor of the swap.

        This is the period from the first accrual date to the last accrual date.

        Returns:
        the value of the property, not null
      • getConvention

        public XCcyIborIborSwapConvention getConvention()
        Gets the market convention of the swap.
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object