- Purpose: The demo is inspired by two blogs that discuss the construction of volatility surfaces for Bitcoin, and it aims to implement these concepts in a minimalist Pythonic way.
- I created this while preparing for a web3 interview.
- Clone this git to a local folder and CD into it
- Create a virtual environment for all dependencies
python -m venv "venv"
- Activate the virtual environment
source venv/bin/activate
(linux/mac)./venv/scripts/activate
(Windows) - Install the dependencies
python -m pip install -r requirements.txt
- Run the application
- To generate the volatility surface directly using the latest downloaded file, run
- python app.py
- To download data and generate the volatility surface, use the following command:
- python app.py --download
- To generate the volatility surface directly using the latest downloaded file, run
- CD into the project folder
- Activate the venv
source venv/bin/activate
(linux/mac)./venv/scripts/activate
(Windows) - Run the application
- streamlit run app_streamlit.py
- If there is a space in the path of the Python program folder, plotly will have issues saving static image to output folder. A workaround is to set an environment variable. More details can be found here.