Skip to content

feat: add Alpha Vantage as primary market data source (replace Yahoo Finance + Finnhub) #2055

@koala73

Description

@koala73

Why Alpha Vantage

WorldMonitor currently uses two free market data sources with known reliability issues:

Source Problem
Yahoo Finance IP-level 429s on Vercel requiring Railway relay workaround; 15–30 min delay on commodity futures (NYMEX/COMEX); unofficial scraper-based access — no SLA
Finnhub (free) Burst-sensitive (429s above ~10 req/min); US stocks only; no indices, no commodities, no futures

Alpha Vantage at $49.99/month solves both with a single licensed API key.


What Alpha Vantage covers at entry tier ($49.99/mo)

Asset class Coverage
US stocks Real-time quotes
Indices S&P 500, Dow, Nasdaq, VIX
Commodity futures Gold (GC=F), WTI Crude (CL=F), Natural Gas (NG=F), Silver (SI=F), Copper (HG=F)
Forex Real-time currency pairs
Crypto Intraday real-time
ETFs Real-time US ETFs
Extended hours Pre/post market data
News + AI sentiment Per-ticker sentiment scores
Economic indicators Built-in series
Fundamentals Earnings, income statements, ratios

Rate limit: 75 req/min with REALTIME_BULK_QUOTES supporting up to 100 symbols per call → ~7,500 symbols/minute effective throughput. WM's polling-every-minute architecture maps directly to this.


Why this beats the current stack

  • No IP rate limiting — dedicated API key, not shared Vercel IP pool
  • No Railway relay needed for market data fetches
  • Real-time commodity futures — fixes 30-min NYMEX/COMEX delay from Yahoo
  • One API key, all asset classes — no more Finnhub + Yahoo + relay complexity
  • Official licensed data — SLA-backed, not scraper-dependent
  • Cost: $49.99/mo vs $0 current, but eliminates engineering overhead of the Yahoo/Finnhub reliability workarounds

What stays unchanged

  • CoinGecko — crypto sector market cap breakdown (AV covers prices, not sector aggregates)
  • FRED / EIA / BIS — macro/economic series (unrelated to market quotes)

Implementation outline

  1. Register at https://www.alphavantage.co/ and obtain ALPHA_VANTAGE_API_KEY
  2. Add key to Railway + Vercel env vars
  3. Replace Yahoo Finance fetcher in server/worldmonitor/market/v1/_shared.ts with AV REALTIME_BULK_QUOTES endpoint
  4. Update scripts/seed-market-quotes.mjs — batch symbols into groups of 100, single AV call per batch
  5. Update scripts/seed-commodity-quotes.mjs — switch from Yahoo GC=F/CL=F symbols to AV physical commodity endpoints
  6. Update scripts/seed-etf-flows.mjs — AV ETF quotes
  7. Keep Finnhub as optional fallback or deprecate entirely
  8. Remove Railway relay Yahoo proxy route once migration is validated

API Documentation

Pricing

https://www.alphavantage.co/premium/

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: APIBackend API, sidecar, keysarea: marketsMarkets, commodities, crypto, financeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions