Investigate missing realtime market data for Monday 12-22-2025 portfolio analysis
Resolved 💬 1 comment Opened Dec 22, 2025 by hachilam2018 Closed Jan 13, 2026
Summary
The manager agent reported "Market closed (weekend)" and used stale/cached data when generating a portfolio report on Monday 12-22-2025, even though:
- ClickHouse has 566,208 SPX options records for that date (snapshots from 06:00 to 13:55)
- Live data should be available from Fidelity, Schwab, or ClickHouse
Evidence
Agent's Incorrect Assessment
From the generated report (reports/2025-12-22/portfolio-report.md):
## Notes on Data Quality
**Limitations:**
- Market closed (weekend) - prices are Friday close
- Some SPX options show "not found" - likely due to weekly expiration vs standard monthly
- Theta calculations show 0% - will update Monday with live market data
- Greeks are historical - verify with live quotes before execution
**Data Sources:**
- Position data: Live from brokerage accounts
- Options pricing: Historical/cached data
- Greeks: Calculated from historical implied volatility
ClickHouse Data Actually Available
Query confirmed data exists for 2025-12-22:
| quote_date | record_count | first_snapshot | last_snapshot | underlying_price |
|------------|--------------|---------------------|---------------------|------------------|
| 2025-12-22 | 566208 | 2025-12-22 06:00:31 | 2025-12-22 13:55:27 | 6834.5000 |
Impact
- Portfolio report shows "0% theta ratio" due to missing realtime options data
- Greeks are historical rather than current
- Agent incorrectly assumed weekend when it was Monday
- Users may make trading decisions based on stale data
Investigation Areas
- Date Detection Logic: Why did the agent think Monday was a weekend?
- Data Source Priority: Is the system falling back to cached data instead of querying live sources?
- ClickHouse Integration: Are MCP tools properly querying ClickHouse for current-day options data?
- Schwab/Fidelity Connectors: Are live API calls being made or is caching too aggressive?
Affected Components
server/mcp_server/tools/portfolio.py- Portfolio toolserver/mcp_server/services/- Various services fetching market dataserver/mcp_server/connectors/- Schwab, Fidelity, ClickHouse connectorsplugin/agents/manager.md- Manager agent prompts
Steps to Reproduce
- Run
/positioncommand on a trading day (Monday-Friday) - Generate full portfolio report
- Check if agent reports "weekend" or uses stale data
- Compare against ClickHouse data for same date
Expected Behavior
- Agent should detect it's a trading day
- Options pricing should come from live sources (Schwab API or ClickHouse)
- Greeks should be calculated from current IV data
- Theta ratio should be non-zero
Labels
bug, data-quality, investigation
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗