What is the purpose of LegalEntityDiscountingProvider

I am looking at this earlier post. Can someone explain me what is the purpose of LegalEntityDiscountingProvider ? How does it produce issuer curve and a repo curve ?

I know how to build a yield curve from this earlier post (CalibrationZeroRateUsd2OisFuturesIrsTest.java . I wanted to link it but it tells me i can only post 1 link). But i don’t know once i have the RatesProvider object as described in the code below, how do i take that and build out the LegalEntityDiscountingProvider or what is the relationship between the two. I believe this explanation is missing from the posts here and everyone can benefit from it


Thanks in advance!

Currently there is no support for calibrating repo and issuer curves for a legal entity provider. To achieve calibration, Strata would also need to be extended to support pricing Bills.

As such, pricing bonds currently requires the user to manually create the LegalEntityDiscountingProvider. It provides two maps, one for issuer curves and one for repo curves. The curve data would need to be available separately from Strata. See this test class for an example of how to populate the provider:

The basic idea is that a lookup is performed from the bond to a group, and there is one curve per group. An example of how the group concept might be used would be to define credit ratings. Thus, each individual bond could be mapped to a group representing AAA, AA, BBB etc, or Government vs Municipal etc, with a different pricing curve applied to each to represent the implied risk.

To perform initial pricing, it is possible to take the discount curve for a given currency and use the same curve in LegalEntityDiscountingProvider, however doing so will not correctly price the legal entity risks of the bond.