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.strike + "" + "" + moneynessBadge(c) + "" + "" + c.inst_id + "" + "" + fmtPxSz(c.ask, c.ask_sz, c.ask_estimated) + "" + + '' + fmtChainLeverage(chainLev) + "" + "" + fmtPxSz(c.bid, c.bid_sz) + "" + "" + (c.expiry_be_px != null ? fmt(c.expiry_be_px, 0) : "—") + "" + '' + fmtDist(c.dist_expiry_be) + "" + diff --git a/lib/instance/templates/embed_shell.html b/lib/instance/templates/embed_shell.html index 8d8ab11..b25fa33 100644 --- a/lib/instance/templates/embed_shell.html +++ b/lib/instance/templates/embed_shell.html @@ -8,7 +8,7 @@ - + {{ pwa_app_name }} diff --git a/lib/instance/templates/index.html b/lib/instance/templates/index.html index 09d5ed2..1858cb3 100644 --- a/lib/instance/templates/index.html +++ b/lib/instance/templates/index.html @@ -18,7 +18,7 @@ {{ pwa_app_name }} - + 类型 合约 卖一/张 + 杠杆 买一/张 到期平衡 距平衡 @@ -80,7 +81,7 @@ - 请选择到期日 + 请选择到期日 @@ -323,4 +324,4 @@ - +