Metadata-Version: 2.4
Name: ssvi-surface
Version: 1.1.1
Summary: SSVI (Stochastic Volatility Inspired) model for implied volatility surface modeling
Author: Jeremy Cochoy
License-Expression: MIT
Project-URL: Homepage, https://github.com/jeremycochoy/ssvi_surface
Keywords: options,volatility,ssvi,implied-volatility,finance
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: scipy>=1.7.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Dynamic: license-file

# SSVI Surface

A Python package for modeling implied volatility surfaces using the Stochastic Volatility Inspired (SSVI) model.

## Installation

```bash
pip install -e .
```

## Usage

```python
from ssvi_surface import SSVIModel, forward_bs_price

# Create and fit the model
model = SSVIModel(outside_spread_penalty=2.0, lr=1e-3)
result = model.fit(T_array, strikes_list, bids_list, asks_list, option_types_list, S0, r, q)

# Predict implied volatility
iv = model.predict(k, t)

# Use forward Black-Scholes pricing
price = forward_bs_price(S, K, T, iv, r, q, is_call)
```

## Running Tests

To run the test suite:

```bash
# Run all tests
python -m unittest discover -s tests -p "test_*.py" -v

# Or run a specific test file
python -m unittest tests.test_ssvi_formula -v
```

The test suite includes property-based tests that verify:
- Mathematical properties of the SSVI formula (positivity, continuity, scaling)
- Theta interpolation accuracy and monotonicity preservation
- Prediction consistency and correctness
- Fitting constraints (arbitrage-free, parameter bounds)
- Integration tests for the full workflow

## Citation

**If you use this software in published research, please cite this repository:**

```bibtex
@software{ssvi_surface,
  title = {SSVI Surface},
  author = {COCHOY, Jeremy},
  year = {2025},
  url = {https://github.com/jeremycochoy/ssvi_surface}
}
```

## References

This implementation is based on the SSVI methodology described in:

```
Gatheral, J., & Jacquier, A. (2014). Arbitrage-free SVI volatility surfaces.
Quantitative Finance, 14(1), 59-71.
```

## License

MIT License (see LICENSE file)
