Skip to content

Docs and ssvi - #88

Merged
lsbardel merged 1 commit into
mainfrom
ls-rho
Jul 30, 2026
Merged

Docs and ssvi#88
lsbardel merged 1 commit into
mainfrom
ls-rho

Conversation

@lsbardel

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings July 30, 2026 22:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Quantflow’s volatility-surface stack by migrating the SSVI implementation to an eSSVI (per-maturity $\theta,\psi,\rho$) calibration that enforces static-arbitrage constraints by construction, and aligns the documentation, frontend example, and dev tooling with the new model and improved math notation.

Changes:

  • Reworked quantflow.options.ssvi.SSVI into an eSSVI node-based model with slice-by-slice “star” calibration and explicit calendar + butterfly arbitrage checks.
  • Refreshed docs and examples (mkdocs API pages, glossary/bibliography entries, Observable “volatility surface” page) to match eSSVI and updated notation.
  • Refactored local serve scripts and frontend configuration to support configurable API and docs origins.

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
quantflow/utils/numbers.py Adds documentation around DecimalNumber JSON schema typing (needs adjustment, see comments).
quantflow/options/surface.py Tweaks VolSurface docstring formatting (introduces a Markdown heading in a docstring).
quantflow/options/ssvi.py Major rewrite to eSSVI with per-node parameters, interpolation, and new calibration routine.
quantflow/options/divfm/weights.py Improves math notation and adds Annotated[..., Doc(...)] parameter docs.
quantflow/options/divfm/trainer.py Updates docstrings and bibliography link formatting for DIVFM trainer docs.
quantflow/options/divfm/pricer.py Improves math/docs and adds Annotated[..., Doc(...)] parameter docs for calibrate.
quantflow/options/divfm/network.py Updates math block formatting and clarifies factor-function documentation.
quantflow/options/bs.py Corrects/clarifies Greek formulas in docs and fixes volga/vanna scaling to divide by iv.
quantflow_tests/test_ssvi.py Updates tests to the new eSSVI node model and calibration behavior.
quantflow_tests/test_options.py Adds finite-difference regression test for Black sensitivities.
mkdocs.yml Makes “Live Examples” URL configurable via environment, and updates nav accordingly.
Makefile Updates serve targets to use the new dev/serve/* scripts.
frontend/src/volatility-surface.md Updates the Observable example to consume and visualize eSSVI node parameters.
frontend/src/lib/api.ts Adds mkdocsOrigin() for configurable docs links in the frontend.
frontend/src/index.md Adds a link from examples to the main mkdocs documentation origin.
frontend/package.json Simplifies dev script (host/port now passed by wrapper scripts).
frontend/observablehq.config.js Injects mkdocs origin meta tag and uses it for header assets/links.
docs/references.bib Adds bibliography entries for DIVFM and eSSVI calibration references.
docs/glossary.md Adds “Moneyness Convexity Adjusted” and “Standard Normal Distribution” glossary entries.
docs/bibliography.md Adds rendered bibliography entries matching the new references.
docs/api/utils/index.md Adds missing “Price” page entry to the utils API index.
docs/api/ta/index.md Expands TA index with additional pages (EWMA, OHLC, Paths, Supersmoother).
docs/api/sp/index.md Adds PoissonBase to the stochastic processes index table.
docs/api/rates/index.md Adds clarifications and references to rate curve implementations/calibrations.
docs/api/options/ssvi.md Removes VarianceCurve from API page and documents SSVI only.
docs/api/options/index.md Adds a “Pricing” section and updates Price crossref target.
docs/api/options/divfm.md Updates formula formatting and links to bibliography/glossary.
docs/api/options/black.md Clarifies forward-price glossary link.
docs/api/dists/index.md Expands distribution index overview and links to related pages/types.
dev/serve/observable New wrapper script to run Observable examples on a fixed host/port.
dev/serve/mkdocs New wrapper script to serve mkdocs on a configurable port.
dev/serve/api Updates API serve script to use QUANTFLOW_API_PORT naming.
dev/serve/all New “serve everything” script using concurrently and consistent env var wiring.
dev/serve-info Removed in favor of the new dev/serve/* scripts.
dev/mkdocs-serve Removed in favor of dev/serve/mkdocs.
dev/frontend-serve Removed in favor of dev/serve/observable.
dev/docs-serve Removed in favor of dev/serve/all.
app/api/volatility.py Updates API response description to “eSSVI model”.
.claude/skills/update-doc-indexes/SKILL.md Adds a documented internal skill for keeping API index pages complete.

Comment on lines +805 to +811
"""Represents a volatility surface, which captures the implied volatility of
options for different strikes and maturities.

Key Concepts:
## Key Concepts

* **Implied Volatility:** The market's expectation of future volatility, derived
from the price of an option using a pricing model (e.g., Black-Scholes).
from the price of an option using Black-Scholes.
Comment on lines 12 to +13
DecimalNumber = Annotated[Decimal, WithJsonSchema({"type": "number"})]
"""Add typing number to Pydantic serialization"""
Comment thread quantflow/options/ssvi.py
Comment on lines 354 to 356
if not slices:
raise ValueError("at least one maturity slice is required")
data = []
Comment thread quantflow/options/ssvi.py
Comment on lines 357 to 361
for k, iv, ttm in slices:
k_arr = np.asarray(k, dtype=float)
iv_arr = np.asarray(iv, dtype=float)
if k_arr.size == 0 or iv_arr.size == 0:
raise ValueError("k and iv must contain at least one quote")
Comment thread quantflow/options/ssvi.py
"larger values concentrate the fit at the money. "
"Must be non negative"
),
] = 0.5,
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.03106% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.93%. Comparing base (5e16f37) to head (5e4b60b).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
quantflow/options/ssvi.py 94.80% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #88      +/-   ##
==========================================
+ Coverage   88.75%   88.93%   +0.17%     
==========================================
  Files          84       85       +1     
  Lines        5142     5379     +237     
==========================================
+ Hits         4564     4784     +220     
- Misses        578      595      +17     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lsbardel
lsbardel merged commit dda32ba into main Jul 30, 2026
9 of 13 checks passed
@lsbardel
lsbardel deleted the ls-rho branch July 30, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants