config: lower threshold 0.10->0.05, arb 0.03->0.02, amount 0->0

This commit is contained in:
jackyu66git
2026-05-04 19:31:08 +08:00
parent 19443c132a
commit 6e9b982c66
3 changed files with 10 additions and 8 deletions
+3 -3
View File
@@ -1,10 +1,10 @@
{ {
"test_mode": false, "test_mode": false,
"trade_enabled": true, "trade_enabled": true,
"arb_threshold": 0.03, "arb_threshold": 0.02,
"scan_interval_ms": 200, "scan_interval_ms": 200,
"trade_threshold": 0.10, "trade_threshold": 0.05,
"trade_amount_usd": 10, "trade_amount_usd": 20,
"trade_cooldown_ms": 30000, "trade_cooldown_ms": 30000,
"alert_cooldown_sec": 300, "alert_cooldown_sec": 300,
"mock_slippage_pct": 0.05, "mock_slippage_pct": 0.05,
+5 -3
View File
@@ -121,9 +121,11 @@ func (h *HyperLiquidTrade) PlaceMarketOrder(coin, side, sz string) (string, erro
return string(respJSON), nil return string(respJSON), nil
} }
// GetTradeFee parses the MarketOpen JSON response to extract filled size and // EstimateFeeFromResponse calculates the fee using the response's filled size × price
// estimates the actual fee from the exchange taker rate. // × configured taker rate. This is NOT an actual fee from HL — HL does not return
func (h *HyperLiquidTrade) GetTradeFee(orderResponseJSON string, takerFeePct float64) (feeUSD float64, err error) { // fee amounts in the order response. The result is equivalent to estimating from
// TradeAmountUSD, but more accurate for partial fills since it uses actual filled sz/px.
func (h *HyperLiquidTrade) EstimateFeeFromResponse(orderResponseJSON string, takerFeePct float64) (feeUSD float64, err error) {
var resp struct { var resp struct {
Statuses []struct { Statuses []struct {
Filled *struct { Filled *struct {
+2 -2
View File
@@ -1076,9 +1076,9 @@ func (t *Trader) placeOrder(leg *PositionLeg, side string, store *PriceStore) (s
log.Printf("[ExRes] HL %s %s: size=%s", side, leg.Coin, size) log.Printf("[ExRes] HL %s %s: size=%s", side, leg.Coin, size)
// Estimate fee from filled response (HL doesn't return fee in order response) // Estimate fee from filled response (HL doesn't return fee in order response)
fee, fetchErr := t.hyperliquid.GetTradeFee(resp, takerFees[ExHyperLiquid]) fee, fetchErr := t.hyperliquid.EstimateFeeFromResponse(resp, takerFees[ExHyperLiquid])
if fetchErr != nil { if fetchErr != nil {
log.Printf("[Fee] HL GetTradeFee warning: %v", fetchErr) log.Printf("[Fee] HL EstimateFeeFromResponse warning: %v", fetchErr)
} else { } else {
log.Printf("[Fee] HL %s %s: actual fee=$%.6f", side, leg.Coin, fee) log.Printf("[Fee] HL %s %s: actual fee=$%.6f", side, leg.Coin, fee)
} }