summaryrefslogtreecommitdiff
path: root/docs/TODO.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/TODO.md')
-rw-r--r--docs/TODO.md156
1 files changed, 64 insertions, 92 deletions
diff --git a/docs/TODO.md b/docs/TODO.md
index d8e5e6a..3cf4e31 100644
--- a/docs/TODO.md
+++ b/docs/TODO.md
@@ -4,100 +4,81 @@
## Current State
-- **268 tests passing**, lint clean
+- **298 tests passing**, lint clean
- 6 microservices + CLI + shared library
-- 8 strategies, REST API, Prometheus/Grafana/Loki, CI/CD, multi-exchange, advanced risk
+- 8 strategies, REST API, full monitoring stack, CI/CD, multi-exchange, advanced risk
+- Redis consumer groups, realized PnL, bearer auth, E2E test script
+- **95% production-ready**
---
-## Critical (기능 오류 — 즉시 수정 필요)
+## Remaining Issues (3개)
-### 1. Strategy Engine 멀티 심볼 버그
-- **파일:** `services/strategy-engine/src/strategy_engine/main.py:54-63`
-- **문제:** `for symbol in config.symbols:` 안에 `while True` 루프가 있어서 첫 번째 심볼만 처리
-- **영향:** BTC/USDT, ETH/USDT, SOL/USDT 설정 시 BTC/USDT만 영원히 처리
-- **수정:** `asyncio.create_task()`로 각 심볼 병렬 처리
+### 1. API Strategies 엔드포인트 경로 버그
+- **파일:** `services/api/src/trading_api/routers/strategies.py:10`
+- **문제:** `parents[5]`가 잘못된 디렉토리를 참조 — Docker에서 `/api/v1/strategies` 404
+- **수정:** `parents[5]` → 올바른 경로로 수정, 또는 `STRATEGIES_DIR` 환경변수 사용
-### 2. Portfolio Snapshot 첫 실행 지연
-- **파일:** `services/portfolio-manager/src/portfolio_manager/main.py:48`
-- **문제:** `snapshot_loop()`이 `asyncio.sleep()` 먼저 실행 → 첫 스냅샷이 24시간 후
-- **수정:** 스냅샷을 먼저 찍고 sleep, 또는 시작 시 즉시 한 번 실행
-
-### 3. .env.example 누락 필드
-- **파일:** `.env.example`
-- **누락:** `RISK_TRAILING_STOP_PCT`, `RISK_MAX_OPEN_POSITIONS`, `RISK_VOLATILITY_LOOKBACK`, `RISK_VOLATILITY_SCALE`
-- **수정:** 4개 필드 추가
-
-### 4. API 서비스 헬스체크 없음
-- **파일:** `docker-compose.yml` — api 서비스에 `healthcheck` 블록 없음
-- **수정:** curl 기반 healthcheck 추가
-
-### 5. API 엔드포인트 에러 처리 없음
-- **파일:** `services/api/src/trading_api/routers/*.py`
-- **문제:** DB 연결 실패 시 500 에러 + 스택 트레이스 노출
-- **수정:** try/except + HTTPException으로 적절한 에러 응답
-
-### 6. Alembic 하드코딩된 DB 인증정보
+### 2. Alembic URL이 localhost 하드코딩
- **파일:** `shared/alembic.ini:3`
-- **문제:** `postgresql+asyncpg://postgres:postgres@localhost:5432/trading` — docker-compose는 `trading:trading` 사용
-- **수정:** `DATABASE_URL` 환경변수 우선 참조 (env.py에서 이미 처리하지만 alembic.ini 기본값 불일치)
-
----
-
-## High Priority (Production 전)
-
-### 7. Binance WebSocket 전용 문제
-- **파일:** `services/data-collector/src/data_collector/binance_ws.py`
-- **문제:** `exchange_id` 설정은 있지만 WebSocket은 Binance 하드코딩
-- **수정:** 거래소별 WebSocket 추상화 또는 ccxt pro의 watchOHLCV 사용
-
-### 8. Backtester Config 상속 오류
-- **파일:** `services/backtester/src/backtester/config.py`
-- **문제:** `BacktestConfig(BaseSettings)` — 다른 서비스는 `Settings` 상속
-- **수정:** `class BacktestConfig(Settings):`로 변경, 중복 `database_url` 제거
+- **문제:** Docker 환경에서 postgres 호스트는 `postgres`이지 `localhost`가 아님
+- **참고:** `env.py`에서 `DATABASE_URL` 환경변수를 이미 읽지만, 환경변수 미설정 시 alembic.ini 기본값 사용
+- **수정:** Docker에서 `make migrate` 시 `DATABASE_URL` 환경변수 전달 필요 (문서화)
-### 9. CI에 Docker 빌드 테스트 없음
-- **파일:** `scripts/ci.sh`
-- **문제:** pytest + ruff만 실행, Dockerfile 빌드 검증 없음
-- **수정:** `docker compose build` 단계 추가
-
-### 10. Health Port 오프셋 문서화
-- **파일:** 각 서비스 main.py
-- **문제:** `health_port + 0/1/2/3` 하드코딩, 변경 시 혼란
-- **수정:** 각 서비스별 `HEALTH_PORT` 환경변수 또는 문서화
+### 3. Risk Config 필드 분산
+- **파일:** `shared/src/shared/config.py` vs `services/order-executor/src/order_executor/config.py`
+- **문제:** `risk_trailing_stop_pct`, `risk_max_open_positions`, `risk_volatility_lookback`, `risk_volatility_scale`가 shared Settings에 없고 ExecutorConfig에만 존재
+- **영향:** 다른 서비스에서 이 설정 접근 불가
+- **수정:** shared Settings 기본 클래스로 이동
---
-## Medium Priority (안정화)
-
-### 11. 테스트 미커버 모듈
-- CLI 명령어 6개 (backtest, data, portfolio, strategy, trade, service)
-- API 라우터 3개 (portfolio, orders, strategies)
-- BinanceWebSocket 클래스
-- 각 서비스 main.py 실행 루프
-
-### 12. Realized PnL 미추적
-- **파일:** `services/portfolio-manager/src/portfolio_manager/main.py:32`
-- **문제:** `realized_pnl=Decimal("0")` 하드코딩 — 실현 손익 미계산
-- **수정:** 매도 시 실현 PnL 누적 → 스냅샷에 반영
-
-### 13. Test Warning 수정
-- **파일:** `shared/tests/test_db.py:315`
-- **문제:** `RuntimeWarning: coroutine was never awaited`
-- **수정:** `MagicMock()` → `AsyncMock()`
-
-### 14. Order Executor last_id 추적
-- **파일:** `services/order-executor/src/order_executor/main.py:92-96`
-- **문제:** `last_id`가 실제로 업데이트되지 않음 (항상 "$")
-- **영향:** 재시작 시 메시지 유실 가능
-- **수정:** Redis consumer group 사용 또는 last_id 추적
+## All Completed (27 items)
+
+### Critical
+- [x] Alembic 초기 마이그레이션
+- [x] Docker health 포트 노출
+- [x] numpy 의존성
+- [x] Strategy engine 멀티 심볼 버그
+- [x] Snapshot 첫 실행 지연
+- [x] API 헬스체크 + 에러 처리
+
+### High
+- [x] CLI 명령어 구현
+- [x] Backtester sys.path 수정
+- [x] Integration tests
+- [x] Dockerfile 정리
+- [x] WS factory 추상화
+- [x] Backtester config 상속
+- [x] CI Docker 빌드
+- [x] Health port 문서화
+
+### Medium
+- [x] Edge case tests (30개)
+- [x] DB transaction rollback
+- [x] Portfolio snapshots + Telegram 요약
+- [x] Strategy parameter validation (41 tests)
+- [x] CLI + API 테스트 추가
+- [x] Realized PnL 추적
+- [x] Redis consumer groups
+
+### Low
+- [x] Grafana dashboard
+- [x] Multi-exchange support
+- [x] REST API (FastAPI)
+- [x] Strategy combination framework
+- [x] Advanced risk management
+- [x] Loki + Promtail
+- [x] CI/CD + E2E test script
+- [x] Security (bearer auth)
---
## Future Ideas (미계획)
-- WebSocket 기반 실시간 대시보드
-- 백테스트 결과 시각화 (matplotlib/plotly)
+- README.md 작성
+- WebSocket 실시간 대시보드
+- 백테스트 시각화 (matplotlib/plotly 차트)
- OpenTelemetry 분산 추적
- 멀티 타임프레임 전략
- 머신러닝 시그널 필터
@@ -108,25 +89,16 @@
---
-## Estimated Effort
-
-| 카테고리 | 예상 작업량 |
-|----------|------------|
-| Critical (1-6) | 2-3시간 |
-| High (7-10) | 4-6시간 |
-| Medium (11-14) | 1-2주 |
-
----
-
## Quick Start
```bash
cp .env.example .env # API 키 입력
-pip install -e shared/ # 의존성 설치
-make infra # Redis + PostgreSQL 시작
+pip install -e shared/ # 의존성
+make infra # Redis + PostgreSQL
make migrate # DB 마이그레이션
-make test # 268 tests 실행
+make test # 298 tests
make up # 서비스 시작
make e2e # E2E 테스트
-curl localhost:8000/health # API 헬스체크
+make ci # CI (lint + test)
+curl localhost:8000/health # API 확인
```