feat: add 17 new cross-exchange pairs (BG↔HL)

Added: ALGO, PYTH, SAND, ADA, HBAR, IOTA, MINA, FET, WLD,
       SUI, APT, NEAR, FIL, DYDX, JUP, TIA, MOVE

Removed: pixel and VET (fake 195% spreads on testnet)

Also updated GetHLSize() to handle szDecimals for all new coins.
This commit is contained in:
jackyu66git
2026-05-04 18:05:53 +08:00
parent dd26152c2b
commit 5f6578c179
8 changed files with 45092 additions and 17 deletions
+19 -17
View File
@@ -147,26 +147,28 @@ func (h *HyperLiquidTrade) GetBalance() (float64, error) {
func GetHLSize(coin string, amountUSD, price float64) string {
sz := amountUSD / price
switch coin {
case "DOGE":
// integer sizes (szDecimals=0)
case "DOGE", "ONDO", "WIF", "ALGO", "PYTH", "SAND", "ADA", "HBAR",
"IOTA", "MINA", "FET", "JUP", "MOVE":
sz = math.Floor(sz)
if sz < 1 { sz = 1 }
if sz < 1 {
sz = 1
}
return fmt.Sprintf("%.0f", sz)
case "ONDO":
sz = math.Floor(sz)
if sz < 1 { sz = 1 }
return fmt.Sprintf("%.0f", sz)
case "OP":
sz = math.Floor(sz*10)/10
if sz < 0.1 { sz = 0.1 }
return fmt.Sprintf("%.1f", sz)
case "WIF":
sz = math.Floor(sz)
if sz < 1 { sz = 1 }
return fmt.Sprintf("%.0f", sz)
case "ARB":
sz = math.Floor(sz*10)/10
if sz < 0.1 { sz = 0.1 }
// 1 decimal (szDecimals=1)
case "OP", "ARB", "DYDX", "WLD", "SUI", "TIA", "NEAR", "FIL":
sz = math.Floor(sz*10) / 10
if sz < 0.1 {
sz = 0.1
}
return fmt.Sprintf("%.1f", sz)
// 2 decimals (szDecimals=2)
case "APT":
sz = math.Floor(sz*100) / 100
if sz < 0.01 {
sz = 0.01
}
return fmt.Sprintf("%.2f", sz)
default:
return fmt.Sprintf("%.4f", sz)
}