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.1.1.tar.gz (17.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.1.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ssvi_surface-1.1.1.tar.gz
  • Upload date:
  • Size: 17.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.1.1.tar.gz
Algorithm Hash digest
SHA256 e5665972acf267865f98e1259918c624d09abcf354fa41dbb4103ab7c20e72ce
MD5 8e2d66fb3492179fcbc1e25fea77690e
BLAKE2b-256 bd4f221f7e3d94586ea957a354d2f9ad03286276ed8430402b94cd1a986c8cc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssvi_surface-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b8acbce6632ab9b7424eb1e8924a0c4bcffd945f76268b743ca53192a62dace
MD5 9d1fcf5110cc4974826e410e81ba284c
BLAKE2b-256 f8526e0b1f76892b45acb7c837d8f334d5a46fe7d02da537effd0dbe50441bb2

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