fix: full arb table + net profit columns in price view

- ArbTable: removed slice(0,10) cap, shows all 42 opps (21x2)
- PriceTable: added net_bg_to_hl and net_hl_to_bg columns
- Backend SSE: sends net profit for both directions per coin
This commit is contained in:
jackyu66git
2026-05-04 18:26:49 +08:00
parent 9628100681
commit 0aa9923067
14 changed files with 45090 additions and 15 deletions
+2
View File
@@ -555,11 +555,13 @@ func (t *Trader) executeEntry(opp *ArbOpportunity, store *PriceStore, notifier *
// Execute both legs
if err := t.placeOrder(pos.LongLeg, "buy", store); err != "" {
log.Printf("[Trader] %s: long leg placeOrder failed: %s", opp.Coin, err)
t.cleanup(pos.Coin)
return false
}
time.Sleep(t.cfg.LegDelay)
if err := t.placeOrder(pos.ShortLeg, "sell", store); err != "" {
log.Printf("[Trader] %s: short leg placeOrder failed: %s", opp.Coin, err)
// Leg1 placed successfully, leg2 failed — try to close leg1
pos.Status = "failed"
if closeErr := t.closeLeg(pos.LongLeg); closeErr != "" {