From 277c34c3bd33a5544017412d1959702a0275e0ec Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Sun, 3 May 2026 17:50:42 +0800 Subject: [PATCH] Remove Aevo exchange (retired) - Delete exchange/aevo.go (AevoWS, aevoTickerMsg, aevoTickerData, etc.) - scanner.go: remove ExAevo constant, fee rates, scan pair entries, shortName mapping - main.go: remove aevoSymbols collection loop and TrackedSymbol usage --- exchange/aevo.go | 129 ----------------------------------------------- main.go | 5 -- scanner.go | 10 ---- 3 files changed, 144 deletions(-) delete mode 100644 exchange/aevo.go diff --git a/exchange/aevo.go b/exchange/aevo.go deleted file mode 100644 index a45bcbd..0000000 --- a/exchange/aevo.go +++ /dev/null @@ -1,129 +0,0 @@ -package exchange - -import ( - "encoding/json" - "log" - "time" -) - -// AevoWS connects to Aevo WebSocket for ticker data. -type AevoWS struct { - Conn *PriceConnector - Tracked []TrackedSymbol // coin + instrument name pairs -} - -type TrackedSymbol struct { - Coin string // "BTC" - InstrumentID string // "BTC-PERP" -} - -type aevoTickerMsg struct { - Op string `json:"op"` - Data json.RawMessage `json:"data"` -} - -type aevoTickerData struct { - Timestamp string `json:"timestamp"` - Tickers []aevoInstrument `json:"tickers"` -} - -type aevoInstrument struct { - InstrumentName string `json:"instrument_name"` - Mark *aevoPriceObj `json:"mark,omitempty"` - LastPrice string `json:"last_price,omitempty"` -} - -type aevoPriceObj struct { - Price string `json:"price"` -} - -func NewAevoWS(tracked []TrackedSymbol) *AevoWS { - ae := &AevoWS{ - Tracked: tracked, - Conn: NewPriceConnector("wss://ws.aevo.xyz", "Aevo", 120*time.Second, 30*time.Second), - } - ae.Conn.PingInterval = 45 * time.Second - return ae -} - -// Run connects to Aevo WS and streams ticker data. -func (a *AevoWS) Run(updateFn func(coin string, price, bid, ask float64)) error { - a.Conn.OnConnect = func() { - log.Printf("[Aevo WS] Connected, subscribing to %d tickers", len(a.Tracked)) - - for _, t := range a.Tracked { - sub := map[string]interface{}{ - "op": "subscribe", - "data": []string{"ticker:" + t.Coin}, - } - if err := a.Conn.SendJSON(sub); err != nil { - log.Printf("[Aevo WS] Subscribe %s error: %v", t.InstrumentID, err) - } - } - } - - a.Conn.OnMessage = func(msg []byte) { - var raw map[string]json.RawMessage - if err := json.Unmarshal(msg, &raw); err != nil { - return - } - - // Check for error - if errMsg, hasErr := raw["error"]; hasErr { - var errStr string - json.Unmarshal(errMsg, &errStr) - if errStr != "" { - // Log once, skip errors - return - } - } - - // Parse ticker data - op, hasOp := raw["op"] - if !hasOp { - return - } - var opStr string - if err := json.Unmarshal(op, &opStr); err != nil || opStr != "ticker" { - return - } - - dataRaw, hasData := raw["data"] - if !hasData { - return - } - - var data aevoTickerData - if err := json.Unmarshal(dataRaw, &data); err != nil { - return - } - - for _, ticker := range data.Tickers { - // Find the coin for this instrument - coin := "" - for _, t := range a.Tracked { - if t.InstrumentID == ticker.InstrumentName { - coin = t.Coin - break - } - } - if coin == "" { - continue - } - - // Try mark price first, then last_price - var price float64 - if ticker.Mark != nil && ticker.Mark.Price != "" { - price = parseFloat(ticker.Mark.Price) - } else if ticker.LastPrice != "" { - price = parseFloat(ticker.LastPrice) - } - - if price > 0 { - updateFn(coin, price, 0, 0) // B#7: pass bid=ask=0 for 4-arg signature - } - } - } - - return a.Conn.Run() -} diff --git a/main.go b/main.go index e26b0f1..e129e74 100644 --- a/main.go +++ b/main.go @@ -71,16 +71,11 @@ func main() { // Collect symbols var bnSymbols, bgSymbols, hlSymbols, dydxSymbols []string - var aevoSymbols []exchange.TrackedSymbol for _, c := range TrackedCoins { bnSymbols = append(bnSymbols, c.BN) bgSymbols = append(bgSymbols, c.BG) hlSymbols = append(hlSymbols, c.HL) dydxSymbols = append(dydxSymbols, c.HL) - aevoSymbols = append(aevoSymbols, exchange.TrackedSymbol{ - Coin: c.Name, - InstrumentID: c.Name + "-PERP", - }) } // Start all exchange WS connections diff --git a/scanner.go b/scanner.go index 6102db9..5ca81f2 100644 --- a/scanner.go +++ b/scanner.go @@ -14,7 +14,6 @@ const ( ExHyperLiquid = "HyperLiquid" ExBitget = "Bitget" ExDydx = "dYdX" - ExAevo = "Aevo" ) // Fee rates (%) — taker fees per exchange @@ -23,7 +22,6 @@ var feeRates = map[string]float64{ ExHyperLiquid: 0.035, ExBitget: 0.040, // standard taker ExDydx: 0.050, // dYdX v4 standard taker - ExAevo: 0.050, // Aevo standard taker } // Maker fee rates (%) — for limit orders @@ -32,7 +30,6 @@ var makerFees = map[string]float64{ ExHyperLiquid: 0.015, ExBitget: 0.020, // standard maker ExDydx: 0.020, - ExAevo: 0.020, } // TickerCoins defines all coins we monitor. @@ -67,7 +64,6 @@ func ScanArbWithFees(store *PriceStore, fees map[string]float64) []*ArbOpportuni hlP := exMap[ExHyperLiquid] bgP := exMap[ExBitget] dyP := exMap[ExDydx] - aeP := exMap[ExAevo] var pairs []struct { profit float64 @@ -102,13 +98,9 @@ func ScanArbWithFees(store *PriceStore, fees map[string]float64) []*ArbOpportuni addPair(ExBinance, ExHyperLiquid, bnP, hlP) addPair(ExBinance, ExBitget, bnP, bgP) addPair(ExBinance, ExDydx, bnP, dyP) - addPair(ExBinance, ExAevo, bnP, aeP) addPair(ExHyperLiquid, ExBitget, hlP, bgP) addPair(ExHyperLiquid, ExDydx, hlP, dyP) - addPair(ExHyperLiquid, ExAevo, hlP, aeP) addPair(ExBitget, ExDydx, bgP, dyP) - addPair(ExBitget, ExAevo, bgP, aeP) - addPair(ExDydx, ExAevo, dyP, aeP) if len(pairs) == 0 { continue @@ -163,8 +155,6 @@ func shortName(exchange string) string { return "BG" case ExDydx: return "dYdX" - case ExAevo: - return "Ae" } return "??" }