From 2f4d03f9b1e278cdedfe33ce762e6377ef6a5fa5 Mon Sep 17 00:00:00 2001 From: jackyu66git Date: Mon, 4 May 2026 06:10:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=20=E5=85=B1=E7=94=A8?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=20store.GetAll()=20=E5=BF=AB=E7=85=A7?= =?UTF-8?q?=EF=BC=8C=E6=B6=88=E9=99=A4=E6=AF=8F=20tick=20=E4=B8=A4?= =?UTF-8?q?=E6=AC=A1=20map=20=E5=88=86=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 4 ++-- scanner.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 9b8831b..f5cc8a9 100644 --- a/main.go +++ b/main.go @@ -179,12 +179,12 @@ func main() { t1 := time.Now() // Scan for arbitrage entries using maker fees (limit orders) - makerOpps := ScanBGHL(store) + snap := store.GetAll() + makerOpps := ScanBGHL(snap) dashboard.UpdateScan(makerOpps) t2 := time.Now() // Track spread window durations (how long each opportunity stays alive) - snap := store.GetAll() spreadTracker.Tick(snap, cfg.TradeThreshold) for _, opp := range makerOpps { diff --git a/scanner.go b/scanner.go index e99f0bb..c2e48d6 100644 --- a/scanner.go +++ b/scanner.go @@ -208,12 +208,11 @@ func netProfit(buyPrice, sellPrice, buyFee, sellFee float64) float64 { // ScanBGHL scans coins for arbitrage ONLY between Bitget and HyperLiquid (P3-1). // Returns both directions (BG->HL and HL->BG) sorted by net profit descending. -func ScanBGHL(store *PriceStore) []*ArbOpportunity { - snapshot := store.GetAll() +func ScanBGHL(snap map[string]map[string]float64) []*ArbOpportunity { var results []*ArbOpportunity for _, coin := range TrackedCoins { - exMap := snapshot[coin.Name] + exMap := snap[coin.Name] if exMap == nil { continue }