diff --git a/dashboard.go b/dashboard.go index c729cf5..2434cc0 100644 --- a/dashboard.go +++ b/dashboard.go @@ -323,6 +323,10 @@ func (d *Dashboard) broadcastLoop() { netPnl := longPnl + shortPnl - totalFees currentSpread := (hlP - bgP) / bgP * 100 + if pos.LongLeg.Exchange == ExHyperLiquid { + // HL→BG: spread positive when bgP > hlP + currentSpread = (bgP - hlP) / hlP * 100 + } posEntry["current_spread"] = math.Round(currentSpread*10000) / 10000 posEntry["pnl_est"] = math.Round(netPnl*10000) / 10000 } diff --git a/web/static/app.js b/web/static/app.js index 3669520..9f835f6 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -603,6 +603,10 @@ document.addEventListener('keydown', function(e) { if (e.key === 'Escape') closeTradeDetail(); }); +// Expose modal functions to global scope for HTML onclick handlers +window.openTradeDetail = openTradeDetail; +window.closeTradeDetail = closeTradeDetail; + // ---- Init ---- function init() { connectSSE(); diff --git a/web/static/style.css b/web/static/style.css index e511731..638fb94 100644 --- a/web/static/style.css +++ b/web/static/style.css @@ -126,6 +126,7 @@ td { white-space: nowrap; } tr:hover td { background: rgba(88, 166, 255, 0.05); } +.trade-row { cursor: pointer; } .loading { text-align: center; color: var(--text-dim); padding: 20px !important; } .text-green { color: var(--green); }