Improve hedge-plan option board: moneyness, px/sz, accounts, and denser UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-14 12:27:09 +08:00
parent 4df2cb4253
commit 09cd680e4a
6 changed files with 333 additions and 69 deletions
+25 -16
View File
@@ -23,13 +23,14 @@
<button type="button" class="hp-tab" role="tab" aria-selected="false" data-tab="stats">统计分析</button>
</div>
<p class="muted" id="hp-gate-line"></p>
<p class="muted hp-acct-hint" id="hp-acct-hint">永续腿→合约账户 · 期权腿→期权账户</p>
</div>
<div id="hp-tab-perp_options" class="hp-tab-panel" role="tabpanel">
<div class="options-dual-grid" id="hp-po-layout">
<div class="card">
<h2>永续(列表行情)</h2>
<div class="form-row">
<h2>永续 · <span id="hp-perp-uly-label">ETH</span> <span class="muted hp-acct-tag" id="hp-perp-acct-tag">合约账户</span></h2>
<div class="form-row hp-uly-row">
<button type="button" class="btn-secondary hp-uly-btn active" data-uly="ETH">ETH</button>
<button type="button" class="btn-secondary hp-uly-btn" data-uly="BTC">BTC</button>
<select id="hp-direction">
@@ -37,7 +38,7 @@
<option value="short">做空</option>
</select>
</div>
<div id="hp-perp-quote" class="muted" style="margin:8px 0;line-height:1.6">加载中…</div>
<div id="hp-perp-quote" class="muted hp-quote-line">加载中…</div>
<div class="form-row" style="flex-wrap:wrap">
<label>开仓价 <input type="number" step="any" id="hp-entry" /></label>
<label>止盈 <input type="number" step="any" id="hp-tp" /></label>
@@ -47,20 +48,27 @@
<p class="muted" id="hp-sizing-line"></p>
</div>
<div class="card">
<h2>期权(列表) · <span id="hp-opt-type-label">Put</span></h2>
<h2>期权(列表) · <span id="hp-opt-type-label">Put</span> <span class="muted hp-acct-tag" id="hp-opt-acct-tag">期权账户</span></h2>
<div class="form-row">
<select id="hp-exp-select"><option value="">选择到期日</option></select>
<button type="button" class="btn-secondary" id="hp-load-chain">刷新链</button>
</div>
<div id="hp-index-line" class="muted"></div>
<div class="form-row hp-money-row">
<button type="button" class="btn-secondary hp-money-btn active" data-money="all">全部</button>
<button type="button" class="btn-secondary hp-money-btn" data-money="itm">实值</button>
<button type="button" class="btn-secondary hp-money-btn" data-money="otm">虚值</button>
<span class="muted hp-money-hint">实值含平值</span>
</div>
<div id="hp-index-line" class="muted hp-quote-line"></div>
<div id="hp-opt-bal-line" class="muted hp-quote-line"></div>
<div class="options-strike-table-wrap">
<table class="options-strike-table" id="hp-strike-table">
<thead>
<tr>
<th>行权价</th>
<th>类型</th>
<th>实虚值</th>
<th>卖一/张</th>
<th>买一</th>
<th>买一/张</th>
<th>操作</th>
</tr>
</thead>
@@ -108,13 +116,14 @@
<div id="hp-tab-options_options" class="hp-tab-panel hidden" role="tabpanel" hidden>
<div class="options-dual-grid" id="hp-oo-layout">
<div class="card">
<h2>期期参数</h2>
<div class="form-row">
<h2>期期参数 · <span id="hp-oo-uly-label">ETH</span> <span class="muted hp-acct-tag">期权账户</span></h2>
<div class="form-row hp-uly-row">
<button type="button" class="btn-secondary hp-uly-btn-oo active" data-uly="ETH">ETH</button>
<button type="button" class="btn-secondary hp-uly-btn-oo" data-uly="BTC">BTC</button>
<label>目标价 S* <input type="number" step="any" id="hp-target" /></label>
</div>
<div id="hp-oo-index" class="muted"></div>
<div id="hp-oo-index" class="muted hp-quote-line"></div>
<div id="hp-oo-bal-line" class="muted hp-quote-line"></div>
<div id="hp-oo-legs" class="muted" style="margin-top:8px;line-height:1.6">尚未选用两腿</div>
</div>
<div class="card">
@@ -127,18 +136,18 @@
<table class="options-strike-table options-strike-table--t" id="hp-oo-table">
<thead>
<tr>
<th colspan="2" class="opt-t-head-call">Call</th>
<th colspan="3" class="opt-t-head-call">Call</th>
<th class="opt-t-head-mid">行权</th>
<th colspan="2" class="opt-t-head-put">Put</th>
<th colspan="3" class="opt-t-head-put">Put</th>
</tr>
<tr>
<th>卖一</th><th>选用</th>
<th>卖一/张</th><th>实虚值</th><th>选用</th>
<th>K</th>
<th>卖一</th><th>选用</th>
<th>实虚值</th><th>卖一/张</th><th>选用</th>
</tr>
</thead>
<tbody id="hp-oo-tbody">
<tr><td colspan="5" class="muted">请刷新期权链</td></tr>
<tr><td colspan="7" class="muted">请刷新期权链</td></tr>
</tbody>
</table>
</div>
@@ -186,4 +195,4 @@
</div>
</div>
</div>
<script src="/static/hedge_plan.js?v=3"></script>
<script src="/static/hedge_plan.js?v=4"></script>