Pnl Series Calculations for CDS

I see an example that shows how to calculate the PnL series for IRS in the strata-example project.(HistoricalScenarioExample.java)
Is there a similar example that shows how this can be done for the CDS product as well and has the required scenario level data that will be used as inputs to calculate the pnl Series?

if there is no support out of the box, how easy it is to add this funcationality.

Hi,

Thanks for looking at Strata.

We don’t currently have a similar example for CDS, but it would follow exactly the same pattern as in HistoricalScenarioExample, with the exception that the market data would need to include credit curves as well as interest rate curves. You should be able to build up perturbations in the same way as in the example, and have these applied to the curves used in the CDS pricer.

A simple example of pricing a CDS for a single scenario is included in CdsPricingExample, which shows all the market data required.

If you come across any issues then please let us know!

Thanks Jonathan,
I will look into this and get back to you soon.

hi Jonathan,
PerturbationMapping discountCurveMappings = PerturbationMapping.of(
Curve.class,
AnyDiscountCurveFilter.INSTANCE,
buildShifts(usdDiscountCurves));

this is how the perturbations are done for IRS, for cds what should my input be for building the CurvePointShifts.

i see that in the CDS pricer we use cds.yieldCurves and singleName.creditCurves to price pv.

how do i extend this data set to do similar pv series calculations as IRS

Hi Anand,

I think you have identified a gap here where the market data types used for pricing credit products are not currently compatible with the general curve perturbations that work in the rates example. We intend to align Strata’s CDS implementation with the market data types used in our other products, which will fix this. In the meantime we will see if we can produce an example showing what would be needed at the moment for CDS. I will get back to you in the next few days.

Thanks,
Jon

thanks Jonathan,
I thought so but wanted to get a confirmation from OG.
Looking forward to ur example for CDS pnl series calculations.
Thanks
Anand

As promised, we have added CdsScenarioExample to strata-examples showing how perturbations would work for a single name CDS. Hopefully this is also clearer than the HistoricalScenarioExample, which we will improve in a similar way.

Please let us know if you have any more questions.

thanks Jonathan,
We will look at this example and get back to you if we have any questions