[PLUS] 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.
This is a premium post. Create Plus+ Account to view the live, working codebase for this article.
Notice: Information contained herein is not and should not be construed as an offer, solicitation, or recommendation to buy or sell securities. The information has been obtained from sources we
believe to be reliable; however no guarantee is made or implied with respect to its accuracy, timeliness, or completeness. Author does not own the any crypto currency discussed. The information
and content are subject to change without notice. CryptoDataDownload and its affiliates do not provide investment, tax, legal or accounting advice.
This material has been prepared for informational purposes only and is the opinion of the author, and is not intended to provide, and should not be relied on for, investment, tax, legal,
accounting advice. You should consult your own investment, tax, legal and accounting advisors before engaging in any transaction. All content published by CryptoDataDownload is not an