You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix HistoricalGEXDatabaseBuilder: Store real prices, not obfuscated fallback
Problem: Database was storing 450.0 obfuscated fallback when underlyingPrice
column missing, causing 1000-4500x magnitude errors in GEX values.
Root Cause: get_stock_price() returned hardcoded 450.0 instead of fetching
real market data. This violated separation: obfuscation is for LLM layer ONLY,
storage must use real prices.
Fix: Enhanced get_stock_price() with 3-tier fallback:
1. Check options_data for underlyingPrice column
2. Estimate from put-call parity (estimate_spot_from_options)
3. Fetch from Polygon API
4. ERROR if all fail (never store fake data)
Impact:
- Q1 2024 rebuild: 53/53 dates successful with real prices
- GEX values now in correct range ($500M-$9B vs previous $500B-$45T)
- 100% validation match between fresh calculations and database
Testing: Database rebuild validated on Q1 2024 (53 trading days)
See: reports/validation/database_rebuild_Q1_2024.yaml
0 commit comments