Add CDS pricing, functions and examples #346
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Credit derivatives
This is a breakout from #334. It includes market data objects, pricers and functions, plus recent changes for CDS index. The code was primarily written by @jacbop.
Structure
Function
The
com.opengamma.strata.function.calculation.credit.AbstractCdsFunction
class contains a pair of switch statements that contain the only differing behavior between single name and index. Once we retrieve the appropriate market data key from the trade we resolve to theIsdaYieldCurveParRates
andIsdaCreditCurveParRates
object needed to generate calibrated curves for the existing analytics. In the future this should be modified to use market data functions to properly calibrate the curves in the market data functions.Market
Ids, Keys and ParRate curve objects for both ISDA Yield curves and ISDA Credit Spread curves. Support for single name and index according to the CDS Standard model.
Pricer
The
com.opengamma.strata.pricer.credit.IsdaCdsHelper
class wraps all interaction with the underlying analytics layerThe
com.opengamma.strata.pricer.credit.IsdaCdsPricer
class provides a PV function as well as functions for calculating parallel and bucketed IR01 and CS01 on par rates. Support for shifting on zero rates will be added in the future when the market data functions are added.