EU market liquidity risk and kdb+

Analysis of EU market liquidity & collateral haircuts using kdb+

9 Nov 2017 | , , ,
Share on:

by Florian Glaser and Sven Panz

This blog is excerpted from a longer paper written by Florian Glaser and Sven Panz for the European Systemic Risk Board called (Pro?)-cyclicality of collateral haircuts and systemic illiquidity. Florian is a Research Group Lead at the Karlsruhe Institute of Technology (KIT) and Sven is a PhD candidate in Finance at Goethe University Frankfurt/ Main. Kx provided a free kdb+ academic license for this research project.

The research challenge

In this paper, we aim to fill the gap of empirical insights regarding systemic risk and the relationship between market wide illiquidity and collateral haircuts. These haircuts can be understood as the percentage by which a security is devalued relative to its market value when it is used as collateral. Haircuts are designed to comprise a counterparty risk component reflecting the issuer’s creditworthiness as well as a liquidity component, taking the ease of liquidation into account. Hence, haircuts are supposed to increase in periods of raising volatility and decrease in periods of declining volatility on a micro-prudential level. These pro-cyclical tendencies of haircuts and their significant consequences to market-wide liquidity are subject to an ongoing discussion among academics and regulatory authorities in the context of macro-prudential regulation since the aftermath of the financial crisis in 2008.

To investigate possible pro-cyclical patterns, we propose a methodology that can also serve as a quantitative trigger to stop deteriorating liquidity spirals. Our empirical approach consists of two steps: First, we measure systemic illiquidity as the price deviation from actual and theoretical bond yields by aggregating cross-sectional pricing errors between theoretical bond yields, which are computed as the present value of discounted coupons, neglecting any risk, and actual market yields. Second, using a bubble detection methodology, we identify periods of irrational tendencies. Based on this setup we compare the overall market illiquidity with identified periods of exuberance and a synthetic illiquidity under the application of haircuts within the collateral portfolio.

The kdb+ advantage

The data underlying our analysis represents a full view of all collateral positions posted within the last 15 years on a daily basis by every clearing member of a large European CCP. Preliminary analyses to get an idea of different dimensions and characteristics of the dataset required us to frequently filter, aggregate and transform billions of collateral portfolio positions.

The superior performance of kdb+ reduced our “time to data” and significantly improved the time gap between coming up with a new idea or research question and the corresponding data sample. The neat integration with R and other statistical software enabled us to easily feed the sampled data as input to our QuantLib pricing engine, analytical scripts or visualization tools.

Kdb+’s very expressive and impressive inherent language – q – made writing and executing new functions for processing data blazingly fast and reduced the amount of lines of code to an easily maintainable minimum. Once we were familiar with q, using domain specific built-in functionality in q-sql queries often reduced common and peculiar data transformation to a single line of code.


Our results confirm that bond collateral markets face irrational, i.e. bubble-like illiquidity during periods of systemic distress. Against theoretical rationale, we observe neither a foreshadowing nor an amplifying behavior of the current haircut implementation and conclude that the design of past and present haircuts does not exacerbate market-wide illiquidity.

© 2018 Kx Systems
Kx® and kdb+ are registered trademarks of Kx Systems, Inc., a subsidiary of First Derivatives plc.


Head of Products, Solutions and Innovation at Kx on Product Design and the Vision for the Future

16 Mar 2018 | , , ,

As the SVP of Products, Solutions and Innovation at Kx Systems, James Corcoran is part of a new chapter in software development at Kx. Since joining Kx parent First Derivatives as a financial engineer in 2009, James has worked around the world building enterprise systems at top global investment banks before moving to the Kx product team in London. James sat down with us recently to discuss his perspective on product design and our technology strategy for the future.

Kdb+ Utilities: Essential utility for identifying performance problems

28 Feb 2018 | ,

If you are a kdb+/q developer, you will find the utilities created by Kx Managing Director and Senior Solution Architect Leslie Goldsmith to be a valuable resource. The “Kdb+ Utilities” series of blog posts gives a quick introduction to the utilities, available at Leslie Goldsmith’s GitHub. In this third part of the series we look at Leslie’s qprof, which allows a programmer to drill down into q functions or applications to inspect performance and CPU usage in a fine-grained fashion.

kdb+ utility to search codebase

Kdb+ Utilities: Q code Workspace Utilities

6 Feb 2018 | , ,

If you are a kdb+/q developer, you will find the workspace utilities created by Kx Managing Director and Senior Solution Architect Leslie Goldsmith to be a valuable resource. This is the first in a series of blog posts that give a quick introduction to several utilities available at Leslie Goldsmith’s GitHub. In this part of the series we look at an essential tool which contains routines for summarizing and searching the contents of a workspace, ws.