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.