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
+12
View File
@@ -356,6 +356,18 @@ func (d *Dashboard) broadcastLoop() {
spreadPct := (hlP - bgP) / bgP * 100
entry["bg_hl_spread"] = spreadPct
d.spreads.Record(coin.Name, spreadPct)
// Both directions net profit after fees (4 taker fees: 2 entry + 2 exit)
cost := bgP * (1 + takerFees[ExBitget]/100)
revenue := hlP * (1 - takerFees[ExHyperLiquid]/100)
netBG := (revenue/cost-1)*100 - 2*(takerFees[ExBitget]+takerFees[ExHyperLiquid])
cost = hlP * (1 + takerFees[ExHyperLiquid]/100)
revenue = bgP * (1 - takerFees[ExBitget]/100)
netHL := (revenue/cost-1)*100 - 2*(takerFees[ExHyperLiquid]+takerFees[ExBitget])
entry["net_bg_to_hl"] = math.Round(netBG*10000) / 10000
entry["net_hl_to_bg"] = math.Round(netHL*10000) / 10000
}
prices = append(prices, entry)