fix(options): discount zero-volatility forward value - #1066
Open
pengpengyi92 wants to merge 1 commit into
Open
Conversation
Signed-off-by: PP1 <74917296+pengpengyi92@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
T > 0andsigma <= 0at discounted forward intrinsic value instead of immediate spot intrinsic value.Why
With zero volatility and time remaining, the terminal spot is deterministic:
S_T = S * exp((r - q)T). The current shared pricing primitive groups that case with expiry and returns immediate intrinsic value. That can misprice both the amount and the exercise side, and it violates discounted put-call parity.For example,
S=100, K=102, T=1, r=5%, q=2%, sigma=0is spot-OTM but deterministic-forward-ITM for the call. The current branch prices the call at zero and the put at 2; the corrected branch prices discounted forward intrinsic instead.Changes
Out of scope: implied-volatility solver policy, live trading, broker connectors, MCP, network behavior, secrets, and deployment.
Test Plan
fastmcp,yfinance, andccxtdependencies (48 collection errors before test execution).pytest agent/tests/quantlib/test_options.py agent/tests/test_options_pricing_degenerate.py agent/tests/test_options_bs_nonpositive_strike.py agent/tests/test_options_portfolio_correctness.py -q— 156 passed.pytest agent/tests/quantlib -q— 994 passed, 61 skipped.ruff check agent/src/quantlib/options.py agent/tests/quantlib/test_options.py— clean.Risk and Rollback
The change is confined to the shared Black-Scholes primitive and its tests. It does not touch protected agent/session/provider areas or any order, broker, credential, network, or deployment path. A single-commit revert restores previous behavior.
Checklist
src/agent/,src/session/,src/providers/) without prior discussion