Skip to main content

SSVI (Stochastic Volatility Inspired) model for implied volatility surface modeling

Project description

SSVI Surface

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

Installation

pip install -e .

Usage

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:

# 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:

@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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ssvi_surface-1.0.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ssvi_surface-1.0.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file ssvi_surface-1.0.0.tar.gz.

File metadata

  • Download URL: ssvi_surface-1.0.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ssvi_surface-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fe9093d8028aa1a177579945cef542ae1c28097027b6313eeebafeb419b32ee1
MD5 4b177beebcdb1a5f15860bb4da157705
BLAKE2b-256 54440947092ec94ae061b1d0f28fef6fd6c52c829bab1ad4161450db8426651d

See more details on using hashes here.

File details

Details for the file ssvi_surface-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ssvi_surface-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for ssvi_surface-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9a3bd25fb3d579de709e1ee3d7a08e77e2581b53ce10ece43dfa5d0b36ee336
MD5 ad3b9d122d170453d127c36316e9c0de
BLAKE2b-256 02f0e06a1cfb522e288a509cd5ce770b64d8a1df4c7037622a34770b864552ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page