Class CdsMarketQuoteConverter


  • public class CdsMarketQuoteConverter
    extends java.lang.Object
    The market quote converter for credit default swaps.
    • Constructor Detail

      • CdsMarketQuoteConverter

        public CdsMarketQuoteConverter()
        The default constructor.

        The original ISDA accrual-on-default formula (version 1.8.2 and lower) is used.

      • CdsMarketQuoteConverter

        public CdsMarketQuoteConverter​(AccrualOnDefaultFormula formula)
        The constructor with the accrual-on-default formula specified.
        Parameters:
        formula - the accrual-on-default formula
    • Method Detail

      • cleanPriceFromPointsUpfront

        public double cleanPriceFromPointsUpfront​(double pointsUpfront)
        Computes market clean price from points upfront.

        The points upfront and resultant price are represented as a fraction.

        Parameters:
        pointsUpfront - the points upfront
        Returns:
        the clean price
      • cleanPrice

        public double cleanPrice​(ResolvedCdsTrade trade,
                                 CreditRatesProvider ratesProvider,
                                 ReferenceData refData)
        Computes the market clean price.

        The market clean price is usually expressed in percentage. Here a fraction of notional is returned, e.g., 0.98 is 98(%) clean price.

        A relevant credit curve must be pre-calibrated and stored in ratesProvider.

        Parameters:
        trade - the trade
        ratesProvider - the rates provider
        refData - the reference data
        Returns:
        the clean price
      • pointsUpfront

        public double pointsUpfront​(ResolvedCdsTrade trade,
                                    CreditRatesProvider ratesProvider,
                                    ReferenceData refData)
        Computes the points upfront.

        The points upfront quote is usually expressed in percentage. Here a fraction of notional is returned, e.g., 0.01 is 1(%) points up-front

        The relevant credit curve must be pre-calibrated and stored in ratesProvider.

        Parameters:
        trade - the trade
        ratesProvider - the rates provider
        refData - the reference data
        Returns:
        the points upfront
      • pointsUpFrontFromQuotedSpread

        public CdsQuote pointsUpFrontFromQuotedSpread​(ResolvedCdsTrade trade,
                                                      CdsQuote quote,
                                                      CreditRatesProvider ratesProvider,
                                                      ReferenceData refData)
        Converts quoted spread to points upfront.

        Thus quote must be CdsQuoteConvention.QUOTED_SPREAD.

        The relevant discount curve and recovery rate curve must be stored in ratesProvider. The credit curve is internally calibrated to convert one quote type to the other quote type.

        Parameters:
        trade - the trade
        quote - the quote
        ratesProvider - the rates provider
        refData - the reference data
        Returns:
        the quote
      • quotedSpreadFromPointsUpfront

        public CdsQuote quotedSpreadFromPointsUpfront​(ResolvedCdsTrade trade,
                                                      CdsQuote quote,
                                                      CreditRatesProvider ratesProvider,
                                                      ReferenceData refData)
        Converts points upfront to quoted spread.

        Thus quote must be CdsQuoteConvention.POINTS_UPFRONT.

        The relevant discount curve and recovery rate curve must be stored in ratesProvider. The credit curve is internally calibrated to convert one quote type to the other quote type.

        Parameters:
        trade - the trade
        quote - the quote
        ratesProvider - the rates provider
        refData - the reference data
        Returns:
        the quote
      • quotesFromParSpread

        public java.util.List<CdsQuote> quotesFromParSpread​(java.util.List<ResolvedCdsTrade> trades,
                                                            java.util.List<CdsQuote> quotes,
                                                            CreditRatesProvider ratesProvider,
                                                            CdsQuoteConvention targetConvention,
                                                            ReferenceData refData)
        The par spread quotes are converted to points upfronts or quoted spreads.

        The relevant discount curve and recovery rate curve must be stored in ratesProvider. The credit curve is internally calibrated to par spread values.

        trades must be sorted in ascending order in maturity and coherent to quotes.

        The resultant quote is specified by targetConvention.

        Parameters:
        trades - the trades
        quotes - the quotes
        ratesProvider - the rates provider
        targetConvention - the target convention
        refData - the reference data
        Returns:
        the quotes