Class FixedRateSwapLegConvention

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

    public final class FixedRateSwapLegConvention
    extends Object
    implements SwapLegConvention, org.joda.beans.ImmutableBean, Serializable
    A market convention for the fixed leg of rate swap trades.

    This defines the market convention for a fixed leg in a specific currency.

    Some fields are mandatory, others are optional, providing the ability to override The getters will default any missing information on the fly, avoiding both null and Optional.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static FixedRateSwapLegConvention of​(Currency currency,
                                                    DayCount dayCount,
                                                    Frequency accrualFrequency,
                                                    BusinessDayAdjustment accrualBusinessDayAdjustment)
        Obtains a convention based on the specified parameters.

        The standard market convention for a fixed rate leg is based on these parameters, with the stub convention set to 'SmartInitial'. Use the builder for unusual conventions.

        Parameters:
        currency - the currency of the leg
        dayCount - the day count
        accrualFrequency - the accrual frequency
        accrualBusinessDayAdjustment - the accrual business day adjustment
        Returns:
        the convention
      • 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​(LocalDate startDate,
                                            LocalDate endDate,
                                            PayReceive payReceive,
                                            double notional,
                                            double fixedRate)
        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
        fixedRate - the fixed rate, typically derived from the market
        Returns:
        the leg
      • getCurrency

        public Currency getCurrency()
        Gets the leg currency.

        This is the currency of the swap leg and the currency that payment is made in.

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

        public DayCount getDayCount()
        Gets the day count convention applicable.

        This is used to convert schedule period dates to a numerical value.

        Returns:
        the value of the property, 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.

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

        public BusinessDayAdjustment getAccrualBusinessDayAdjustment()
        Gets the business day adjustment to apply to accrual schedule dates.

        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 may have their own business day adjustment rules. If those are not present, then this adjustment is used instead.

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

        public FixedAccrualMethod getAccrualMethod()
        Gets the accrual method using the fixed rate, defaulted to 'None'.

        This is normally 'None', but can be set forBrazilian swaps.

        Returns:
        the value of the property
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object