diff --git a/lib/instance/templates/embed_boot_scripts.html b/lib/instance/templates/embed_boot_scripts.html index af49498..f1d651e 100644 --- a/lib/instance/templates/embed_boot_scripts.html +++ b/lib/instance/templates/embed_boot_scripts.html @@ -1304,16 +1304,8 @@ function applyAccountSnapshot(data){ setFundsFieldText("options-trading-usdc", optTrading); } if(typeof data.unrealized_pnl !== "undefined" || typeof data.options_unrealized_pnl !== "undefined"){ - const coinMode = String(data.options_margin_mode || "").toLowerCase() === "coin"; - if (coinMode && data.options_unrealized_pnl != null && !Number.isNaN(Number(data.options_unrealized_pnl))) { - paintRealtimePnl( - data.options_unrealized_pnl, - String(data.options_underly || "ETH").toUpperCase() || "ETH", - data.options_index_px - ); - } else if (typeof data.unrealized_pnl !== "undefined") { - updateRealtimePnl(data.unrealized_pnl, "U"); - } + // 与 order_prices 轮询共用:options_unrealized_pnl 已是 U,勿再按 ETH×指数(否则顶栏会在正确/上万之间闪烁) + paintRealtimePnlFromSnapshot(data); } if(typeof data.total !== "undefined" && data.total !== null){ setFundsFieldText("stat-total", String(data.total)); diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index 6675cd6..4ba8631 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -1785,17 +1785,8 @@ function applyAccountSnapshot(data){ setFundsFieldText("options-trading-usdc", optTrading); } if(typeof data.unrealized_pnl !== "undefined" || typeof data.options_unrealized_pnl !== "undefined"){ - const coinMode = String(data.options_margin_mode || "").toLowerCase() === "coin"; - if (coinMode && data.options_unrealized_pnl != null && !Number.isNaN(Number(data.options_unrealized_pnl))) { - // 币本位:顶栏跟持仓卡同口径(期权净盈亏),勿用混加后的 unrealized_pnl(会被抹成 0.00) - paintRealtimePnl( - data.options_unrealized_pnl, - String(data.options_underly || "ETH").toUpperCase() || "ETH", - data.options_index_px - ); - } else if (typeof data.unrealized_pnl !== "undefined") { - updateRealtimePnl(data.unrealized_pnl, "U"); - } + // 与 order_prices 轮询共用:options_unrealized_pnl 已是 U,勿再按 ETH×指数(否则顶栏会在正确/上万之间闪烁) + paintRealtimePnlFromSnapshot(data); } if(typeof data.total !== "undefined" && data.total !== null){ setFundsFieldText("stat-total", String(data.total));