Class ImmutableLegalEntityDiscountingProvider

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

    public final class ImmutableLegalEntityDiscountingProvider
    extends java.lang.Object
    implements LegalEntityDiscountingProvider, ImmutableBean, java.io.Serializable
    An immutable provider of data for bond pricing, based on repo and issuer discounting.

    This used to price bonds issued by a legal entity. The data to do this includes discount factors of repo curves and issuer curves. If the bond is inflation linked, the price index data is obtained from RatesProvider.

    Two types of discount factors are provided by this class. Repo curves are looked up using either the security ID of the bond, or the issuer (legal entity). Issuer curves are only looked up using the issuer (legal entity).

    See Also:
    Serialized Form
    • Method Detail

      • repoCurveDiscountFactors

        public RepoCurveDiscountFactors repoCurveDiscountFactors​(SecurityId securityId,
                                                                 LegalEntityId issuerId,
                                                                 Currency currency)
        Description copied from interface: LegalEntityDiscountingProvider
        Gets the discount factors from a repo curve based on the security ID, issuer ID and currency.

        This searches first for a curve associated with the security iD and currency, and then for a curve associated with the issuer ID and currency.

        If the valuation date is on or after the specified date, the discount factor is 1.

        Specified by:
        repoCurveDiscountFactors in interface LegalEntityDiscountingProvider
        Parameters:
        securityId - the standard ID of security to get the discount factors for
        issuerId - the standard ID of legal entity to get the discount factors for
        currency - the currency to get the discount factors for
        Returns:
        the discount factors
      • repoCurveDiscountFactors

        public RepoCurveDiscountFactors repoCurveDiscountFactors​(LegalEntityId issuerId,
                                                                 Currency currency)
        Description copied from interface: LegalEntityDiscountingProvider
        Gets the discount factors from a repo curve based on the issuer ID and currency.

        This searches for a curve associated with the issuer ID and currency.

        If the valuation date is on or after the specified date, the discount factor is 1.

        Specified by:
        repoCurveDiscountFactors in interface LegalEntityDiscountingProvider
        Parameters:
        issuerId - the standard ID of legal entity to get the discount factors for
        currency - the currency to get the discount factors for
        Returns:
        the discount factors
      • issuerCurveDiscountFactors

        public IssuerCurveDiscountFactors issuerCurveDiscountFactors​(LegalEntityId issuerId,
                                                                     Currency currency)
        Description copied from interface: LegalEntityDiscountingProvider
        Gets the discount factors from an issuer based on the issuer ID and currency.

        This searches for a curve associated with the issuer ID and currency.

        If the valuation date is on or after the specified date, the discount factor is 1.

        Specified by:
        issuerCurveDiscountFactors in interface LegalEntityDiscountingProvider
        Parameters:
        issuerId - the standard ID to get the discount factors for
        currency - the currency to get the discount factors for
        Returns:
        the discount factors
      • data

        public <T> T data​(MarketDataId<T> id)
        Description copied from interface: LegalEntityDiscountingProvider
        Gets market data of a specific type.

        This is a general purpose mechanism to obtain market data. In general, it is desirable to pass the specific market data needed for pricing into the pricing method. However, in some cases, notably swaps, this is not feasible. It is strongly recommended to clearly state on pricing methods what data is required.

        Specified by:
        data in interface LegalEntityDiscountingProvider
        Type Parameters:
        T - the type of the value
        Parameters:
        id - the identifier to find
        Returns:
        the data associated with the key
      • findData

        public <T> java.util.Optional<T> findData​(MarketDataName<T> name)
        Description copied from interface: LegalEntityDiscountingProvider
        Finds the market data with the specified name.

        This is most commonly used to find a Curve using a CurveName. If the market data cannot be found, empty is returned.

        Specified by:
        findData in interface LegalEntityDiscountingProvider
        Type Parameters:
        T - the type of the market data value
        Parameters:
        name - the name to find
        Returns:
        the market data value, empty if not found
      • getValuationDate

        public java.time.LocalDate getValuationDate()
        Gets the valuation date. All curves and other data items in this provider are calibrated for this date.
        Specified by:
        getValuationDate in interface LegalEntityDiscountingProvider
        Returns:
        the value of the property, not null
      • getRepoCurveSecurityGroups

        public com.google.common.collect.ImmutableMap<SecurityId,​RepoGroup> getRepoCurveSecurityGroups()
        Gets the groups used to find a repo curve by security.

        This maps the security ID to a group. The group is used to find the curve in repoCurves.

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

        public com.google.common.collect.ImmutableMap<LegalEntityId,​RepoGroup> getRepoCurveGroups()
        Gets the groups used to find a repo curve by legal entity.

        This maps the legal entity ID to a group. The group is used to find the curve in repoCurves.

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

        public com.google.common.collect.ImmutableMap<Pair<RepoGroup,​Currency>,​DiscountFactors> getRepoCurves()
        Gets the repo curves, keyed by group and currency. The curve data, predicting the future, associated with each repo group and currency.
        Returns:
        the value of the property, not null
      • getIssuerCurveGroups

        public com.google.common.collect.ImmutableMap<LegalEntityId,​LegalEntityGroup> getIssuerCurveGroups()
        Gets the groups used to find an issuer curve by legal entity.

        This maps the legal entity ID to a group. The group is used to find the curve in issuerCurves.

        This property was renamed in version 1.1 of Strata from legalEntityMap.

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

        public com.google.common.collect.ImmutableMap<Pair<LegalEntityGroup,​Currency>,​DiscountFactors> getIssuerCurves()
        Gets the issuer curves, keyed by group and currency. The curve data, predicting the future, associated with each legal entity group and currency.
        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