Interface TermDepositConvention

    • Method Detail

      • extendedEnum

        static ExtendedEnum<TermDepositConvention> extendedEnum()
        Gets the extended enum helper.

        This helper allows instances of the convention to be looked up. It also provides the complete set of available instances.

        Returns:
        the extended enum helper
      • getCurrency

        Currency getCurrency()
        Gets the primary currency.

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

        Returns:
        the currency
      • getSpotDateOffset

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

        The offset is applied to the trade date to find the start date. A typical value is "plus 2 business days".

        Returns:
        the spot date offset, not null
      • createTrade

        default TermDepositTrade createTrade​(LocalDate tradeDate,
                                             MarketTenor marketTenor,
                                             BuySell buySell,
                                             double notional,
                                             double rate,
                                             ReferenceData refData)
        Creates a trade based on this convention using a market tenor, such as ON, TN, SN, SW or 1M.

        This returns a trade based on the market tenor. If the market tenor is ON or TN, the spot lag of the convention will be overridden.

        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.

        Parameters:
        tradeDate - the date of the trade
        marketTenor - the market tenor, defining the spot lag and tenor
        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
        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
      • createTrade

        default TermDepositTrade createTrade​(LocalDate tradeDate,
                                             Period depositPeriod,
                                             BuySell buySell,
                                             double notional,
                                             double rate,
                                             ReferenceData refData)
        Creates a trade based on this convention.

        This returns a trade based on the specified deposit period, starting from the spot date.

        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.

        Parameters:
        tradeDate - the date of the trade
        depositPeriod - the period between the start date and 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
        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
      • toTrade

        default TermDepositTrade toTrade​(LocalDate tradeDate,
                                         LocalDate startDate,
                                         LocalDate endDate,
                                         BuySell buySell,
                                         double notional,
                                         double rate)
        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.

        Parameters:
        tradeDate - the date of 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
      • toTrade

        TermDepositTrade toTrade​(TradeInfo tradeInfo,
                                 LocalDate startDate,
                                 LocalDate endDate,
                                 BuySell buySell,
                                 double notional,
                                 double rate)
        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.

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

        default LocalDate calculateSpotDateFromTradeDate​(LocalDate tradeDate,
                                                         ReferenceData refData)
        Calculates the spot date from the trade date.
        Parameters:
        tradeDate - the trade date
        refData - the reference data, used to resolve the date
        Returns:
        the spot date
        Throws:
        ReferenceDataNotFoundException - if an identifier cannot be resolved in the reference data
      • getName

        String getName()
        Gets the name that uniquely identifies this convention.

        This name is used in serialization and can be parsed using of(String).

        Specified by:
        getName in interface Named
        Returns:
        the unique name