From 076480d05dd83a9e16dc603ea108db0d590fcbca Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Mon, 16 Mar 2026 14:51:58 -0700 Subject: [PATCH] Fix: normalize live trade PnL cents/dollars --- app/dash/page.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/dash/page.js b/app/dash/page.js index f7e8cb0..5320fab 100644 --- a/app/dash/page.js +++ b/app/dash/page.js @@ -296,7 +296,12 @@ function MarketCard({ market }) { function LiveOrderRow({ order, isOpen }) { const won = order.result && order.side?.toLowerCase() === order.result?.toLowerCase(); const isNeutral = order.result === 'cancelled' || order.result === 'expired'; - const pnlVal = order.pnl != null ? (typeof order.pnl === 'number' && Math.abs(order.pnl) > 50 ? order.pnl / 100 : order.pnl) : null; + + const rawPnl = order?.pnl != null ? Number(order.pnl) : null; + const pnlVal = Number.isFinite(rawPnl) + ? (Number.isInteger(rawPnl) ? rawPnl / 100 : rawPnl) + : null; + const pnlColor = pnlVal == null ? 'text-gray-600' : pnlVal > 0 ? 'text-green-400' : pnlVal < 0 ? 'text-red-400' : 'text-gray-400'; return (