From c04d8ca0da10307f10a5b71d7b8ede58b62e49ba Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Mon, 4 May 2026 22:52:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=20&&=20=E6=B8=85=E7=90=86=E5=BA=9F=E5=BC=83?= =?UTF-8?q?=E7=9A=84=20GetHLSize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exchange/hyperliquid_trade.go | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/exchange/hyperliquid_trade.go b/exchange/hyperliquid_trade.go index 7766ce5..837beb5 100644 --- a/exchange/hyperliquid_trade.go +++ b/exchange/hyperliquid_trade.go @@ -126,11 +126,11 @@ func (h *HyperLiquidTrade) GetSize(coin string, amountUSD, price float64) string } } -// PlaceMarketOrder places a market order and returns the raw JSON response. func (h *HyperLiquidTrade) IsConfigured() bool { return h.configured } +// PlaceMarketOrder places a market order and returns the raw JSON response. func (h *HyperLiquidTrade) PlaceMarketOrder(coin, side, sz string) (string, error) { if !h.configured { return "", fmt.Errorf("HL not configured") @@ -219,33 +219,3 @@ func (h *HyperLiquidTrade) GetBalance() (float64, error) { } return 0, fmt.Errorf("USDC balance not found in spot state") } - -func GetHLSize(coin string, amountUSD, price float64) string { - sz := amountUSD / price - switch coin { - // integer sizes (szDecimals=0) - case "DOGE", "ONDO", "WIF", "ALGO", "PYTH", "SAND", "ADA", "HBAR", - "IOTA", "FET", "JUP", "MOVE": - sz = math.Floor(sz) - if sz < 1 { - sz = 1 - } - return fmt.Sprintf("%.0f", sz) - // 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) - } -}