Case study:

Counterparty exposure calculations for an Asian bank

Summary:

We were hired by a large Singapore-based investment bank to help audit, rationalize and extend their counterparty exposure calculations.

Client requirement:

The client was a large Singapore-based investment bank. They had an existing but unsupported suite of counterparty exposure calculation models, written some years earlier by a third-party. The models calculated PCE (potential counterparty exposure) for a limited set of instruments. The models were used but not understood, and management had a low confidence level in them. The client’s requirements were to:

(a) Review the existing calculations for accuracy, appropriateness and agreement with market consensus.
(b) Fix and/or enhance the existing calculations based off the results of the review.
(c) Extend the calculations to cover further trade types and to calculate EE (expected exposure).

Solution:

We reviewed the existing calculations. Most were broadly correct; there were a few minor errors and, for fixed income derivatives, the model used was rather naïve.
We also reviewed the existing C++ code which implemented the calculations, and found it undocumented, needlessly complex and slow, no error reporting and with several obvious bugs.

We initially fixed the existing code, added in some error reporting, rationalized both the technical and the code structure (and hence improved the performance and maintainability) and changed the fixed income derivative model to a more sophisticated version. We also assisted the client in calibrating the models.

We then extended the calculations to cover the further trade types required by the client and to calculate the EE.

Finally, we delivered on-site training for the client on the use of the models, the theory behind the models, and how to maintain them in the future.

The full instrument list was cash equities, equity options, cash fx, fx options, FRAs, interest rate swaps, caps/floors, swaptions, currency swaps and CDSs.

Technically, the existing calculations were already in C++ and implemented within Excel as a series of add-ins via VBA. We built on the existing calculations in C++ and rationalized the Excel interface to remove the redundant VBA layer. The calibration sheets were written separately (to differentiate between the two processes – calibration and exposure calculation) in VBA.