Spaces:
Running
Running
Commit History
18 days ago
-
Fix bond valuation understating holdings by 99% on stale secondary prices Running
Treasury bonds quote per 100 of face value. Two holdings were valued at a parsed price of 1.0, so `market_value = face * 1.0 / 100` reported 1% of face. For portfolio 23 this understated bond value by 293,205,000 TZS and flipped the dashboard from +14% to a phantom -14.06% loss. Cause chain: - parsers.py coerced an unparseable price to 0 via `_num(x) or 0`, making a missing value indistinguishable from a real quote of 0. - valuation.py guarded only on `is not None`, so 0 passed and the auction reference fallback never engaged. Changes: - Add `_num_or_none()` so a failed parse stays None instead of becoming 0. - Reject secondary prices outside 50-200% of par (observed real range 128-152) and fall back to the auction reference price. - Apply the same plausibility band to the auction price so both branches of `get_bond_pricing_context` return a sane value. This contains the damage but does not fix the parser: 19 rows in the live feed still carry 1.0, several with 1.0 in the yie…3e24bb7
-
Apply NMB 10:1 share split to prices, holdings, and transactions.
Adds an idempotent apply-split path that runs for known splits on startup and via POST /admin/stocks/apply-split. Co-authored-by: Cursor <cursoragent@cursor.com>e53e316
-
Upgrade tortoise-orm to fix HF startup with Pydantic 2.11+.
Tortoise 0.21.x passes model_config as a field name, which crashes pydantic_model_creator on import. Co-authored-by: Cursor <cursoragent@cursor.com>3c22e13 -
Fix HF Docker deps and expose remote MCP at /mcp.
Co-authored-by: Cursor <cursoragent@cursor.com>178a66c -
Add MCP server exposing DSE equity values for agents.
Co-authored-by: Cursor <cursoragent@cursor.com>b8542e4 -
Add WHI Faida Fund scraper and fund metadata.
Co-authored-by: Cursor <cursoragent@cursor.com>6807b90 -
Add Zansec Timiza fund and fix Orbit Inuka NAV import.
Co-authored-by: Cursor <cursoragent@cursor.com>e138853
-
Fetch iTrust and Vertex ETF prices from DSE and recalc portfolios.
Use class=ETF on the DSE range API for IEACLC-ETF and VERTEX-ETF, sync 365-day OHLC history, migrate legacy fund holdings, and rebuild affected portfolio snapshots. Co-authored-by: Cursor <cursoragent@cursor.com>bc1ef45 -
Add cryptography dependency for Clerk RS256 JWT verification.
PyJWT needs the crypto extra to verify Clerk session tokens; without it /portfolios and /users/me returned 500. Co-authored-by: Cursor <cursoragent@cursor.com>70b0717 -
Backfill default portfolios for existing users on startup.
On app boot, create a Default Portfolio for any user account that has none, including early Clerk test signups. Co-authored-by: Cursor <cursoragent@cursor.com>974f437 -
Ensure Clerk users always get a default portfolio on login.
Co-authored-by: Cursor <cursoragent@cursor.com>c77d408 -
Add Clerk JWT verification and user provisioning on the backend.
Verify Clerk session tokens via JWKS, link or auto-create local users, and migrate the users table with clerk_user_id. Co-authored-by: Cursor <cursoragent@cursor.com>818f107 -
Treat listed DSE ETFs as stocks, not duplicate mutual funds.
Hide ETFs from fund listings, block new fund-side adds, and add an admin migration to move existing ETF fund holdings into stock holdings. Co-authored-by: Cursor <cursoragent@cursor.com>05e64c3
-
Admin-gate privileged endpoints + add user detail with portfolio view
B1: Promoted require_admin to App/routers/users/utils.py (shared auth module) so any router can import it without circular deps. admin/routes.py delegates. B2: Admin-gated ~15 previously unguarded endpoints that any logged-in user could trigger (not just admins): - economy: import/daily, import/dse-report(s), import/nbs-cpi, publish/latest - stocks: import/{symbol}, sync/reference-data, sync/fundamentals, sync/corporate-actions, news/manual, news/cleanup, news/cleanup/all, news/admin, news/{id} update+delete - funds: info/sync, import/all, import/{manager} - bonds: POST /bonds, import-bonds B3: Added GET /admin/users/{user_id} — returns user profile, support notes, and read-only portfolio summaries (holdings, allocation, totals) for debugging support tickets. Audit-logs the view action.ffdcf18 -
Schedule stock OHLCV price-history refresh so charts stay current
The price-history scraper (refresh_stock_price_history) was admin-only, so StockPriceData went stale (latest rows were ~2 months old even though the DSE snapshot stayed live). Verified locally the scraper works: NMB & CRDB return data through today. Now scheduled: - daily market loop (10:00/14:00/17:00): added stock-prices phase after the snapshot phase. Warm DB -> incremental recent_refresh only. - startup_refresh: refresh history whenever stocks refresh (covers the force-refresh-all > 3 days case).c9016d6
-
transactions
4fb86e3 -
login issues
3dba8bc -
sync
2dc0b79 -
market sync
63f1c7b -
Sync all assets on startup if last market sync is older than 3 days
Wires the existing startup_refresh() into startup (it was defined but never called). Adds a STARTUP_FORCE_REFRESH_AFTER_DAYS=3 guard: when the last DSE snapshot (StockProfile.updated_at) is older than 3 days, force a full refresh of stocks + funds + bonds regardless of per-dataset staleness or weekend. Enriched the startup-refresh log line with last_sync_age and force_refresh_all.0810746 -
Add hourly intraday stock-price refresh during DSE trading hours
New scheduled_stock_price_loop refreshes DSE market snapshot every hour, Mon-Fri 10:00-17:00 Dar es Salaam, and idles until the next trading window otherwise. Reuses refresh_stocks(). Wired into startup alongside the existing market/news/economy loops.2e54aff
-
Parse DSE stock market results
d1103a3
-
Protect high coupon bond income streams
3adca8d -
Use market yields for bond allocation advice
76adf9f
-
Stop tracking web app v2 folder
a1d7826 -
Combine economy news pages
dbec8a8 -
Update economy page headings by route
95b201c -
Rework economy into routed intelligence pages
f5f98c9 -
Polish economy terminal overview
2cc22f1 -
Ignore local webapp copies
fcde10f -
Route economy drilldown pages
4bd1a55 -
Restore full economy ingest database sync
fb3fa71 -
Update economy intelligence 2026-05-12
Verified signatureae9c3cb -
Update economy intelligence 2026-05-12
Verified signature1f610c9 -
Hide macro fetch failures from economy alerts
05656b7 -
Update economy intelligence 2026-05-12
Verified signaturef1fe244 -
Update economy intelligence 2026-05-12
Verified signaturee60a60d -
Redesign economy drilldown views
449f6c2 -
Add macro signals to economy payload
197092e
-
Store economy payloads and clean economy tab
211ea80 -
Store economy payloads and enrich bond advice
0e076de -
Limit economy publish alerts to source report
a49b8b9 -
Ignore local bond ids on economy ingest
e0cdfb7 -
Update economy intelligence 2026-05-12
Verified signature9016461 -
Update economy intelligence 2026-05-12
Verified signature85d0938 -
Update economy intelligence 2026-05-12
Verified signature44d11c4 -
Update economy intelligence 2026-05-12
Verified signaturee89c199 -
Update economy intelligence 2026-05-12
Verified signature8a9d879 -
Update economy intelligence 2026-05-12
Verified signature8df5fc0 -
Update economy intelligence 2026-05-12
Verified signature2588cd7