Visualising position build-up in FOMC forward IRS
Last week the FED announced its most aggressive interest rate hike since 1994 alongside the BOE going ahead with its fifth consecutive hike as inflation soars globally. Expectedly, the repercussions in global markets have been significant with Treasury yields spiking to levels not seen since the financial crisis and global stocks seeing their worst slide since 2020.
Central bank dated OIS swaps whose intrinsic value is attached to the outcome of central bank meetings are a popular way for market participants to express their view on monetary policy changes. Such instruments are traded over the counter (OTC) and with the disappearance of FRAs (and IBOR) are becoming an increasingly more popular tool for market participants to implement their views on short term rates. Historically, there has been little to no hard data on how much forward IRS is traded in terms of number of transactions or DV01 and at what price.
In this notebook we demonstrate how data available through Enterprai's API can be used to simulate how risk in the IRS market has been accumulating for each central bank meeting over time. The results quickly uncover that last week's FOMC has been the 3rd most heavily traded central bank outcome since 2013. See the full animation of how positions are built up and unwound below.
In today's instalment of Enterprai Data Series we will be joining two unique time series related to FOMC dated OIS swaps to animate the build up and unwinding of positions for each FOMC meeting in the period from 2014 to 2023.
Our objective is to paint the big picture in this market and enable users to explore the development of longer term patterns. For this purpose we use daily data, however hourly and minutely is also available through the API and can be used to observe the same phenomena intraday.
If you're interested to explore the full menu of data sets we have made available via our groundbreaking work in the OTC space please request access to our data catalogue by emailing firstname.lastname@example.org.
Let's get started.
Defining some constants and utilities
First, we define our imports as well as a few constants that would be useful throughout the rest of this notebook.
The API by default imposes some restrictions on the number of requests per minute that can come from a single API key. In order to respect those limits we create a wrapper utility that will be used in subsequent sections to make requests to the API.
Having our constants and utilities defined we're ready to pull some data.
As we will find out in a moment all endpoints that will be queried throughout this notebook expect a cb_meeting_date query parameter. To spare the hassle of typing out such dates manually we have exposed a utility endpoint in the API that returns a list of central bank meeting dates over a given period, which in this experiment is set to 2014-2023.
Open interest is a statistic that has historically been associated with the futures market as before Enterprai it was unthinkable to obtain such information for OTC instruments for two main reasons:
- no transactional data has been available prior to the implementation of the reporting rules mandated by Dodd-Frank Title VII;
- the transactional data that was made available had been stripped off valuable information such as whether a given transaction represents a position opening or closing.
Enterprai is the first to have found a way to identify unwind transactions which puts us in a unique position to provide the most accurate estimation for open interest by adjusting for the volume that has been unwound.
Now that we have a list of FOMC dates we are ready to query the open interest time series for each meeting. We'll make those queries in a tight loop - one API call for each meeting.
As mentioned earlier open interest is calculated by subtracting the unwound volume from the total. So in order to get a more complete picture of the swap activity around a given central bank meeting we would need to make an additional query for the time series of volume unwound.
Luckily, this is very easy to do using the API. The code is almost identical to the open interest snippet - only changes we have to make are to the url and params variables.
Data Post-Processing & Visualisation
In this experiment we use the Plotly library due to its ease of use for creating animations.
The library expects inputs in a particular format which is different to how our open interest and unwind data frames are currently laid out. So in the next couple segments of code we massage the data into the desired format.
At the moment our data contains NaNs for days with no transactions. We populate the missing values by forward filling in the case of open interest and filling with zeroes in the case of volume unwound. Additionally, our data is on daily frequency which a bit too granular for the purposes of this experiment so we resample both data frames to weekly or monthly frequency to speed up the animation.
Next, we reshape the data frames through the stack operation and merge them into one using concat. After we set meaningful names to each column so the data is clearly labelled.
Finally, we pass the data to Plotly for visualisation and adjust the styling of the plot.
In just a few lines of code we were able to leverage Enterprai's API to showcase previously opaque market dynamics in one of the most interesting OTC instruments within the current market environment of big monetary policy changes and rising inflation - FOMC forward OIS swaps.
If you have any comments about this work or other questions you would like us to answer using our proprietary data - please leave a comment below or email me directly at email@example.com.