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.0.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.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ssvi_surface-1.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 90dea63c1067e2ee75f0d893eb8076184104ebaac9aaa79c667a9811b00239d3
MD5 cfc8a7b315fc224a77b67ecb0b8da91a
BLAKE2b-256 d2a59ff551a0c21fafe5fe65b7a406a8e415591b4895cf35671cea6163f701ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ssvi_surface-1.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6b49a296080da82000aeafc91e200b0483d45941dcc9dd474f812a6e2ea25694
MD5 509b28acd41c2964c7d95c7717c5fe73
BLAKE2b-256 dbdff4888a63054e2fdc2e96ffc3e58ef544c5ede7d0113bcaa27285fecde35a

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