trading/services/api_gateway
Viktor Barzin bcd0857729
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat(backtest): wire real Alpaca historical fetcher
Previously the backtest API instantiated a _NoAlpaca stub that
returned an empty DataFrame for every fetch_daily_bars call, so the
mention-driven engine had no price data to mark trades against and
every backtest reported total_return=0 / trade_count=0.

Replace with _AlpacaHistoricalFetcher which:
- Uses StockHistoricalDataClient (alpaca-py) with Day timeframe
- Reads creds from TRADING_ALPACA_API_KEY/SECRET_KEY env vars (already
  injected via trading-bot-secrets ESO)
- DataFeed.IEX (free tier — same as services/market_data uses)
- Lazy-instantiates the SDK clients on first use to avoid import cost
  in the api-gateway hot path
- Returns indexed DataFrame matching KevinPriceLoader's expected shape
  ([open, high, low, close, volume], timestamp index)
- Returns empty DataFrame on Alpaca failure (loader has its own
  cache-miss fallback that no-ops gracefully)

is_asset_tradable also wired to the real Alpaca TradingClient so the
backtest doesn't trade non-tradable tickers.
2026-05-26 21:09:40 +00:00
..
auth fix: resolve all remaining TODOs, add dev mode auth bypass 2026-02-25 22:02:25 +00:00
routes feat(backtest): wire real Alpaca historical fetcher 2026-05-26 21:09:40 +00:00
tasks fix: resolve all remaining TODOs, add dev mode auth bypass 2026-02-25 22:02:25 +00:00
__init__.py feat: API gateway with passkey (WebAuthn) authentication 2026-02-22 15:53:48 +00:00
config.py fix: resolve all remaining TODOs, add dev mode auth bypass 2026-02-25 22:02:25 +00:00
main.py feat(api): /api/meet-kevin/strategy/* routes 2026-05-24 01:12:16 +00:00
ws.py feat: API gateway trading endpoints, controls, backtest, WebSocket 2026-02-22 15:54:20 +00:00