Traders at HSBC need to monitor their level of counterparty risk exposure on an ongoing basis. Increasing scrutiny from regulators means that Credit Value Adjustment (CVA) analysis must be carried out regularly over their entire portfolio to compute their risk exposure and consequently their regulatory capital requirements.

HSBC logo

Traditionally, this kind of calculation takes many hours to run on a bank’s grid facility. Eurico Covas, Head of QRVG Development and Hedge Accounting Systems – Quantitative Risk and Valuation Group (QRVG) – wanted to see whether it was possible to run this calculation on an intra-day rather than an overnight basis.

He put together an experimental facility involving a couple of GPUs from NVIDIA. He turned to Xcelerit for the software part of the picture. “We already had extensive in-house libraries to carry out CVA and other calculations, and we had heard that Xcelerit offered an easy way to get our existing code to drive GPUs at their maximum speeds”, he said.

HSBC assigned just one quant developer to the project who was given some basic tuition introducing the Xcelerit SDK before tackling the task of speeding up the existing code base. The bank make extensive use of an in-house developed quant library and with less than handful of days effort, the developer was able to identify where the hot-spots were in the existing code and insert some carefully chosen lines invoking the Xcelerit API. Once the code is modified in this way, it can be run, without change, on any combination of CPU or GPU hardware that happens to be available.

The effects of the code transformation were dramatic. In one example, a set of 10,000 swap instruments was priced for a set of 1,000 Monte-Carlo scenarios at 26 time steps. This adds up to a staggering 260 million pricings in total. An average is taken over all scenarios to get the expected exposure at all time steps. Speedups of 19x have been achieved on an Nvidia Tesla K20 GPU, compared to an equivalent multi-core CPU implementation on an Intel Xeon E5620 CPU. When run on a system with 3 GPUs, this performance scales almost linearly, achieving a speedup of nearly 57x.

Eurico Covas is very pleased with the outcome. “We are just dipping our toes in the water on this”, he said. “Our quant teams have a voracious appetite for computing power and obviously using GPUs offers a cost-effective solution to that problem”. He is conscious though that any new hardware will require software to drive it. “A major part of HSBCs competitive advantage lies in our extensive in-house code-base and libraries – obviously we are keen to maintain that value – harnessing the power of new hardware without having to maintain multiple versions of our code”. The Xcelerit approach allows small modifications to be made to an existing program or library and then the SDK takes care of mapping that code efficiently onto whatever combination of CPU or GPU hardware is available. “From our point of view, this is a very good outcome”, he said, “We can get the speedups we require, maintain a single codebase and run the executable on any of our in-house facilities”. “This is a very efficient way to cut infrastructure and development costs”, he added.

The trial deployment is also yielding a green dividend. The need for increasingly complicated risk analysis, such as these CVA calculations with a large number of scenarios and steps, drives investment in new hardware, as well as the additional electric power to drive the hardware and to cool the data centers that contain it. Using the Xcelerit SDK with appropriate GPU hardware executes these calculations much more efficiently with a performance-per-watt that is far superior to conventional computing approaches. This is a bonus for companies whose data centers may be space – and power – constrained as well as those who have strong environmental policies in place.

White paper: Efficient XVA Calculations

In the aftermath of the 2007/2008 global financial crisis, financial institutions have shifted their focus to more actively manage the risks associated with over-the-counter (OTC) contracts. It is now standard practice to adjust derivative prices for the risk of the counterparty’s or one’s own default, by means of credit or debit valuation adjustments (CVA/DVA). Further, the cost of funding a trade has increased significantly after the crisis, as banks can no longer borrow money at the risk-free rate. This cost is accommodated for by the funding valuation adjustment (FVA). More such adjustments are in use in practice, for example for the cost of regulatory capital (KVA) or for initial margin funding costs (MVA). All these adjustments are commonly referred to as XVA.

This white paper gives an overview of the different XVA adjustments, shows how they are computed, and outlines where the computational challenges lie. It then details specific software optimisations and gives practical hints on how to cope with the computational complexities.

  • Credit Value Adjustment (CVA)
  • Debit Value Adjustment (DVA)
  • Bilateral CVA
  • Funding Value Adjustment (FVA)
  • Initial Margin Valuation Adjustment (MVA)
  • Capital Valuation Adjustment (KVA)
  • XVA implementations and optimisations