voly 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
voly-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 manudc22
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
voly-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.2
2
+ Name: voly
3
+ Version: 0.0.1
4
+ Summary: Options & volatility research package
5
+ Author-email: Manu de Cara <manu.de.cara@gmail.com>
6
+ License: MIT
7
+ Classifier: Development Status :: 3 - Alpha
8
+ Classifier: Intended Audience :: Financial and Insurance Industry
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.9
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Topic :: Office/Business :: Financial
16
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: pandas>=1.3.0
22
+ Requires-Dist: numpy>=1.20.0
23
+ Requires-Dist: scipy>=1.7.0
24
+ Requires-Dist: plotly>=5.3.0
25
+ Requires-Dist: scikit-learn>=1.0.0
26
+ Requires-Dist: websockets>=10.0
27
+ Requires-Dist: requests>=2.26.0
28
+ Requires-Dist: loguru>=0.5.3
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
31
+ Requires-Dist: black>=22.1.0; extra == "dev"
32
+ Requires-Dist: isort>=5.10.1; extra == "dev"
33
+ Requires-Dist: mypy>=0.931; extra == "dev"
34
+ Requires-Dist: flake8>=4.0.1; extra == "dev"
35
+ Requires-Dist: twine>=4.0.0; extra == "dev"
36
+ Requires-Dist: build>=0.8.0; extra == "dev"
37
+
38
+ # Voly - Options & Volatility Research Package
39
+
40
+ Voly is a Python package for options data analysis, volatility surface modeling, and risk-neutral density estimation. It provides a simple interface for handling common options research tasks, including data collection, model fitting, and visualization.
41
+
42
+ ## Features
43
+
44
+ - **Data Collection**: Fetch options data from exchanges (currently supports Deribit)
45
+ - **Volatility Surface Modeling**: Fit SVI (Stochastic Volatility Inspired) model to market data
46
+ - **Risk-Neutral Density**: Calculate and analyze risk-neutral density distributions
47
+ - **Surface Interpolation**: Interpolate volatility surfaces across different expiries
48
+ - **Options Pricing & Greeks**: Calculate Black-Scholes prices and all major Greeks
49
+ - **Visualizations**: Generate interactive plots using Plotly
50
+
51
+ ## Installation
52
+
53
+ You can install Voly using pip:
54
+
55
+ ```bash
56
+ pip install voly
57
+ ```
58
+
59
+ ## Quick Start
60
+
61
+ ```python
62
+ import pandas as pd
63
+ from voly import VolyClient
64
+
65
+ # Initialize the client
66
+ voly = VolyClient()
67
+
68
+ # Fetch options data (or load your own data)
69
+ option_chain = voly.get_option_chain(exchange='deribit', currency='BTC')
70
+
71
+ # Fit an SVI model to the data with visualization
72
+ fit_results = voly.fit_model(option_chain, plot=True)
73
+
74
+ # Calculate risk-neutral density
75
+ rnd_results = voly.rnd(fit_results, spot_price=option_chain['underlying_price'].iloc[0], plot=True)
76
+
77
+ # Calculate probability of price above a target
78
+ probability = voly.probability(rnd_results, target_price=32000, direction='above')
79
+ print(f"Probability of price above 32000: {probability:.2%}")
80
+
81
+ # Calculate option Greeks
82
+ greeks = voly.greeks(s=30000, k=32000, r=0.05, vol=0.6, t=0.25, option_type='call')
83
+ print(f"Option Greeks: {greeks}")
84
+ ```
85
+
86
+ ## Example: Visualizing the Volatility Surface
87
+
88
+ ```python
89
+ import pandas as pd
90
+ from voly import VolyClient
91
+
92
+ # Initialize the client
93
+ voly = VolyClient()
94
+
95
+ # Load your own data or fetch from exchange
96
+ # The DataFrame should have columns for:
97
+ # - log_moneyness
98
+ # - strike
99
+ # - mark_iv (implied volatility)
100
+ # - yte (years to expiry)
101
+ # - dte (days to expiry)
102
+ # - maturity_name (identifier for the expiry)
103
+ data = pd.read_csv('your_options_data.csv')
104
+
105
+ # Fit the SVI model
106
+ fit_results = voly.fit_model(data, plot=True)
107
+
108
+ # Display the 3D volatility surface
109
+ surface_fig = fit_results['plots']['surface_3d']
110
+ surface_fig.show()
111
+ ```
112
+
113
+ ## Documentation
114
+
115
+ For full documentation, visit [https://docs.voly.io](https://docs.voly.io)
116
+
117
+ ## Development
118
+
119
+ ### Setting up the development environment
120
+
121
+ ```bash
122
+ # Clone the repository
123
+ git clone https://github.com/manudc22/voly.git
124
+ cd voly
125
+
126
+ # Install development dependencies & activate venv
127
+ ./env_setup.sh --all
128
+ ```
129
+
130
+ ## License
131
+
132
+ This project is licensed under the MIT License - see the LICENSE file for details.
voly-0.0.1/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # Voly - Options & Volatility Research Package
2
+
3
+ Voly is a Python package for options data analysis, volatility surface modeling, and risk-neutral density estimation. It provides a simple interface for handling common options research tasks, including data collection, model fitting, and visualization.
4
+
5
+ ## Features
6
+
7
+ - **Data Collection**: Fetch options data from exchanges (currently supports Deribit)
8
+ - **Volatility Surface Modeling**: Fit SVI (Stochastic Volatility Inspired) model to market data
9
+ - **Risk-Neutral Density**: Calculate and analyze risk-neutral density distributions
10
+ - **Surface Interpolation**: Interpolate volatility surfaces across different expiries
11
+ - **Options Pricing & Greeks**: Calculate Black-Scholes prices and all major Greeks
12
+ - **Visualizations**: Generate interactive plots using Plotly
13
+
14
+ ## Installation
15
+
16
+ You can install Voly using pip:
17
+
18
+ ```bash
19
+ pip install voly
20
+ ```
21
+
22
+ ## Quick Start
23
+
24
+ ```python
25
+ import pandas as pd
26
+ from voly import VolyClient
27
+
28
+ # Initialize the client
29
+ voly = VolyClient()
30
+
31
+ # Fetch options data (or load your own data)
32
+ option_chain = voly.get_option_chain(exchange='deribit', currency='BTC')
33
+
34
+ # Fit an SVI model to the data with visualization
35
+ fit_results = voly.fit_model(option_chain, plot=True)
36
+
37
+ # Calculate risk-neutral density
38
+ rnd_results = voly.rnd(fit_results, spot_price=option_chain['underlying_price'].iloc[0], plot=True)
39
+
40
+ # Calculate probability of price above a target
41
+ probability = voly.probability(rnd_results, target_price=32000, direction='above')
42
+ print(f"Probability of price above 32000: {probability:.2%}")
43
+
44
+ # Calculate option Greeks
45
+ greeks = voly.greeks(s=30000, k=32000, r=0.05, vol=0.6, t=0.25, option_type='call')
46
+ print(f"Option Greeks: {greeks}")
47
+ ```
48
+
49
+ ## Example: Visualizing the Volatility Surface
50
+
51
+ ```python
52
+ import pandas as pd
53
+ from voly import VolyClient
54
+
55
+ # Initialize the client
56
+ voly = VolyClient()
57
+
58
+ # Load your own data or fetch from exchange
59
+ # The DataFrame should have columns for:
60
+ # - log_moneyness
61
+ # - strike
62
+ # - mark_iv (implied volatility)
63
+ # - yte (years to expiry)
64
+ # - dte (days to expiry)
65
+ # - maturity_name (identifier for the expiry)
66
+ data = pd.read_csv('your_options_data.csv')
67
+
68
+ # Fit the SVI model
69
+ fit_results = voly.fit_model(data, plot=True)
70
+
71
+ # Display the 3D volatility surface
72
+ surface_fig = fit_results['plots']['surface_3d']
73
+ surface_fig.show()
74
+ ```
75
+
76
+ ## Documentation
77
+
78
+ For full documentation, visit [https://docs.voly.io](https://docs.voly.io)
79
+
80
+ ## Development
81
+
82
+ ### Setting up the development environment
83
+
84
+ ```bash
85
+ # Clone the repository
86
+ git clone https://github.com/manudc22/voly.git
87
+ cd voly
88
+
89
+ # Install development dependencies & activate venv
90
+ ./env_setup.sh --all
91
+ ```
92
+
93
+ ## License
94
+
95
+ This project is licensed under the MIT License - see the LICENSE file for details.
@@ -0,0 +1,72 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "voly"
7
+ version = "0.0.1"
8
+ description = "Options & volatility research package"
9
+ readme = "README.md"
10
+ authors = [
11
+ {name = "Manu de Cara", email = "manu.de.cara@gmail.com"}
12
+ ]
13
+ license = {text = "MIT"}
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Financial and Insurance Industry",
17
+ "Intended Audience :: Science/Research",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Topic :: Office/Business :: Financial",
24
+ "Topic :: Scientific/Engineering :: Mathematics",
25
+ "Operating System :: OS Independent",
26
+ ]
27
+ requires-python = ">=3.9"
28
+ dependencies = [
29
+ "pandas>=1.3.0",
30
+ "numpy>=1.20.0",
31
+ "scipy>=1.7.0",
32
+ "plotly>=5.3.0",
33
+ "scikit-learn>=1.0.0",
34
+ "websockets>=10.0",
35
+ "requests>=2.26.0",
36
+ "loguru>=0.5.3",
37
+ ]
38
+
39
+ [project.optional-dependencies]
40
+ dev = [
41
+ "pytest>=7.0.0",
42
+ "black>=22.1.0",
43
+ "isort>=5.10.1",
44
+ "mypy>=0.931",
45
+ "flake8>=4.0.1",
46
+ "twine>=4.0.0",
47
+ "build>=0.8.0",
48
+ ]
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["src"]
52
+ include = ["voly*"]
53
+
54
+ [tool.black]
55
+ line-length = 100
56
+ target-version = ['py39']
57
+
58
+ [tool.isort]
59
+ profile = "black"
60
+ line_length = 100
61
+ multi_line_output = 3
62
+
63
+ [tool.mypy]
64
+ python_version = "3.9"
65
+ warn_return_any = true
66
+ warn_unused_configs = true
67
+ disallow_untyped_defs = true
68
+ disallow_incomplete_defs = true
69
+
70
+ [tool.pytest.ini_options]
71
+ testpaths = ["tests"]
72
+ python_files = "test_*.py"
voly-0.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
voly-0.0.1/setup.py ADDED
@@ -0,0 +1,29 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ if __name__ == "__main__":
4
+ setup(
5
+ name="voly",
6
+ package_dir={"": "src"},
7
+ packages=find_packages(where="src"),
8
+ install_requires=[
9
+ "pandas>=1.3.0",
10
+ "numpy>=1.20.0",
11
+ "scipy>=1.7.0",
12
+ "plotly>=5.3.0",
13
+ "scikit-learn>=1.0.0",
14
+ "websockets>=10.0",
15
+ "requests>=2.26.0",
16
+ "loguru>=0.5.3",
17
+ ],
18
+ extras_require={
19
+ 'dev': [
20
+ "pytest>=7.0.0",
21
+ "black>=22.1.0",
22
+ "isort>=5.10.1",
23
+ "mypy>=0.931",
24
+ "flake8>=4.0.1",
25
+ "twine>=4.0.0",
26
+ "build>=0.8.0",
27
+ ]
28
+ }
29
+ )
@@ -0,0 +1,10 @@
1
+ """
2
+ Voly - Options & volatility research package
3
+
4
+ A package for options data analysis, volatility modeling,
5
+ and risk-neutral density estimation.
6
+ """
7
+
8
+ from voly.client import VolyClient
9
+
10
+ __all__ = ["VolyClient"]