Class OvernightRateSwapLegConvention

  • All Implemented Interfaces:
    SwapLegConvention, java.io.Serializable, Bean, ImmutableBean

    public final class OvernightRateSwapLegConvention
    extends java.lang.Object
    implements SwapLegConvention, ImmutableBean, java.io.Serializable
    A market convention for the floating leg of rate swap trades based on an Overnight index.

    This defines the market convention for a floating leg based on the observed value of an Overnight index such as 'GBP-SONIA' or 'EUR-EONIA'. 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.

    There are two methods of accruing interest on an Overnight index - 'Compounded' and 'Averaged'. Averaging is primarily related to the 'USD-FED-FUND' index.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static OvernightRateSwapLegConvention of​(OvernightIndex index,
                                                        Frequency frequency,
                                                        int paymentOffsetDays)
        Obtains a convention based on the specified index, using the 'Compounded' accrual method.

        The standard market convention for an Overnight rate leg is based on the index, frequency and payment offset, with the accrual method set to 'Compounded' and 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
        frequency - the frequency of payment, which is also the frequency of accrual
        paymentOffsetDays - the lag in days of payment from the end of the accrual period using the fixing calendar
        Returns:
        the convention
      • of

        public static OvernightRateSwapLegConvention of​(OvernightIndex index,
                                                        Frequency frequency,
                                                        int paymentOffsetDays,
                                                        OvernightAccrualMethod accrualMethod)
        Creates a convention based on the specified index, specifying the accrual method.

        The standard market convention for an Overnight rate leg is based on the index, frequency, payment offset and accrual type, with the stub convention set to 'SmartInitial'. Use the builder for unusual conventions.

        The accrual method is usually 'Compounded'. The 'Averaged' method is primarily related to the 'USD-FED-FUND' index.

        Parameters:
        index - the index, the market convention values are extracted from the index
        frequency - the frequency of payment, which is also the frequency of accrual
        paymentOffsetDays - the lag in days of payment from the end of the accrual period using the fixing calendar
        accrualMethod - the method of accruing overnight interest
        Returns:
        the convention
      • getRateCutOffDays

        public int getRateCutOffDays()
        Gets the number of business days before the end of the period that the rate is cut off, defaulted to zero.

        When a rate cut-off applies, the final daily rate is determined this number of days before the end of the period, with any subsequent days having the same rate.

        The amount must be zero or positive. A value of zero or one will have no effect on the standard calculation. The fixing holiday calendar of the index is used to determine business days.

        For example, a value of 3 means that the rate observed on (periodEndDate - 3 business days) is also to be used on (periodEndDate - 2 business days) and (periodEndDate - 1 business day).

        If there are multiple accrual periods in the payment period, then this will only apply to the last accrual period in the payment period.

        This will default to zero if not specified.

        Returns:
        the rate cut off
      • 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.

        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.

        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 term frequency 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.

        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.

        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.

        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
      • 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.

        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​(java.time.LocalDate startDate,
                                            java.time.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​(java.time.LocalDate startDate,
                                            java.time.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 OvernightIndex getIndex()
        Gets the Overnight index.

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

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

        public OvernightAccrualMethod getAccrualMethod()
        Gets the method of accruing overnight interest, defaulted to 'Compounded'.

        Two methods of accrual are supported - 'Compounded' and 'Averaged'. Averaging is primarily related to the 'USD-FED-FUND' index.

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object