Token collector bypasses existing spot/future symbol resolution rules #21
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The new independent token source collector in
internal/services/tele/commands/token.gonow hardcodes both market probes to<TOKEN>USDT.Scope of this issue
This issue is only about spot/future symbol resolution behavior. It is separate from Alpha lookup behavior.
Problem
The repo already has existing symbol-resolution rules for non-trivial contracts:
1000and1MUSDCLUNA2USDT -> LUNAUSDTThose rules are implemented in the existing helper flow (
Token2Symbols(...)andFuture2SpotSymbol(...)), but the new collector bypasses them by probing only:futureSymbol := token + "USDT"spotSymbol := token + "USDT"Impact
Supported tokens with prefixes, aliases, or explicit future->spot mappings can lose future data, spot data, or both when rendered through the independent collector.
Example
LUNA2USDTis mapped to spotLUNAUSDTin existing config, but the new collector probes spot asLUNA2USDT, which can miss the intended spot pair.Suggested direction
Keep Alpha lookup logic separate, but restore spot/future resolution through the existing symbol-resolution rules instead of assuming
<TOKEN>USDTfor both markets.Context
This is a follow-up issue extracted from PR #19 review so spot/future resolution can be handled independently from Alpha lookup changes.
[claudecode gpt-5.3-codex]
Ý kiến
Mình đồng ý với issue này: hiện tại
collectRichTokenDatađang assumetoken+USDTcho cả spot/future nên có thể làm rơi các case mapping đặc biệt.Vì sao đáng sửa
LUNA2USDT -> LUNAUSDT).Đề xuất implementation
Token2Symbols+Future2SpotSymbol) thay vì hardcode<TOKEN>USDT.Test nên thêm
LUNA2USDT -> LUNAUSDT.1000*,1M*) vẫn trả đúng spot/future.Legacy Issue: Một số Token sẽ có symbol khác nhau cho Spot và Future, và có thể alpha
Ví dụ
[claudecode gpt-5.3-codex]
Scope alignment
Chốt lại scope theo định hướng mới:
Direction for fix in #21
<TOKEN>USDTtrong collector bằng luồng resolver Spot/Future hiện có (Token2Symbols+Future2SpotSymbol).Regression coverage
LUNA2USDT -> LUNAUSDT1000*,1M*(và biến thể liên quan)spot-only,future fail but spot exists.[claudecode gpt-5.3-codex]
Kế hoạch xử lý (chưa implement)
Mình đã viết plan đầy đủ theo hướng mới: không reuse trực tiếp 2 helper cũ ở command, thay vào đó tạo shared resolver:
TokenToFutureSymbols(token)TokenToSpotSymbols(token)Giữ nguyên tư tưởng:
Plan file
docs/superpowers/plans/2026-04-26-issue-21-shared-symbol-resolver.mdNội dung chính
collectRichTokenDatago test ./...vàgo build ./...Nếu bạn ok, bước tiếp theo mới bắt đầu implement theo plan này.