update display
All checks were successful
Build Docker Image / build (amd64) (push) Successful in 1m13s

add SOL
This commit is contained in:
thuanle
2024-10-24 11:11:32 +07:00
parent 14b3604362
commit 386bbd83e3
2 changed files with 8 additions and 9 deletions

View File

@@ -6,15 +6,14 @@ const (
symbolBNB = "BNBUSDT" symbolBNB = "BNBUSDT"
symbolTON = "TONUSDT" symbolTON = "TONUSDT"
symbolXRP = "XRPUSDT" symbolXRP = "XRPUSDT"
symbolSOL = "SOLUSDT"
) )
var ( var (
TopPriceSymbols = []string{symbolBTC, symbolETH, symbolBNB, symbolTON, symbolXRP} TopPriceSymbols = []string{symbolBTC, symbolETH, symbolBNB, symbolTON, symbolXRP, symbolSOL}
) )
const ( const (
FundRateBuyThreshold = -0.001 FundRateBuyThreshold = -0.001
FundRateSellThreshold = 0.00077 FundRateSellThreshold = 0.00077
LiquidInfPrice = 1000_000_000
) )

View File

@@ -37,13 +37,13 @@ func RenderPrice(price float64) string {
func RenderOnPriceMessage(symbol string, spotPrice float64, futurePrice float64, fundrate float64, fundtime int64, marginRate float64) string { func RenderOnPriceMessage(symbol string, spotPrice float64, futurePrice float64, fundrate float64, fundtime int64, marginRate float64) string {
return fmt.Sprintf( return fmt.Sprintf(
"%s: %s\n"+ "%s\n"+
"Fund rate: %.4f%% %s in %s\n"+ " Spot: %s - Future: %s \n"+
"Spot: %s\n"+ " Fund rate: %.4f%% %s in %s\n"+
"Margin rate: %.3f%%", " Margin rate: %.3f%%",
RenderSymbolInfo(symbol), RenderPrice(futurePrice), RenderSymbolInfo(symbol),
RenderPrice(spotPrice), RenderPrice(futurePrice),
fundrate*100, IconOfFundingFeeDirection(fundrate), timex.CdMinuteStringTime(time.UnixMilli(fundtime)), fundrate*100, IconOfFundingFeeDirection(fundrate), timex.CdMinuteStringTime(time.UnixMilli(fundtime)),
RenderPrice(spotPrice),
marginRate*365*100, marginRate*365*100,
) )
} }