46 Commits

Author SHA1 Message Date
thuanle 0a1a61d8d3 update sticker id
Build Docker Image / build (amd64) (push) Successful in 1m3s
2026-04-27 10:08:37 +07:00
thuanle 617b067203 chore: address review for market filename refactor
Rename pair tests to match post-refactor boundaries and remove unused alpha cache refresh helper.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 09:51:24 +07:00
thuanle f5e2e178e1 refactor: standardize market filenames by data dimension
Split market pair logic into spot and futures files and rename price files to plural data-dimension names without changing behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 07:04:37 +07:00
thuanle d6338fa092 fix: preserve futures token identity in canonical cache
Keep futureToken2Symbol keyed by raw futures token and use explicit spot-to-future alias mapping during resolver fallback lookups.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 04:53:54 +07:00
thuanle 711721c1ee refactor: use canonical token-to-symbol maps for market lookup
Build canonical spot/future token maps with quote priority, unify cache refresh scheduling, and switch resolver/token tests to map-based token lookups.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 04:44:30 +07:00
thuanle 06c40ef30f refactor: separate direct and related spot resolvers
Keep IsToken checks explicit across futures and direct spot symbols, move futures-derived spot mapping to a clearly named helper, and update token data collection to use related spot resolution.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 04:10:06 +07:00
thuanle 0705e909dc fix: recognize spot-only tokens in IsToken
Gate token detection via spot symbol resolution so chat flow accepts spot-only tokens, and add regression coverage for the fallback path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-27 03:59:32 +07:00
thuanle 252e77c000 test binance symbol resolver 2026-04-27 03:46:46 +07:00
thuanle 2c5a9e23bf refactor binance symbol resolver 2026-04-27 03:32:59 +07:00
thuanle 47d07f2092 style: fix gofmt alignment in resolver_test.go stub
Build Docker Image / build (amd64) (push) Successful in 1m3s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-26 21:15:53 +07:00
thuanle 72fdb598af fix: resolve shared symbol mapping for token command (#22)
Build Docker Image / build (amd64) (push) Successful in 1m36s
Co-authored-by: thuanle <tl@thuanle.me>
Co-committed-by: thuanle <tl@thuanle.me>
2026-04-26 21:13:06 +07:00
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 4cab108549 Merge branch 'main' into chore/remove-eth-special-case 2026-04-26 16:45:27 +07:00
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 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
thuanle 97c627e97c trang bức amount
Build Docker Image / build (amd64) (push) Successful in 21s
2025-09-19 10:37:31 +07:00
thuanle 92a11492fb trang bức mode
Build Docker Image / build (amd64) (push) Successful in 21s
2025-09-18 12:59:03 +07:00
thuanle 78f2aca4c5 fix format
Build Docker Image / build (amd64) (push) Successful in 17s
2025-09-12 12:38:35 +07:00
thuanle be46315860 update BacFoy goal
Build Docker Image / build (amd64) (push) Successful in 23s
2025-09-12 12:32:43 +07:00
thuanle a04bbf5bfa update BacFoy
Build Docker Image / build (amd64) (push) Successful in 2m41s
2025-09-12 12:24:20 +07:00
thuanle f9d0f2efc8 BacFoy Delta
Build Docker Image / build (amd64) (push) Successful in 2m34s
2025-08-22 23:21:02 +07:00
thuanle b80620d376 BacFoy Delta
Build Docker Image / build (amd64) (push) Successful in 3m45s
2025-08-22 23:11:56 +07:00
thuanle 76079a42b3 BacFoy Delta
Build Docker Image / build (amd64) (push) Successful in 19s
2025-08-22 23:04:30 +07:00
thuanle a3b2db7666 BacFoy Delta
Build Docker Image / build (amd64) (push) Successful in 2m9s
2025-08-22 22:54:27 +07:00
thuanle b9e6abf4cf add bacfoy eth
Build Docker Image / build (amd64) (push) Successful in 5m28s
2025-08-22 22:06:02 +07:00
thuanle 7228d659a2 add bacfoy eth
Build Docker Image / build (amd64) (push) Successful in 5m48s
2025-08-22 21:55:51 +07:00
thuanle 554254b05e Add symbolSOL to TopPriceSymbols list
Build Docker Image / build (amd64) (push) Successful in 1m37s
2025-07-18 17:37:45 +07:00
thuanle 7cc9ec0f1f Update internal/configs/strategy/market.go
Build Docker Image / build (amd64) (push) Successful in 3m29s
2025-06-25 17:27:56 +07:00
thuanle c70580371c update prefix order
Build Docker Image / build (amd64) (push) Successful in 1m14s
2024-11-11 20:19:00 +07:00
thuanle 8ba7856510 update prefix
Build Docker Image / build (amd64) (push) Successful in 2m44s
2024-11-11 18:56:16 +07:00
thuanle 386bbd83e3 update display
Build Docker Image / build (amd64) (push) Successful in 1m13s
add SOL
2024-10-24 11:11:32 +07:00
thuanle 14b3604362 margin rate as %
Build Docker Image / build (amd64) (push) Successful in 1m13s
2024-10-24 11:08:17 +07:00
thuanle 94a11e8d68 add margin
Build Docker Image / build (amd64) (push) Successful in 1m47s
2024-10-24 10:58:32 +07:00
thuanle b60fcb842d CI
Build Docker Image / build (amd64) (push) Successful in 1m40s
2024-10-24 10:05:04 +07:00
thuanle 92a63c7885 init code 2024-10-24 09:53:23 +07:00
thuanle a7559b3f9d init code 2024-10-24 09:53:02 +07:00