diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-21 14:49:56 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-21 14:49:56 -0700 |
| commit | 2222d8a5fac6850d7d924e9404a44a65cb10f68f (patch) | |
| tree | 2fe934024f77dcc44ec52aed9c5fe8824b535e4e /frontend/components/prism/options/OptionsPage.tsx | |
| parent | 25360aacb8aab46e7e579707eb9704759af9536d (diff) | |
fix: rewrite polar smile with correct closed-lens geometry
- Piecewise angleFor: puts go CCW (ATM→bottom), calls go CW (ATM→bottom)
so both wings meet at the same bottom point and the path closes with Z
- Dynamic ivToR computed from actual IV range across all expiries
(inner floor 60px, outer wall 240px) instead of hardcoded percentages
- IV rings: 5 evenly-spaced steps between real ivLo/ivHi
- Curve fill: rgba(194,170,122,0.12) matching design reference
- Non-selected curves: index-based styles (solid fg-1, then dashed fg-2/3/4)
- Eye price at font-size 30, label lowercase 'call · fair'
- Dashed marker-line spoke from center to selected-K dot
- Clicking a curve switches the selected expiry via onPickT
- Strike ticks use round multiples of a price-adaptive step
- Fix IvHeatmap xlabs duplicate key error (key by index, not rounded K)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend/components/prism/options/OptionsPage.tsx')
| -rw-r--r-- | frontend/components/prism/options/OptionsPage.tsx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/frontend/components/prism/options/OptionsPage.tsx b/frontend/components/prism/options/OptionsPage.tsx index 7fcf5c3..4065d9f 100644 --- a/frontend/components/prism/options/OptionsPage.tsx +++ b/frontend/components/prism/options/OptionsPage.tsx @@ -150,14 +150,18 @@ export function OptionsPage({ overview, ticker }: OptionsPageProps) { <div className="opt-col"> <PolarSmile S={inputs.S} + K={inputs.K} + T={expiry.T} r={r} q={q} atmSigma={atmSigma30} - K={inputs.K} - T={expiry.T} type={inputs.type} expiries={EXPIRIES} - selectedExpiryIdx={expiryIdx} + selectedT={expiry.T} + onPickT={T => { + const idx = EXPIRIES.findIndex(e => Math.abs(e.T - T) < 1e-6); + if (idx >= 0) selectExpiry(idx); + }} /> <IvHeatmap S={inputs.S} |
