Interface LegalEntityDiscountingProvider

  • All Known Implementing Classes:
    ImmutableLegalEntityDiscountingProvider

    public interface LegalEntityDiscountingProvider
    A provider of data for bond pricing, based on repo and issuer discounting.

    This provides the environmental information against which bond pricing occurs, which is the repo and issuer curves. If the bond is inflation linked, the price index data is obtained from RatesProvider.

    The standard independent implementation is ImmutableLegalEntityDiscountingProvider.

    All implementations of this interface must be immutable and thread-safe.

    • Method Detail

      • getValuationDate

        java.time.LocalDate getValuationDate()
        Gets the valuation date.

        The raw data in this provider is calibrated for this date.

        Returns:
        the valuation date
      • repoCurveDiscountFactors

        RepoCurveDiscountFactors repoCurveDiscountFactors​(SecurityId securityId,
                                                          LegalEntityId issuerId,
                                                          Currency currency)
        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.

        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
        Throws:
        java.lang.IllegalArgumentException - if the discount factors are not available
      • repoCurveDiscountFactors

        RepoCurveDiscountFactors repoCurveDiscountFactors​(LegalEntityId issuerId,
                                                          Currency currency)
        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.

        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
        Throws:
        java.lang.IllegalArgumentException - if the discount factors are not available
      • issuerCurveDiscountFactors

        IssuerCurveDiscountFactors issuerCurveDiscountFactors​(LegalEntityId issuerId,
                                                              Currency currency)
        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.

        Parameters:
        issuerId - the standard ID to get the discount factors for
        currency - the currency to get the discount factors for
        Returns:
        the discount factors
        Throws:
        java.lang.IllegalArgumentException - if the discount factors are not available
      • data

        <T> T data​(MarketDataId<T> id)
        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.

        Type Parameters:
        T - the type of the value
        Parameters:
        id - the identifier to find
        Returns:
        the data associated with the key
        Throws:
        java.lang.IllegalArgumentException - if the data is not available
      • findData

        <T> java.util.Optional<T> findData​(MarketDataName<T> name)
        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.

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

        ImmutableLegalEntityDiscountingProvider toImmutableLegalEntityDiscountingProvider()
        Converts this provider to an equivalent ImmutableLegalEntityDiscountingProvider.
        Returns:
        the equivalent immutable legal entity provider