From 327f2505dd9c0ec0757e35cfde380d514e43aa4d Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Sun, 3 May 2026 21:14:49 +0800 Subject: [PATCH] sync README: update arch diagram and structure for stats separation --- README.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9a3369a..794c1ce 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,16 @@ PriceStore ─────────┼───────────── └──────────────┘ │ ┌─────────▼─────────┐ - │ ScanBGHL (500ms) │ + │ ScanBGHL (200ms) │ │ BG ↔ HL only │ └─────────┬─────────┘ │ ┌───────────────▼────────────────┐ - │ Trader: TryEntry / Tick / Exit │ - │ Maker fees, scale-in, stop │ + │ Trader (trading logic only) │ + │ TryEntry / Tick / Exit │ + │ Maker fees, scale-in, stop │ │ Synchronous entry (no goroutine)│ + │ NO display/stat calculations │ └───────────────┬────────────────┘ │ ┌─────────▼─────────┐ @@ -34,10 +36,14 @@ PriceStore ─────────┼───────────── │ (opportunity life) │ └─────────┬─────────┘ │ - ┌─────────▼─────────┐ - │ Notifier: TG │ - │ Dashboard: :8888 │ - └───────────────────┘ + ┌──────────────────┼──────────────────┐ + │ │ │ + ┌─────▼─────┐ ┌────────▼───────┐ ┌─────▼─────┐ + │ Notifier │ │ Dashboard │ │ DB │ + │ TG │ │ :8888 │ │ SQLite │ + │ │ │ Stats calc │ │ trades.db │ + │ │ │ (calcDetailed) │ │ │ + └───────────┘ └────────────────┘ └───────────┘ ``` ## Tracked Coins @@ -173,11 +179,11 @@ Built-in HTTP server at `:8888` with real-time SSE push (1-second refresh): ``` exchange-monitor-go/ ├── main.go # Entry point, WS startup, main loop -├── config.go # .env configuration loader +├── config.go # .env + config.json hierarchical config ├── types.go # PriceStore, TrackedCoin, ArbOpportunity ├── scanner.go # ScanBGHL — arbitrage scanner -├── trader.go # Position management, entry/exit/scale-in -├── dashboard.go # Web server + SSE + history buffers +├── trader.go # Position management, entry/exit/scale-in (pure trading logic) +├── dashboard.go # Web server + SSE + stats calc (display layer) ├── toaster.go # Telegram notifications ├── static.go # Embedded web static files ├── start.sh # Startup script (port check + build + run)