config: lower threshold 0.10->0.05, arb 0.03->0.02, amount 0->0
This commit is contained in:
+3
-3
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"test_mode": false,
|
||||
"trade_enabled": true,
|
||||
"arb_threshold": 0.03,
|
||||
"arb_threshold": 0.02,
|
||||
"scan_interval_ms": 200,
|
||||
"trade_threshold": 0.10,
|
||||
"trade_amount_usd": 10,
|
||||
"trade_threshold": 0.05,
|
||||
"trade_amount_usd": 20,
|
||||
"trade_cooldown_ms": 30000,
|
||||
"alert_cooldown_sec": 300,
|
||||
"mock_slippage_pct": 0.05,
|
||||
|
||||
@@ -121,9 +121,11 @@ func (h *HyperLiquidTrade) PlaceMarketOrder(coin, side, sz string) (string, erro
|
||||
return string(respJSON), nil
|
||||
}
|
||||
|
||||
// GetTradeFee parses the MarketOpen JSON response to extract filled size and
|
||||
// estimates the actual fee from the exchange taker rate.
|
||||
func (h *HyperLiquidTrade) GetTradeFee(orderResponseJSON string, takerFeePct float64) (feeUSD float64, err error) {
|
||||
// EstimateFeeFromResponse calculates the fee using the response's filled size × price
|
||||
// × configured taker rate. This is NOT an actual fee from HL — HL does not return
|
||||
// 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 {
|
||||
Statuses []struct {
|
||||
Filled *struct {
|
||||
|
||||
@@ -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)
|
||||
|
||||
// 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 {
|
||||
log.Printf("[Fee] HL GetTradeFee warning: %v", fetchErr)
|
||||
log.Printf("[Fee] HL EstimateFeeFromResponse warning: %v", fetchErr)
|
||||
} else {
|
||||
log.Printf("[Fee] HL %s %s: actual fee=$%.6f", side, leg.Coin, fee)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user