Class CounterpartyExposureTracker

java.lang.Object
com.quantfinlib.risk.CounterpartyExposureTracker

public final class CounterpartyExposureTracker extends Object
Counterparty credit exposure modeling with netting:
  • Current exposure — max(0, net mark-to-market) per netting set.
  • Potential future exposure — notional add-ons by tenor bucket (BIS current-exposure-method style FX factors: <1y 1%, 1–5y 5%, >5y 7.5%).
  • Constructor Details

    • CounterpartyExposureTracker

      public CounterpartyExposureTracker()
  • Method Details

    • addTrade

    • currentExposure

      public double currentExposure(String counterparty)
      Net current exposure (MTM netted within the counterparty netting set, floored at 0).
    • potentialFutureExposure

      public double potentialFutureExposure(String counterparty)
      Potential future exposure with the CEM net-to-gross adjustment: PFE = (0.4 + 0.6 * NGR) * sum |notional| * addOn, where NGR = net current exposure / gross positive MTM. A well-hedged netting set (offsetting MTMs) earns up to a 60% add-on reduction — the gross add-on alone materially over-states exposure for exactly the books that hedge, which is what the netting agreement is FOR. NGR is 1 (no relief) when there is no positive MTM to net against.
    • totalExposure

      public double totalExposure(String counterparty)
      Total exposure = current + potential future.
    • allExposures

      public Map<String,Double> allExposures()
      Total exposure per counterparty (insertion order preserved).
    • addOnFactor

      public static double addOnFactor(double tenorYears)
      BIS CEM-style FX add-on factor by residual tenor.