diff --git a/lib/common/static/instance_theme.css b/lib/common/static/instance_theme.css index 1adefd7..c7fa1b3 100644 --- a/lib/common/static/instance_theme.css +++ b/lib/common/static/instance_theme.css @@ -3138,6 +3138,15 @@ html[data-theme="light"] .settings-side-export-label { font-variant-numeric: tabular-nums; white-space: nowrap; } +.opt-chain-lev { + font-variant-numeric: tabular-nums; + white-space: nowrap; + font-weight: 600; + color: #b8c8ff; +} +html[data-theme="light"] .opt-chain-lev { + color: #1a4a8a; +} .opt-be-dist-up { color: #5ee89a; } diff --git a/lib/common/static/options_panel.js b/lib/common/static/options_panel.js index 87e3017..089a09f 100644 --- a/lib/common/static/options_panel.js +++ b/lib/common/static/options_panel.js @@ -341,7 +341,7 @@ } function strikeTableColspan() { - return state.chainView === "t" ? 9 : 8; + return 9; } function syncChainViewUI() { @@ -817,6 +817,20 @@ return "约 " + Number(v).toFixed(1) + "×"; } + /** 链上展示:指数 ÷ 卖一(每1币). */ + function calcAskLeverage(indexPx, askPx) { + if (indexPx == null || askPx == null) return null; + const idx = Number(indexPx); + const ask = Number(askPx); + if (!Number.isFinite(idx) || !Number.isFinite(ask) || ask <= 0) return null; + return Math.round((idx / ask) * 10) / 10; + } + + function fmtChainLeverage(v) { + if (v === null || v === undefined || Number.isNaN(Number(v))) return "—"; + return Number(v).toFixed(1) + "×"; + } + function fmtUsdcSigned(v) { if (v === null || v === undefined || Number.isNaN(Number(v))) return "—"; const n = Number(v); @@ -946,16 +960,19 @@ return; } let matchedSelected = false; + const indexPx = state.chain && state.chain.index_px; list.forEach(function (c) { const tr = document.createElement("tr"); tr.className = "opt-strike-row"; tr.setAttribute("data-inst", c.inst_id); if (c.moneyness) tr.classList.add("opt-row-" + c.moneyness); + const chainLev = calcAskLeverage(indexPx, c.ask); tr.innerHTML = "
" + c.inst_id + "