New challenges in the financial markets are being driven by changes in market structure, regulations and accounting rules like Basel III, EMIR, Dodd Frank, MiFID II, Solvency II, IFRS 13, IRFS 9, and FRTB. There is a rise in demand for vendors to deliver high performance solutions in order to satisfy the computational requirements of problems like XVA. This demand has pushed software providers to put technology at the forefront of the strategic roadmap and make significant optimisations.
Vectorisation is a key tool for dramatically improving the performance of code running on modern CPUs. Vectorisation is the process of converting an algorithm from operating on a single value at a time to operating on a set of values at one time. Modern CPUs provide direct support for vector operations where a single instruction is applied to multiple data (SIMD).
As noted, the Finance domain provides many good candidates for vectorisation. A particularly good example is the aggregation of Credit Value Adjustment (CVA) and other measures of counterparty risk. The most common general purpose approach to calculation of CVA is based on a Monte-Carlo simulation of the distribution of forward values for all derivative trades with a counterparty. The evolution of market prices over a series of forward dates is simulated, then the value of each derivative trade is calculated at that forward date using the simulated market prices. This gives us a ‘path’ of projected values over the lifetime of each trade. By running a large number of these randomised simulated ‘paths’, we can estimate the distribution of forward values, giving both the expected and extreme ‘exposures’. The simulation step results in a 3-dimensional array of exposures, the dimensions are [trades][paths][dates]. The task of calculating CVA from these exposures occurs in several steps: Netting, Collateralisation, Integration over paths, Integration over dates.