fix: resolve shared symbol mapping for token command (#22)
Build Docker Image / build (amd64) (push) Successful in 1m36s
Build Docker Image / build (amd64) (push) Successful in 1m36s
Co-authored-by: thuanle <tl@thuanle.me> Co-committed-by: thuanle <tl@thuanle.me>
This commit was merged in pull request #22.
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"gopkg.in/telebot.v3"
|
||||
"me.thuanle/bbot/internal/configs/tele"
|
||||
"me.thuanle/bbot/internal/data"
|
||||
"me.thuanle/bbot/internal/helper/binancex"
|
||||
"me.thuanle/bbot/internal/services/tele/chat"
|
||||
"me.thuanle/bbot/internal/services/tele/view"
|
||||
)
|
||||
@@ -75,21 +76,23 @@ func collectRichTokenData(token string) buildRichTokenMessageArgs {
|
||||
}
|
||||
}
|
||||
|
||||
futureSymbol := token + "USDT"
|
||||
if data.Market.IsFuturesPair(futureSymbol) {
|
||||
futureSymbols := binancex.Token2FutureSymbols(token)
|
||||
for _, futureSymbol := range futureSymbols {
|
||||
if fp, fr, ft, ok := data.Market.GetFuturePrice(futureSymbol); ok {
|
||||
a.HasFuture = true
|
||||
a.FuturePrice = fp
|
||||
a.FundingRate = fr
|
||||
a.FundingTimeMs = ft
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
spotSymbol := token + "USDT"
|
||||
if data.Market.IsSpotPair(spotSymbol) {
|
||||
spotSymbols := binancex.Token2SpotSymbols(token)
|
||||
for _, spotSymbol := range spotSymbols {
|
||||
if sp, ok := data.Market.GetSpotPrice(spotSymbol); ok {
|
||||
a.HasSpot = true
|
||||
a.SpotPrice = sp
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user