Repository navigation
Put the max-pain star on the stored real strike; hints follow the monthly expiry - #134
Merged
Merged
Conversation
…thly expiry The snapshot writer already snaps the curve's minimum to a strike the chain actually has and stores it as `MaxPainStrike`, but both options panels took the argmin of the 200-point simulated grid instead and never read that column, so the star, the dashed payout line, the delta arrow and the premium/discount bars could all sit up to half a grid step off any real strike (7605.74 against the stored 7603.93 on yesterday's ES snapshot). One helper, `max_pain_point`, now reads the stored strike and interpolates its payout off the curve, and both panels go through it; rows written before the column existed fall back to the grid argmin. The two hints and the DEFAULT_OFF rationale follow cotmetrics 0.14.0 (mspinola/cotmetrics#45), where each snapshot is taken on the nearest open standard monthly rather than the first expiry more than three days out. The history panel stays opt-in: the roll is now monthly rather than several times a week, but the stored series before 2026-09-18 is on the weeklies and has yet to accumulate a stretch on one expiry. data_architecture.md gains the strike ladder file that release starts writing, which no panel reads yet. Co-Authored-By: Claude Opus 5 <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.
Follows mspinola/cotmetrics#45 (merge that first; the hint text describes its behaviour).
Star on
MaxPainStrikeThe snapshot writer snaps the curve's minimum to a real strike and stores it as
MaxPainStrike, but both options panels took the argmin of the 200-point simulated grid and never read that column, so the star, the dashed payout line, the delta arrow and the premium/discount bars could sit up to half a grid step off any real strike (7605.74 vs the stored 7603.93 on the 2026-09-17 ES snapshot).max_pain_pointreads the stored strike and interpolates its payout off the curve; both panels go through it, so they agree. Rows without the column fall back to the grid argmin.Residual: the heatmap's Max Pain Pull comes from
cotmetrics.options_data.get_max_pain_for_symbol, which still takes the grid argmin. Not in this PR.Hints and the default-off rationale
Updated for cotmetrics 0.14.0: snapshots are on the nearest open standard monthly, so the history panel rolls once a month rather than several times a week. It stays in
DEFAULT_OFF_PLOTSbecause the stored series before 2026-09-18 is on the weeklies and has no stretch on one expiry yet; the comment now says exactly that.docs/data_architecture.mddocuments the strike ladder file ({symbol}_options_strikes.parquet) that 0.14.0 starts writing; no panel reads it yet.Tests
4 new in
tests/test_max_pain_strike.py(store-free, parquet in tmp_path). Suite 879 passed; ruff 0.15.22 clean atsrc tests.🤖 Generated with Claude Code