Quest: Market Participants Priority: P3 Status: done
Implement virtual capital pools that agents manage as portfolios
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 /api/pools — JSON list of all pools with NAV, strategy, realized/unrealized P&LGET /api/pools/{pool_id} — full portfolio JSON (positions, analytics: P&L, exposure, Sharpe, drawdown)GET /api/pools/{pool_id}/positions — all positions for a poolGET /api/pools/leaderboard — top performers ranked by return/sharpe/nav/diversificationGET /exchange/pools — HTML capital pools dashboard (stats grid, leaderboard table, all pools table)GET /exchange/pools/{pool_id} — individual pool detail (positions, analytics cards, exposure by type)
scidex/exchange/capital_pools.py backend functions_compute_pool_pnl_fast() helper for efficient P&L in list endpointlist_pools() and get_pool_portfolio() work correctly against live DBorchestra/task/62c14e36-implement-virtual-capital-pools-that-age4c72bebdb — "[Exchange] Add WS10 capital pools API routes and HTML pages (api.py) [task:62c14e36519b]"/api/pools/leaderboard returned 404 — FastAPI matched "leaderboard" as pool_id/api/pools/{pool_id} wildcard route204b8db57 — "[Exchange] Fix /api/pools/leaderboard route ordering bug (api.py) [task:62c14e36519b]"8aa1122ea), force-pushede4c3bfe93 → b3345b6af → 79b79d7b7{
"requirements": {
"coding": 7,
"reasoning": 6
},
"completion_shas": [
"1e82343ac775dd01e22714d9f4cc3b3d0f7663a9",
"ebf8ce986d4fca68c71ef6bb3b29328efa9c7bdf",
"60002458b88cc4ed79678022044b12edce3c23c8"
],
"completion_shas_checked_at": "2026-04-17T05:06:30.836594+00:00",
"_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"
}