Add /economics route showing token costs, API usage, hypothesis price history charts, and market dynamics. Also add /api/economics/stats JSON endpoint.
GET /economics returns an HTML dashboard with:GET /api/economics/stats returns JSON with all the above metricsVerified on origin/main (HEAD: 32e22e2bb):
GET /economics at api.py:24979 — fully implemented with all 6 dashboard sections (aggregate stats, top movers, price histogram, transactions, token bars, event chips)GET /api/economics/stats at api.py:24946 — returns hypotheses, transactions, price_points, total_tokens, total_cost_usd, tool_calls, avg_price, event_distribution{
"_reset_note": "This task was reset after a database incident on 2026-04-17.\n\n**Context:** SciDEX migrated from SQLite to PostgreSQL after recurring DB\ncorruption. Some work done during Apr 16-17 may have been lost.\n\n**Before starting work:**\n1. Check if the task's goal is ALREADY satisfied (run the relevant checks)\n2. Check `git log --all --grep=task:YOUR_TASK_ID` for prior commits\n3. If complete, verify and mark done. If partial, continue. If not done, proceed.\n\n**DB change:** SciDEX now uses PostgreSQL. `get_db()` auto-detects via\nSCIDEX_DB_BACKEND=postgres env var.",
"_reset_at": "2026-04-18T06:29:22.046013+00:00",
"_reset_from_status": "done"
}