Loading...

Plus+ Python

Visualizing Bitcoin Implied Volatility Smile Using Live Data Feed

Visualizing Bitcoin Implied Volatility Smile Using Live Data Feed

BTC Option Volatility Smile
Implied volatility in options will vary as market conditions and risk sentiment change through time. Wehave previously discussed the volatility smile vs volatility skew, and understanding the basic differences between the terminology and implications. Our objective for this article is to use the DeriBit API to fetch implied volatility information from BTC options transactions and then graph the volatility smile that results. Because the Python script will use the implied volatility data from whatever is the most recent transaction for both puts and calls, it is in effect "live" as you rerun it through time. As a note, there are other ways that you could calculate the implied volatility that would be an equally valid way of determining the implied vol. For example, you could create a websocket connection to API and subscribe to option chain's bid/ask values, and using those inputs, calculate the mid price and use that input into Black Scholes to determine the implied vol necessary for the option to price that way (we do not do this here). Additionally, there could be pitfalls in using volatility data based on transactions if the transactions are quite old. This is really a problem about volume - if transactions happened almost continuously, the IV paid by market participants is arguably a more pure form of realized "implied volatility" that using a model based calculation.

BTC Implied Option Volatility Smile Using Transactional Data 5/3/23


What the Python Script Does
The first thing we need to do in the script is get a list of active option chains from the DeriBit API. There are tons of available options (0-day, 1-day, weekly and monthly expiry choices), and so we will use the option chain for monthly expiries. We want to take the BTC option chain that expires in 3 months for both puts and calls. (see graphic above). After filtering down our instrument list to only 3M options, we fetch data for each one of them looking for the most recent transaction. This information is what is graphed and displayed to finish. Every line of code is commented for your benefit and ability to modify as you see fit... it is highly configurable, and if you are having any issues whatsoever, our team is on standby to respond.

Plus+ membership required

Create a Plus+ account to view the live codebase.

This article has a fully working, notebook-ready code block. Sign up for Plus+ to access it and the rest of the 20+ premium articles.

Subscribe to Plus+ Browse Plus+ articles