Class ImmutableTermDepositConvention

  • All Implemented Interfaces:
    Named, TermDepositConvention, TradeConvention, Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class ImmutableTermDepositConvention
    extends Object
    implements TermDepositConvention, org.joda.beans.ImmutableBean, Serializable
    A market convention for term deposit trades.

    This defines the market convention for a term deposit.

    The convention is defined by three dates.

    • Trade date, the date that the trade is agreed
    • Start date or spot date, the date on which the deposit starts, typically 2 business days after the trade date
    • End date, the date on which the deposit ends, typically a number of months after the start date
    The period between the start date and the end date is specified by TermDepositTemplate, not by this convention.
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static ImmutableTermDepositConvention of​(String name,
                                                        Currency currency,
                                                        BusinessDayAdjustment businessDayAdjustment,
                                                        DayCount dayCount,
                                                        DaysAdjustment spotDateOffset)
        Obtains a convention based on the specified currency, business day adjustment, day count convention and spot date offset.
        Parameters:
        name - the name of the convention, such as 'GBP-Deposit-ON'
        currency - the currency, in which the payments are made
        businessDayAdjustment - the business day adjustment to apply to the start and end date
        dayCount - the day count convention, used to convert dates to a numerical value
        spotDateOffset - the offset of the spot value date from the trade date
        Returns:
        the convention
      • toTrade

        public TermDepositTrade toTrade​(TradeInfo tradeInfo,
                                        LocalDate startDate,
                                        LocalDate endDate,
                                        BuySell buySell,
                                        double notional,
                                        double rate)
        Description copied from interface: TermDepositConvention
        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 term deposit, the principal is paid at the start date and the principal plus interest is received at the end date. If selling the term deposit, the principal is received at the start date and the principal plus interest is paid at the end date.

        Specified by:
        toTrade in interface TermDepositConvention
        Parameters:
        tradeInfo - additional information about the trade
        startDate - the start date
        endDate - the end date
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        rate - the fixed rate, typically derived from the market
        Returns:
        the trade
      • getCurrency

        public Currency getCurrency()
        Gets the primary currency.

        This is the currency of the term deposit and the currency that payment is made in.

        Specified by:
        getCurrency in interface TermDepositConvention
        Returns:
        the value of the property, not null
      • getName

        public String getName()
        Gets the convention name, such as 'GBP-Deposit-ON'.
        Specified by:
        getName in interface Named
        Specified by:
        getName in interface TermDepositConvention
        Returns:
        the value of the property, not null
      • getBusinessDayAdjustment

        public BusinessDayAdjustment getBusinessDayAdjustment()
        Gets the business day adjustment to apply to the start and end date.

        The start and end date will be adjusted as defined here.

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

        public DayCount getDayCount()
        Gets the day count convention.

        This is used to convert dates to a numerical value.

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

        public DaysAdjustment getSpotDateOffset()
        Gets the offset of the spot value date from the trade date.

        The offset is applied to the trade date and is typically plus 2 business days. The start date of the term deposit is equal to the spot date and the end date of the term deposit is relative to the start date.

        Specified by:
        getSpotDateOffset in interface TermDepositConvention
        Returns:
        the value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object