AI 트레이딩: 교훈 #119: 계정 재설정 후 페이퍼 트레이딩 API 키 불일치

발행: (2026년 1월 9일 오전 08:51 GMT+9)
2 min read
원문: Dev.to

Source: Dev.to

Date

January 8, 2026

Severity

HIGH

Category

Configuration / Infrastructure

Summary

Paper trading stopped working because a workflow job still referenced the old API secrets (ALPACA_PAPER_TRADING_API_KEY / ALPACA_PAPER_TRADING_API_SECRET) after the paper account was reset to a new $5 K account with different credentials (ALPACA_PAPER_TRADING_5K_API_KEY / ALPACA_PAPER_TRADING_5K_API_SECRET).

  • On Jan 7 2026 the CEO reset the paper account to $5 000 and generated new API keys.
  • Most workflow jobs were updated to use the new _5K‑suffixed secrets.
  • The protect‑existing‑positions job in daily-trading.yml continued to use the old secrets, causing a credential mismatch that blocked pre‑market protection.

Impact

  • No trades executed on Jan 7–8 2026 (2 days of paper trading lost).
  • No Phil Town strategy validation during this period.
  • Potential stop‑loss protection gaps for existing positions.

Bug Location

.github/workflows/daily-trading.yml – lines 286‑287

BEFORE (broken)

ALPACA_API_KEY: ${{ secrets.ALPACA_PAPER_TRADING_API_KEY }}
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_PAPER_TRADING_API_SECRET }}

AFTER (fixed)

ALPACA_API_KEY: ${{ secrets.ALPACA_PAPER_TRADING_5K_API_KEY }}
ALPACA_SECRET_KEY: ${{ secrets.ALPACA_PAPER_TRADING_5K_API_SECRET }}

Resolution

  • Updated the protect‑existing‑positions job to use the correct _5K‑suffixed secrets.
  • Added a CI check to ensure all secret references match the expected naming pattern.

Recommendations & Checklist

  • Always grep for all secret references when renaming or adding new secrets.
  • Create a centralized environment file or reusable workflow for secret management.
  • Add a CI validation step that fails if any secret reference does not follow the naming convention.
  • When resetting accounts, use a checklist covering every location that references API keys.

Example CI checks (bash)

# Should return 0 results after the fix
grep -r "ALPACA_PAPER_TRADING_API_KEY[^_]" .github/workflows/
grep -r "ALPACA_PAPER_TRADING_API_SECRET[^_]" .github/workflows/

# Verify new secret references exist
grep -r "ALPACA_PAPER_TRADING_5K" .github/workflows/
  • ll_117: ChromaDB Removal Caused 2‑Day Trading Gap
  • ll_111: Paper Capital Must Match Real (Jan 7, 2026)

This lesson was auto‑published from the AI Trading repository.

Back to Blog

관련 글

더 보기 »

액션 캐시 엔트리의 Rate limiting

GitHub Actions 캐시에는 이제 리포지토리당 분당 200 업로드라는 rate limit이 적용됩니다. 이 제한은 새로운 캐시 엔트리의 업로드에만 영향을 미치며, 기존 캐시에는 영향을 주지 않습니다.

새롭고 향상된 ESC Editor 소개

Pulumi ESC는 Pulumi Cloud의 중앙 집중식 솔루션으로, 사용 중인 모든 vault와 클라우드 제공자 전반에 걸쳐 비밀 및 구성을 관리합니다. 이는 팀이 보안을 …