Class TermDepositTemplate

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

    public final class TermDepositTemplate
    extends Object
    implements TradeTemplate, org.joda.beans.ImmutableBean, Serializable
    A template for creating a term deposit trade.

    This defines almost all the data necessary to create a TermDeposit. The trade date, notional and fixed rate are required to complete the template and create the trade. As such, it is often possible to get a market price for a trade based on the template. The market price is typically quoted as a bid/ask on the fixed rate.

    The template 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 implied deposit ends, typically a number of months after the start date
    See Also:
    Serialized Form
    • Method Detail

      • of

        public static TermDepositTemplate of​(Period depositPeriod,
                                             TermDepositConvention convention)
        Obtains a template based on the specified period and convention.
        Parameters:
        depositPeriod - the period between the start date and the end date
        convention - the market convention
        Returns:
        the template
      • createTrade

        public TermDepositTrade createTrade​(LocalDate tradeDate,
                                            BuySell buySell,
                                            double notional,
                                            double rate,
                                            ReferenceData refData)
        Creates a trade based on this template.

        This returns a trade based on the specified 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
        buySell - the buy/sell flag, see TermDeposit.getBuySell()
        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
      • meta

        public static TermDepositTemplate.Meta meta()
        The meta-bean for TermDepositTemplate.
        Returns:
        the meta-bean, not null
      • builder

        public static TermDepositTemplate.Builder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • getDepositPeriod

        public Period getDepositPeriod()
        Gets the period between the start date and the end date.
        Returns:
        the value of the property, not null
      • getConvention

        public TermDepositConvention getConvention()
        Gets the underlying term deposit convention.

        This specifies the standard convention of the term deposit to be created.

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

        public TermDepositTemplate.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object