fix(mcp): normalize theta/vega/rho in calc_indexes response - #52
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The calc_indexes API returns these Greeks as raw unscaled values that differ from what the Longbridge app displays: - theta: annualized (×252) → divide by 252 for per-trading-day - vega: scaled by 100 → divide by 100 for per-1%-IV-change - rho: scaled by 100 → divide by 100 for per-1%-rate-change Matches the normalization applied by the longbridge-terminal CLI. Fixes longbridge/developers#1014. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hogan-yuan
pushed a commit
that referenced
this pull request
Jul 6, 2026
## Summary - `calc_indexes` tool was returning raw unscaled Greek values that differ from what the Longbridge app displays - Apply the same normalization as `longbridge-terminal` CLI before returning results: - **theta**: raw value is annualized (×252) → divide by 252 for per-trading-day value - **vega**: raw value is scaled by 100 → divide by 100 for per-1%-IV-change value - **rho**: raw value is scaled by 100 → divide by 100 for per-1%-rate-change value ## Test plan - [ ] Start MCP server locally and call `calc_indexes` with `theta`, `vega`, `rho` fields - [ ] Verify returned values match the Longbridge app display (same as `longbridge calc-index` CLI output) Fixes longbridge/developers#1014 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.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
calc_indexestool was returning raw unscaled Greek values that differ from what the Longbridge app displayslongbridge-terminalCLI before returning results:Test plan
calc_indexeswiththeta,vega,rhofieldslongbridge calc-indexCLI output)Fixes longbridge/developers#1014
🤖 Generated with Claude Code