Class IborRateSwapLegConvention

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

    public final class IborRateSwapLegConvention
    extends Object
    implements FloatRateSwapLegConvention, org.joda.beans.ImmutableBean, Serializable
    A market convention for the floating leg of rate swap trades based on an Ibor index.

    This defines the market convention for a floating leg based on the observed value of an Ibor index such as 'GBP-LIBOR-3M' or 'EUR-EURIBOR-1M'. In most cases, the index contains sufficient information to fully define the convention. As such, no other fields need to be specified when creating an instance. The getters will default any missing information on the fly, avoiding both null and Optional.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static IborRateSwapLegConvention of​(IborIndex index)
        Obtains a convention based on the specified index.

        The standard market convention for an Ibor rate leg is based on the index, with the stub convention set to 'SmartInitial'. Use the builder for unusual conventions.

        Parameters:
        index - the index, the market convention values are extracted from the index
        Returns:
        the convention
      • getCurrency

        public Currency getCurrency()
        Gets the leg currency, optional with defaulting getter.

        This is the currency of the swap leg and the currency that payment is made in. The data model permits this currency to differ from that of the index, however the two are typically the same.

        This will default to the currency of the index if not specified.

        Specified by:
        getCurrency in interface FloatRateSwapLegConvention
        Returns:
        the start date business day adjustment, not null
      • getDayCount

        public DayCount getDayCount()
        Gets the day count convention applicable, providing a default result if no override specified.

        This is used to convert dates to a numerical value. The data model permits the day count to differ from that of the index, however the two are typically the same.

        This will default to the day count of the index if not specified.

        Specified by:
        getDayCount in interface FloatRateSwapLegConvention
        Returns:
        the day count, not null
      • getAccrualFrequency

        public Frequency getAccrualFrequency()
        Gets the periodic frequency of accrual.

        Interest will be accrued over periods at the specified periodic frequency, such as every 3 months.

        This will default to the tenor of the index if not specified.

        Returns:
        the accrual frequency, not null
      • getAccrualBusinessDayAdjustment

        public BusinessDayAdjustment getAccrualBusinessDayAdjustment()
        Gets the business day adjustment to apply to accrual schedule dates, providing a default result if no override specified.

        Each date in the calculated schedule is determined without taking into account weekends and holidays. The adjustment specified here is used to convert those dates to valid business days. The start date and end date have their own business day adjustment rules.

        This will default to 'ModifiedFollowing' using the index fixing calendar if not specified.

        Specified by:
        getAccrualBusinessDayAdjustment in interface FloatRateSwapLegConvention
        Returns:
        the business day adjustment, not null
      • getStartDateBusinessDayAdjustment

        public BusinessDayAdjustment getStartDateBusinessDayAdjustment()
        Gets the business day adjustment to apply to the start date, providing a default result if no override specified.

        The start date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the start date to a valid business day.

        This will default to the accrualDatesBusinessDayAdjustment if not specified.

        Specified by:
        getStartDateBusinessDayAdjustment in interface FloatRateSwapLegConvention
        Returns:
        the start date business day adjustment, not null
      • getEndDateBusinessDayAdjustment

        public BusinessDayAdjustment getEndDateBusinessDayAdjustment()
        Gets the business day adjustment to apply to the end date, providing a default result if no override specified.

        The end date property is an unadjusted date and as such might be a weekend or holiday. The adjustment specified here is used to convert the end date to a valid business day.

        This will default to the accrualDatesBusinessDayAdjustment if not specified.

        Specified by:
        getEndDateBusinessDayAdjustment in interface FloatRateSwapLegConvention
        Returns:
        the end date business day adjustment, not null
      • getStubConvention

        public StubConvention getStubConvention()
        Gets the convention defining how to handle stubs, providing a default result if no override specified.

        The stub convention is used during schedule construction to determine whether the irregular remaining period occurs at the start or end of the schedule. It also determines whether the irregular period is shorter or longer than the regular period.

        This will default to 'SmartInitial' if not specified.

        Returns:
        the stub convention, not null
      • getRollConvention

        public RollConvention getRollConvention()
        Gets the convention defining how to roll dates, providing a default result if no override specified.

        The schedule periods are determined at the high level by repeatedly adding the frequency to the start date, or subtracting it from the end date. The roll convention provides the detailed rule to adjust the day-of-month or day-of-week.

        This will default to 'EOM' if not specified.

        Returns:
        the roll convention, not null
      • getFixingRelativeTo

        public FixingRelativeTo getFixingRelativeTo()
        Gets the base date that each fixing is made relative to, optional with defaulting getter.

        The fixing date is relative to either the start or end of each reset period.

        Note that in most cases, the reset frequency matches the accrual frequency and thus there is only one fixing for the accrual period.

        This will default to 'PeriodStart' if not specified.

        Returns:
        the fixing relative to, not null
      • getFixingDateOffset

        public DaysAdjustment getFixingDateOffset()
        The offset of the fixing date from each adjusted reset date, providing a default result if no override specified.

        The offset is applied to the base date specified by fixingRelativeTo. The offset is typically a negative number of business days. The data model permits the offset to differ from that of the index, however the two are typically the same.

        This will default to the fixing date offset of the index if not specified.

        Returns:
        the fixing date offset, not null
      • getPaymentFrequency

        public Frequency getPaymentFrequency()
        Gets the periodic frequency of payments, providing a default result if no override specified.

        Regular payments will be made at the specified periodic frequency. The frequency must be the same as, or a multiple of, the accrual periodic frequency.

        Compounding applies if the payment frequency does not equal the accrual frequency.

        This will default to the accrual frequency if not specified.

        Returns:
        the payment frequency, not null
      • getPaymentDateOffset

        public DaysAdjustment getPaymentDateOffset()
        Gets the offset of payment from the base date, providing a default result if no override specified.

        The offset is applied to the unadjusted date specified by paymentRelativeTo. Offset can be based on calendar days or business days.

        Specified by:
        getPaymentDateOffset in interface FloatRateSwapLegConvention
        Returns:
        the payment date offset, not null
      • getCompoundingMethod

        public CompoundingMethod getCompoundingMethod()
        Gets the compounding method to use when there is more than one accrual period in each payment period, providing a default result if no override specified.

        Compounding is used when combining accrual periods.

        Returns:
        the compounding method, not null
      • toLeg

        public RateCalculationSwapLeg toLeg​(LocalDate startDate,
                                            LocalDate endDate,
                                            PayReceive payReceive,
                                            double notional)
        Creates a leg based on this convention.

        This returns a leg based on the specified date. The notional is unsigned, with pay/receive determining the direction of the leg. If the leg is 'Pay', the fixed rate is paid to the counterparty. If the leg is 'Receive', the fixed rate is received from the counterparty.

        Parameters:
        startDate - the start date
        endDate - the end date
        payReceive - determines if the leg is to be paid or received
        notional - the notional
        Returns:
        the leg
      • toLeg

        public RateCalculationSwapLeg toLeg​(LocalDate startDate,
                                            LocalDate endDate,
                                            PayReceive payReceive,
                                            double notional,
                                            double spread)
        Creates a leg based on this convention.

        This returns a leg based on the specified date. The notional is unsigned, with pay/receive determining the direction of the leg. If the leg is 'Pay', the fixed rate is paid to the counterparty. If the leg is 'Receive', the fixed rate is received from the counterparty.

        Parameters:
        startDate - the start date
        endDate - the end date
        payReceive - determines if the leg is to be paid or received
        notional - the notional
        spread - the spread to apply
        Returns:
        the leg
      • getIndex

        public IborIndex getIndex()
        Gets the Ibor index.

        The floating rate to be paid is based on this index It will be a well known market index such as 'GBP-LIBOR-3M'.

        Specified by:
        getIndex in interface FloatRateSwapLegConvention
        Returns:
        the value of the property, not null
      • isNotionalExchange

        public boolean isNotionalExchange()
        Gets the flag indicating whether to exchange the notional.

        If 'true', the notional there is both an initial exchange and a final exchange of notional.

        This will default to 'false' if not specified.

        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object