This is a case study about challenges of testing Risk Management systems and our test automation and testing approach developed and implemented for our client, a Central Counterparty responsible for clearing and risk management of CCP-eligible transactions on a leading European exchange.
the underlying mathematical concepts are quite complex, and large volumes of data are used;
Calculation of Margins:
Margins are calculated using:
- the MVP (Method for Portfolio Valuation) methodology for Governments Bonds;
- the MARS (Margining System) methodology for Equity Derivatives and Equity Cash products;
The Aim of Initial Margin (IM):
Initial Margin is called on a daily basis to cover theoretical costs of liquidation in order to close the open positions in the worst possible market scenario, within a maximum price variation range called “Margin Interval”. The “Margin interval” is specific for each financial instrument;
intraday margins are called by the margining system if sudden sharp price variations occur or in the case of a Member’s excessive overall risk exposure;
a Default Fund is managed by the system as additional protection aimed at covering risks associated with sharp price/interest rate movements. The Default Fund amounts are calculated as a result of periodic stress tests.
Test Automation Approach
Our Solution is to test by using a model based on simplified assumptions, but replicating the algorithms and calculations done by the system under test, and compare the actual results taken from the system under test with expected test results computed by our model.
A Risk Simulator was developed and integrated with our test harness created to replicate Margin Run activities, including message flows and margin values.
Smart Actions were developed to calculate margin values and perform default fund verification and reporting.
Risk Engine Log Parser and Risk Parameters Analyzer were created to analyze and verify margin and risk parameters based on input data from both Margining and Clearing systems. It provides the user with a possibility to check the actual margin values received in the systems against the calculated expected values.
Case Study: An End-to-End Scenario to Verify the Process and Parameters of Margin Calculation for All Cleared Instruments by Using a ‘Risk-Based Margining’ Algorithm