revert期权历史仍按币展示盈亏,U 口径只用于统计结算。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-08 23:58:02 +08:00
parent 70ebfb10e8
commit e0e2a94322
3 changed files with 9 additions and 25 deletions
+4 -7
View File
@@ -2833,15 +2833,12 @@
list.forEach(function (h) {
const tr = document.createElement("tr");
const premCcy = posPremiumCcy(h);
const premUnit = premCcy === "USDC" || premCcy === "USDT" ? "U" : premCcy;
// 模拟盘盈亏已折 U 时用 pnl_display_ccy,勿再标 BTC
const pnlCcy = String(h.pnl_display_ccy || premCcy).toUpperCase();
const pnlUnit = pnlCcy === "USDC" || pnlCcy === "USDT" ? "U" : pnlCcy;
const unit = premCcy === "USDC" ? "U" : premCcy;
const premCore = fmtDisplay(
h.premium_paid_fmt,
h.premium_paid != null ? fmtPremiumAmt(h.premium_paid, premCcy) : null
);
const premTxt = premCore === "—" ? "—" : premCore + " " + premUnit;
const premTxt = premCore === "—" ? "—" : premCore + " " + unit;
const isOpen = h.status === "open";
const pnl = isOpen ? null : h.realized_pnl;
let pnlTxt = "—";
@@ -2849,9 +2846,9 @@
const n = Number(pnl);
const absCore = fmtDisplay(
null,
pnlUnit === "U" ? fmt(Math.abs(n), 2) : fmtPremiumAmt(Math.abs(n), pnlCcy)
fmtPremiumAmt(Math.abs(n), premCcy)
);
pnlTxt = (n > 0 ? "+" : n < 0 ? "-" : "") + absCore + " " + pnlUnit;
pnlTxt = (n > 0 ? "+" : n < 0 ? "-" : "") + absCore + " " + unit;
}
const pnlCls = pnl > 0 ? "pos-pnl-profit" : pnl < 0 ? "pos-pnl-loss" : "";
const timeTxt = (h.closed_at || h.created_at || "—").replace("T", " ").slice(0, 19);