Class ResolvedFxSwap

  • All Implemented Interfaces:
    ResolvedProduct, java.io.Serializable, Bean, ImmutableBean

    public final class ResolvedFxSwap
    extends java.lang.Object
    implements ResolvedProduct, ImmutableBean, java.io.Serializable
    An FX Swap, resolved for pricing.

    This is the resolved form of FxSwap and is an input to the pricers. Applications will typically create a ResolvedFxSwap from a FxSwap using FxSwap.resolve(ReferenceData).

    A ResolvedFxSwap is bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static ResolvedFxSwap of​(ResolvedFxSingle nearLeg,
                                        ResolvedFxSingle farLeg)
        Creates a ResolvedFxSwap from two legs.

        The transactions must be passed in with payment dates in the correct order. The currency pair of each leg must match and have amounts flowing in opposite directions.

        Parameters:
        nearLeg - the earlier leg
        farLeg - the later leg
        Returns:
        the resolved FX swap
      • ofForwardPoints

        public static ResolvedFxSwap ofForwardPoints​(CurrencyAmount amountCurrency1,
                                                     Currency currency2,
                                                     double nearFxRate,
                                                     double forwardPoints,
                                                     java.time.LocalDate nearDate,
                                                     java.time.LocalDate farDate)
        Creates a ResolvedFxSwap using forward points.

        The FX rate at the near date is specified as fxRate. The FX rate at the far date is equal to fxRate + forwardPoints

        The two currencies must not be equal. The near date must be before the far date. Conventions will be used to determine the base and counter currency.

        Parameters:
        amountCurrency1 - the amount of the near leg in the first currency
        currency2 - the second currency
        nearFxRate - the near FX rate, where (1.0 * amountCurrency1 = fxRate * amountCurrency2)
        forwardPoints - the forward points, where the far FX rate is (fxRate + forwardPoints)
        nearDate - the near value date
        farDate - the far value date
        Returns:
        the resolved FX swap
      • meta

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

        public ResolvedFxSingle getNearLeg()
        Gets the foreign exchange transaction at the earlier date.

        This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be before that of the far leg.

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

        public ResolvedFxSingle getFarLeg()
        Gets the foreign exchange transaction at the later date.

        This provides details of a single foreign exchange at a specific date. The payment date of this transaction must be after that of the near leg.

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object