Commit Graph

6 Commits

Author SHA1 Message Date
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 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 94a11e8d68 add margin
Build Docker Image / build (amd64) (push) Successful in 1m47s
2024-10-24 10:58:32 +07:00
thuanle 92a63c7885 init code 2024-10-24 09:53:23 +07:00