Commit Graph

33 Commits

Author SHA1 Message Date
fanziqi
ad60a53262 review: add code audit annotations and REVIEW.md for v5.1
P0 issues annotated (critical, must fix before live trading):
- signal_engine.py: cooldown blocks reverse-signal position close
- paper_monitor.py + signal_engine.py: pnl_r 2x inflated for TP scenarios
- signal_engine.py: entry price uses 30min VWAP instead of real-time price
- paper_monitor.py + signal_engine.py: concurrent write race on paper_trades

P1 issues annotated (long-term stability):
- db.py: ensure_partitions uses timedelta(30d) causing missed monthly partitions
- signal_engine.py: float precision drift in buy_vol/sell_vol accumulation
- market_data_collector.py: single bare connection with no reconnect logic
- db.py: get_sync_pool initialization not thread-safe
- signal_engine.py: recent_large_trades deque has no maxlen

P2/P3 issues annotated across backend and frontend:
- coinbase_premium KeyError for XRP/SOL symbols
- liquidation_collector: redundant elif condition in aggregation logic
- auth.py: JWT secret hardcoded default, login rate-limit absent
- Frontend: concurrent refresh token race, AuthContext not synced on failure
- Frontend: universal catch{} swallows all API errors silently
- Frontend: serial API requests in LatestSignals, market-indicators over-polling

docs/REVIEW.md: comprehensive audit report with all 34 issues (P0×4, P1×5,
P2×6, P3×4 backend + FE-P1×4, FE-P2×8, FE-P3×3 frontend), fix suggestions
and prioritized remediation roadmap.
2026-03-01 17:14:52 +08:00
root
77d38c7269 fix: add total_pnl to stats API top-level response 2026-03-01 01:42:39 +00:00
root
bda42e669a feat: stats panel with per-symbol tabs (ALL/BTC/ETH/XRP/SOL) - full stats for each coin 2026-03-01 01:37:02 +00:00
root
d0e626a437 feat: paper summary add balance + pnl_usdt 2026-02-28 12:00:19 +00:00
root
d177d28498 fix: paper positions use Binance realtime price instead of signal_indicators 2026-02-28 11:49:49 +00:00
root
f90df6f3b5 feat: paper positions show real-time price + unrealized PnL (R + USDT) 2026-02-28 11:40:11 +00:00
root
b232270948 fix: add Request import 2026-02-28 11:20:05 +00:00
root
cd17c76000 fix: remove duplicate return causing IndentationError in main.py 2026-02-28 11:19:01 +00:00
root
282aed138a feat: paper trading switch + config API + max positions limit 2026-02-28 11:13:39 +00:00
root
e054db112d feat: paper trading - backend (table+signal_engine integration+5 APIs) + frontend page 2026-02-28 11:10:28 +00:00
root
0ac2225979 feat: add XRP and SOL symbols (4 coins total) 2026-02-28 10:11:05 +00:00
root
ec6a8fc64d fix: rename signal-history API to avoid route conflict + restart backfill 2026-02-28 06:22:32 +00:00
root
424cb993f8 feat: signal history list + always compute scoring even without signal 2026-02-28 06:09:32 +00:00
root
2e969f68b4 fix: parse JSONB string from asyncpg + frontend parseVal fallback 2026-02-28 05:49:42 +00:00
root
7ca843ca70 fix: revert signals/latest API to explicit column query (to_jsonb broke field names) 2026-02-28 05:45:21 +00:00
root
340d8eb3a1 feat: V5.1 frontend - 5-layer scoring display + market indicators panel 2026-02-28 05:33:40 +00:00
root
748f6f57a5 perf: server/status接口优化(cpu非阻塞+pm2直接调用+COUNT估算+5秒缓存) 2026-02-27 18:46:56 +00:00
root
930c8d3a9c feat: 服务器监控面板(/server) - CPU/内存/硬盘/PM2进程/PG数据库/回补状态 2026-02-27 17:30:41 +00:00
root
61287657df perf: trades/summary聚合下推PG(SQL GROUP BY替代Python循环) + trades/latest加2秒缓存 2026-02-27 16:52:35 +00:00
root
4168c1dd88 refactor: SQLite→PostgreSQL migration - db.py连接层 + main/collector/signal-engine/backfill全部改PG
Phase 1: 核心数据表(agg_trades/rate_snapshots/signal*)迁PG
auth.py暂保留SQLite(低频,不影响性能)
- db.py: psycopg2同步池 + asyncpg异步池 + PG schema + 分区管理
- main.py: 全部改asyncpg查询
- collector: psycopg2 + execute_values批量写入
- signal-engine: psycopg2同步读写
- backfill: psycopg2 + ON CONFLICT DO NOTHING
2026-02-27 16:15:16 +00:00
root
547f093352 feat: V5 signal-engine + API endpoints for indicators/latest/trades 2026-02-27 15:31:12 +00:00
root
bb187167bb feat: add LiveTradesCard - real-time agg trades display + /api/trades/latest endpoint 2026-02-27 11:35:55 +00:00
root
7e38b24fa8 feat: V3.0 aggTrades collector - WS+REST补洞+巡检+按月分表+查询API 2026-02-27 11:29:16 +00:00
root
1ab228286c feat: V2.0 auth system - JWT access/refresh, invite codes, route protection, admin CLI, auth gate blur overlay 2026-02-27 11:08:57 +00:00
root
11667d4faa feat: add YTD annualized rate to RateCard 2026-02-27 10:08:22 +00:00
root
362c1f1e16 fix: add /api/signals/history endpoint 2026-02-27 08:54:13 +00:00
root
32e9dd3531 feat: rate kline unit x10000 (bps), default interval 1h 2026-02-27 07:56:07 +00:00
root
80c4ea67e7 fix: add background snapshot loop - collect every 2s regardless of frontend 2026-02-27 07:04:41 +00:00
root
072592145f feat: kline page with lightweight-charts + /api/kline OHLC aggregation endpoint 2026-02-27 06:36:19 +00:00
root
8efa6ede32 feat: rate_snapshots 2s persistent storage + /live realtime chart page 2026-02-27 05:47:26 +00:00
root
03218dce04 fix: split rate/stats refresh intervals, rates 2s stats 2min 2026-02-26 13:57:39 +00:00
root
42e329cc55 fix: add cache to prevent Binance rate limit (rates 3s, history/stats 60s) 2026-02-26 13:54:59 +00:00
root
44e07eabb2 feat: arbitrage engine Phase 0 scaffold - FastAPI + Next.js 2026-02-26 12:06:10 +00:00