Interface CreditRatesMarketDataLookup

  • All Superinterfaces:
    CalculationParameter

    public interface CreditRatesMarketDataLookup
    extends CalculationParameter
    The lookup that provides access to credit rates in market data.

    The credit rates market lookup provides access to credit, discount and recovery rate curves.

    The lookup implements CalculationParameter and is used by passing it as an argument to CalculationRules. It provides the link between the data that the function needs and the data that is available in ScenarioMarketData.

    Implementations of this interface must be immutable.

    • Method Detail

      • of

        static CreditRatesMarketDataLookup of​(Map<Pair<StandardId,​Currency>,​CurveId> creditCurveIds,
                                              Map<Currency,​CurveId> discountCurveIds,
                                              Map<StandardId,​CurveId> recoveryRateCurveIds)
        Obtains an instance based on a maps for credit, discount and recovery rate curves.
        Parameters:
        creditCurveIds - the credit curve identifiers, keyed by legal entity ID and currency
        discountCurveIds - the discount curve identifiers, keyed by currency
        recoveryRateCurveIds - the recovery rate curve identifiers, keyed by legal entity ID
        Returns:
        the rates lookup containing the specified curves
      • of

        static CreditRatesMarketDataLookup of​(Map<Pair<StandardId,​Currency>,​CurveId> creditCurveIds,
                                              Map<Currency,​CurveId> discountCurveIds,
                                              Map<StandardId,​CurveId> recoveryRateCurveIds,
                                              ObservableSource observableSource)
        Obtains an instance based on a maps for credit, discount and recovery rate curves.
        Parameters:
        creditCurveIds - the credit curve identifiers, keyed by legal entity ID and currency
        discountCurveIds - the discount curve identifiers, keyed by currency
        recoveryRateCurveIds - the recovery rate curve identifiers, keyed by legal entity ID
        observableSource - the source of market data for quotes and other observable market data
        Returns:
        the rates lookup containing the specified curves
      • getDiscountCurrencies

        ImmutableSet<Currency> getDiscountCurrencies()
        Gets the set of currencies that discount factors are provided for.
        Returns:
        the set of discount curve currencies
      • getDiscountMarketDataIds

        ImmutableSet<MarketDataId<?>> getDiscountMarketDataIds​(Currency currency)
        Gets the identifiers used to obtain the discount factors for the specified currency.

        In most cases, the identifier will refer to a curve. If the currency is not found, an exception is thrown.

        Parameters:
        currency - the currency for which identifiers are required
        Returns:
        the set of market data identifiers
        Throws:
        IllegalArgumentException - if the currency is not found
      • getCreditLegalEntities

        ImmutableSet<Pair<StandardId,​Currency>> getCreditLegalEntities()
        Gets the set of pairs of legal entity ID and currency that credit curves are provided for.
        Returns:
        the set of pairs of legal entity ID and currency
      • getCreditMarketDataIds

        ImmutableSet<MarketDataId<?>> getCreditMarketDataIds​(StandardId standardId,
                                                             Currency currency)
        Gets the identifiers used to obtain the credit curve for the pair of legal entity ID and currency.

        In most cases, the identifier will refer to a curve. If the pair is not found, an exception is thrown.

        Parameters:
        standardId - the legal entity ID
        currency - the currency
        Returns:
        the set of market data identifiers
        Throws:
        IllegalArgumentException - if the pair is not found
      • getRecoveryRateLegalEntities

        ImmutableSet<StandardId> getRecoveryRateLegalEntities()
        Gets the set of legal entity IDs that recovery rate curves are provided for.
        Returns:
        the set of legal entity IDs
      • getRecoveryRateMarketDataIds

        ImmutableSet<MarketDataId<?>> getRecoveryRateMarketDataIds​(StandardId standardId)
        Gets the identifiers used to obtain the recovery rate curve for the legal entity ID.

        In most cases, the identifier will refer to a curve. If the ID is not found, an exception is thrown.

        Parameters:
        standardId - the legal entity ID
        Returns:
        the set of market data identifiers
        Throws:
        IllegalArgumentException - if the ID is not found
      • requirements

        FunctionRequirements requirements​(StandardId legalEntityId,
                                          Currency currency)
        Creates market data requirements for the specified standard ID and currency.
        Parameters:
        legalEntityId - legal entity ID
        currency - the currency
        Returns:
        the requirements
        Throws:
        IllegalArgumentException - if unable to create requirements
      • marketDataView

        default CreditRatesScenarioMarketData marketDataView​(ScenarioMarketData marketData)
        Obtains a filtered view of the complete set of market data.

        This method returns an instance that binds the lookup to the market data. The input is ScenarioMarketData, which contains market data for all scenarios.

        Parameters:
        marketData - the complete set of market data for all scenarios
        Returns:
        the filtered market data
      • marketDataView

        default CreditRatesMarketData marketDataView​(MarketData marketData)
        Obtains a filtered view of the complete set of market data.

        This method returns an instance that binds the lookup to the market data. The input is MarketData, which contains market data for one scenario.

        Parameters:
        marketData - the complete set of market data for one scenario
        Returns:
        the filtered market data
      • creditRatesProvider

        CreditRatesProvider creditRatesProvider​(MarketData marketData)
        Obtains credit rates provider based on the specified market data.

        This provides CreditRatesProvider suitable for pricing credit products. Although this method can be used directly, it is typically invoked indirectly via CreditRatesMarketData:

          // bind the baseData to this lookup
          CreditRatesMarketData view = lookup.marketView(baseData);
          
          // pass around CreditRatesMarketData within the function to use in pricing
          CreditRatesProvider provider = view.creditRatesProvider();
         
        Parameters:
        marketData - the complete set of market data for one scenario
        Returns:
        the rates provider