Quest: Market Participants Priority: P2 Status: open
Add ROI tracking — measure returns on capital allocated to research directions
This task is part of the Market Participants quest (Exchange layer). It contributes to the broader goal of building out SciDEX's exchange capabilities.
get_roi_analytics() function already exists but was not exposed as API endpointcalculate_hypothesis_roi and calculate_analysis_roi (around lines 2171 and 2344)/api/roi/analytics JSON API endpoint (api.py:16694) that calls get_roi_analytics(db)/exchange/roi HTML page (api.py:28343) displaying:api.py (critical file touched but not named in message body)orchestra/task/500f966e-add-roi-tracking-measure-returns-on-capiEvidence: Verified on origin/main (HEAD 0eaeca630):
/api/roi/analytics endpoint exists at api.py:16723 — returns JSON with analysis_rois, roi_stats, underperforming, high_potential/exchange/roi HTML page exists at api.py:29425 — full dashboard with stats grid, rankings table, underperforming research, high-potential underfunded analysesget_roi_analytics(), calculate_analysis_roi(), calculate_hypothesis_roi() present in mainc735704c3 and 4d335bace (original implementation), later merged via squash merge 3984354e4 and 2f13f716dSummary: ROI tracking was fully implemented and landed on main — task was marked done but audit could not verify. Verification confirms implementation is present and correct.
{
"_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"
}