Commit Graph
17 Commits
Author SHA1 Message Date
thuanleandClaude Opus 4.7 82b0f2f1a8 feat: fetch alpha price by symbol ticker
Keep alpha token existence from list cache and fetch live alpha price via symbol ticker endpoint for richer token response accuracy.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 18:22:48 +07:00
thuanleandClaude Opus 4.7 6e8a2e8f68 fix: decouple token spot/future/alpha lookups
Collect token market data independently for spot, futures, and alpha so any available source can be rendered even if others fail.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 18:13:13 +07:00
thuanleandClaude Opus 4.7 194a235065 docs: document required environment variables
Build Docker Image / build (amd64) (push) Successful in 59s
Expand README with env setup, required TELEGRAM_TOKEN,
optional LOG_ENV and ADMIN_CHAT_ID, plus run notes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:50:41 +07:00
thuanleandClaude Opus 4.7 95e9217ef4 fix: render basis with explicit sign and absolute delta
Format basis row as +/-$abs(delta) to match the spec and avoid
awkward %+s formatting behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:39:57 +07:00
thuanleandClaude Opus 4.7 88de029e14 feat: unify token message composition across sources
Remove alpha-first early return and build one rich message from all
available sources (spot/future/alpha) with conditional rows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:19:59 +07:00
thuanleandClaude Opus 4.7 2f875032f6 feat: add rich token message renderer with conditional rows
Introduce unified rich token message rendering with fixed row order
and conditional visibility based on available sources.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:18:34 +07:00
thuanleandClaude Opus 4.7 b376eba674 Ignore local worktree directory
Add .worktrees to gitignore to prevent worktree contents from being
tracked in the repository.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:14:52 +07:00
thuanleandClaude Opus 4.7 e565503f24 Add rich token message design spec
Document unified Telegram token message format that includes
all available sources (spot/future/alpha) with conditional rows.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 17:09:23 +07:00
thuanleandClaude Opus 4.7 914beea5ce Address PR #15 round 2: fail-closed admin guard, sync init, error reporting
1. /refresh now fail-closed: rejects all if ADMIN_CHAT_ID unset or invalid
2. Initial pair cache fill is synchronous — bot waits before accepting queries
3. /refresh reports failure when API fetch fails instead of always saying success

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 16:03:22 +07:00
thuanleandClaude Opus 4.7 c7128ff516 Address PR #15 review: batch API calls and admin-guard /refresh
1. Add GetAllPremiumIndex() to fetch all futures data in one call,
   used by GetTopPrices instead of per-symbol sequential calls.
2. Add ADMIN_CHAT_ID env check to /refresh command to restrict
   access to authorized users only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 15:40:00 +07:00
thuanleandClaude Opus 4.7 59da49c17f Remove ETH special portfolio tracking
Treat ETH like any other token — display only spot/future price
and funding rate, removing personal portfolio calculations.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 15:14:39 +07:00
thuanleandClaude Opus 4.7 9c39423315 Rewrite price lookup from WebSocket to REST API
Replace unreliable WebSocket connections with on-demand REST API calls
for spot and futures prices. Add cached trading pair list (refreshed
hourly) for symbol validation, and /refresh command for manual updates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 15:14:09 +07:00
thuanleandClaude Opus 4.7 c5c1cdf0d5 Add hourly Alpha token cache refresh
Build Docker Image / build (amd64) (push) Successful in 58s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 01:58:50 +07:00
thuanleandClaude Opus 4.7 ced55e5f16 Add dedicated Alpha token price display with 24h change
Build Docker Image / build (amd64) (push) Successful in 1m31s
Alpha tokens now show a simplified format with price and 24h change
instead of the regular token format with empty futures/funding data.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 01:51:56 +07:00
thuanleandClaude Opus 4.7 a5ff76fc96 Update dependencies: go-binance v2.8.11, lo v1.53.0, x/text v0.36.0, telebot v3.3.8
Build Docker Image / build (amd64) (push) Successful in 5m21s
Also update Dockerfile to golang:1.26 and go directive to 1.25.0.
Supersedes all pending renovate PR branches.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 01:27:12 +07:00
thuanleandClaude Opus 4.7 87e69ec8d0 Remove Alpha token price caching in spotPrice map
Build Docker Image / build (amd64) (push) Successful in 2m21s
Alpha token prices are now looked up directly from Alpha data instead
of being cached into spotPrice. Remove unused ensureAlphaCacheLoaded
and shouldRefreshAlphaCache functions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 01:14:40 +07:00
thuanleandClaude Opus 4.7 440fa3bacd Fix concurrent map read/write race condition in MarketData
Add sync.RWMutex to protect future and spot price maps accessed by
WebSocket handlers (writers) and Telegram bot handlers (readers).
Also adds Alpha token support with caching.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-25 00:15:22 +07:00