feat: company names for tickers (Alpaca backfill + subtle display)
Deploy / lint (push) Successful in 6s
Deploy / test (push) Successful in 55s
Deploy / deploy (push) Successful in 32s

Store an optional company name on Ticker (migration 014) and backfill it from
Alpaca's asset list in a single Trading-API call for the whole universe — no
per-ticker fetch. Runs automatically at the end of universe bootstrap and via a
manual "Backfill Names" button (admin) / POST /admin/tickers/backfill-names.

The name ships on /tickers; a shared symbol→name map (useTickerNames) lets any view
show it without its own request. Displayed subtly next to the symbol — in the global
search, the ticker header, and as a small muted line under the symbol in Top Setups
and Open Trades (no extra column, truncated so it never widens the table).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 10:50:40 +02:00
parent a9f4686157
commit da0bb3367e
14 changed files with 169 additions and 2 deletions
+10
View File
@@ -315,6 +315,16 @@ async def bootstrap_tickers(
return APIEnvelope(status="success", data=result)
@router.post("/admin/tickers/backfill-names", response_model=APIEnvelope)
async def backfill_ticker_names(
_admin: User = Depends(require_admin),
db: AsyncSession = Depends(get_db),
):
"""Fill in company names for tracked tickers (one Alpaca call)."""
result = await ticker_universe_service.backfill_ticker_names(db)
return APIEnvelope(status="success", data=result)
# ---------------------------------------------------------------------------
# Data cleanup
# ---------------------------------------------------------------------------