Skip to content

Fix analytic bs_vanna: spurious sqrt(t) factor and sign error#245

Open
gaoflow wants to merge 1 commit into
domokane:masterfrom
gaoflow:fix-bs-vanna-sqrt-t-sign
Open

Fix analytic bs_vanna: spurious sqrt(t) factor and sign error#245
gaoflow wants to merge 1 commit into
domokane:masterfrom
gaoflow:fix-bs-vanna-sqrt-t-sign

Conversation

@gaoflow

@gaoflow gaoflow commented Jul 20, 2026

Copy link
Copy Markdown

bs_vanna returns the analytic Black-Scholes vanna scaled by -sqrt(t). It computes exp(-q t) * sqrt(t) * n(d1) * d2/v, but the correct vanna (∂vega/∂spot = ∂delta/∂vol, the DvegaDspot from #89, added in #94) is -exp(-q t) * n(d1) * d2/v. So there are two compounded errors: a spurious sqrt(t) factor and a flipped sign. The public EquityVanillaOption.vanna() calls bs_vanna directly and inherits both.

I checked the whole analytic greek surface against a closed-form reference and finite-differences of the price: delta, gamma, vega, theta and rho all agree to ~1e-6; only vanna diverged. The base-class EquityOption.vanna (finite-difference of delta) is fine, so the bug is confined to the analytic bs_vanna.

The existing regression only logged vanna into the golden file, which froze the wrong value (e.g. the call vanna was negative for an OTM strike, where it should be positive). This PR adds a real assertion in unit_tests pinning vanna() against both the closed form and the finite-difference of delta w.r.t. vol, and updates the golden vanna column.

Repro at S=100, K=120, t=2, r=0.03, q=0.01, v=0.10:

bs_vanna         -> -3.84489
closed form      ->  2.71875
FD d(delta)/dvol ->  2.71875

The Black-Scholes vanna is d(vega)/d(spot) = d(delta)/d(vol) =
-exp(-q t) n(d1) d2 / v, but bs_vanna computed
exp(-q t) sqrt(t) n(d1) d2 / v, i.e. scaled by -sqrt(t). The public
EquityVanillaOption.vanna() inherited the error; the other analytic
greeks (delta/gamma/vega/theta/rho) are unaffected.

The existing regression only logged vanna into the golden file, freezing
the wrong value. Add a real assertion in the unit tests that checks vanna
against the closed form and the finite-difference of delta w.r.t. vol,
and update the golden vanna column accordingly.
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.

1 participant