Interface FraConvention

  • All Superinterfaces:
    Named, TradeConvention
    All Known Implementing Classes:
    ImmutableFraConvention

    public interface FraConvention
    extends TradeConvention, Named
    A market convention for forward rate agreement (FRA) trades.

    This defines the market convention for a FRA against a particular index. In most cases, the index contains sufficient information to fully define the convention. As such, the convention is set to be created on the fly based on the index.

    To manually create a convention, see ImmutableFraConvention. To register a specific convention, see FraConvention.ini.

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default java.time.LocalDate calculateSpotDateFromTradeDate​(java.time.LocalDate tradeDate, ReferenceData refData)
      Calculates the spot date from the trade date.
      default FraTrade createTrade​(java.time.LocalDate tradeDate, java.time.Period periodToStart, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
      Creates a trade based on this convention, using the index tenor to define the end of the FRA.
      FraTrade createTrade​(java.time.LocalDate tradeDate, java.time.Period periodToStart, java.time.Period periodToEnd, BuySell buySell, double notional, double fixedRate, ReferenceData refData)
      Creates a trade based on this convention, specifying the end of the FRA.
      static ExtendedEnum<FraConvention> extendedEnum()
      Gets the extended enum helper.
      IborIndex getIndex()
      Gets the Ibor index.
      java.lang.String getName()
      Gets the name that uniquely identifies this convention.
      DaysAdjustment getSpotDateOffset()
      Gets the offset of the spot value date from the trade date.
      static FraConvention of​(IborIndex index)
      Obtains a convention based on the specified index.
      static FraConvention of​(java.lang.String uniqueName)
      Obtains an instance from the specified unique name.
      FraTrade toTrade​(TradeInfo tradeInfo, java.time.LocalDate startDate, java.time.LocalDate endDate, java.time.LocalDate paymentDate, BuySell buySell, double notional, double fixedRate)
      Creates a trade based on this convention.
      default FraTrade toTrade​(java.time.LocalDate tradeDate, java.time.LocalDate startDate, java.time.LocalDate endDate, java.time.LocalDate paymentDate, BuySell buySell, double notional, double fixedRate)
      Creates a trade based on this convention.
    • Method Detail

      • of

        static FraConvention of​(java.lang.String uniqueName)
        Obtains an instance from the specified unique name.
        Parameters:
        uniqueName - the unique name
        Returns:
        the convention
        Throws:
        java.lang.IllegalArgumentException - if the name is not known
      • of

        static FraConvention of​(IborIndex index)
        Obtains a convention based on the specified index.

        This uses the index name to find the matching convention. By default, this will always return a convention, however configuration may be added to restrict the conventions that are registered.

        Parameters:
        index - the index, from which the index name is used to find the matching convention
        Returns:
        the convention
        Throws:
        java.lang.IllegalArgumentException - if no convention is registered for the index
      • extendedEnum

        static ExtendedEnum<FraConvention> 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
      • getIndex

        IborIndex getIndex()
        Gets the Ibor index.

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

        Returns:
        the index
      • 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 FraTrade createTrade​(java.time.LocalDate tradeDate,
                                     java.time.Period periodToStart,
                                     BuySell buySell,
                                     double notional,
                                     double fixedRate,
                                     ReferenceData refData)
        Creates a trade based on this convention, using the index tenor to define the end of the FRA.

        This returns a trade based on the specified period to start. For example, a '2 x 5' FRA has a period to the start date of 2 months. The period to the end, 5 months, is implied by adding the tenor of the index, 3 months, to the period to start.

        The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.

        The start date will be the trade date, plus spot offset, plus period to start, adjusted to a valid business day. The end date will be the trade date, plus spot offset, plus period to start, plus index tenor, adjusted to a valid business day. The adjustment of the start and end date occurs at trade creation. The payment date offset is also applied at trade creation. When the Fra is resolved, the start and end date are not adjusted again but the payment date is.

        Parameters:
        tradeDate - the date of the trade
        periodToStart - the period between the spot date and the start date
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - 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

        FraTrade createTrade​(java.time.LocalDate tradeDate,
                             java.time.Period periodToStart,
                             java.time.Period periodToEnd,
                             BuySell buySell,
                             double notional,
                             double fixedRate,
                             ReferenceData refData)
        Creates a trade based on this convention, specifying the end of the FRA.

        This returns a trade based on the specified periods. For example, a '2 x 5' FRA has a period to the start date of 2 months and a period to the end date of 5 months.

        The notional is unsigned, with buy/sell determining the direction of the trade. If buying the FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.

        The start date will be the trade date, plus spot offset, plus period to start, adjusted to a valid business day. The end date will be the trade date, plus spot offset, plus period to end, adjusted to a valid business day. The adjustment of the start and end date occurs at trade creation. The payment date offset is also applied at trade creation. When the Fra is resolved, the start and end date are not adjusted again but the payment date is.

        Parameters:
        tradeDate - the date of the trade
        periodToStart - the period between the spot date and the start date
        periodToEnd - the period between the spot date and the end date
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - 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 FraTrade toTrade​(java.time.LocalDate tradeDate,
                                 java.time.LocalDate startDate,
                                 java.time.LocalDate endDate,
                                 java.time.LocalDate paymentDate,
                                 BuySell buySell,
                                 double notional,
                                 double fixedRate)
        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 FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.

        Parameters:
        tradeDate - the date of the trade
        startDate - the start date, which should be adjusted to be a valid business day
        endDate - the end date, which should be adjusted to be a valid business day
        paymentDate - the payment date, which should be adjusted to be a valid business day
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - the fixed rate, typically derived from the market
        Returns:
        the trade
      • toTrade

        FraTrade toTrade​(TradeInfo tradeInfo,
                         java.time.LocalDate startDate,
                         java.time.LocalDate endDate,
                         java.time.LocalDate paymentDate,
                         BuySell buySell,
                         double notional,
                         double fixedRate)
        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 FRA, the floating rate is received from the counterparty, with the fixed rate being paid. If selling the FRA, the floating rate is paid to the counterparty, with the fixed rate being received.

        Parameters:
        tradeInfo - additional information about the trade
        startDate - the start date, which should be adjusted to be a valid business day
        endDate - the end date, which should be adjusted to be a valid business day
        paymentDate - the payment date, which should be adjusted to be a valid business day
        buySell - the buy/sell flag
        notional - the notional amount, in the payment currency of the template
        fixedRate - the fixed rate, typically derived from the market
        Returns:
        the trade
      • calculateSpotDateFromTradeDate

        default java.time.LocalDate calculateSpotDateFromTradeDate​(java.time.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

        java.lang.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