实现OKX单笔期权币本位与USDT桥复利(中控只读,不改Gate)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -123,9 +123,16 @@ def _format_options_position_detail_line(p: dict) -> str:
|
||||
if sheets is None:
|
||||
sheets = "?"
|
||||
parts = [f"期权 {inst} {label}", f"来源{src}", f"张数{sheets}"]
|
||||
mode_lab = p.get("margin_mode_label") or ("币本位" if p.get("margin_mode") == "coin" else "")
|
||||
if mode_lab:
|
||||
parts.append(f"本位{mode_lab}")
|
||||
paid = _safe_float(p.get("premium_paid"))
|
||||
if paid is not None:
|
||||
parts.append(f"权利金{paid:g}U")
|
||||
ccy = p.get("premium_ccy") or ("ETH" if p.get("margin_mode") == "coin" else "USDC")
|
||||
if str(ccy).upper() == "USDC":
|
||||
parts.append(f"权利金{paid:g}U")
|
||||
else:
|
||||
parts.append(f"权利金{paid:g}{ccy}")
|
||||
net: Optional[float] = None
|
||||
try:
|
||||
from lib.options.options_positions_lib import net_pnl_from_display_row
|
||||
|
||||
@@ -3993,7 +3993,9 @@
|
||||
}
|
||||
const target = findOptionsTargetForInst(targets, p.inst_id);
|
||||
html += `<tr>
|
||||
<td><code class="hub-options-inst" title="${esc(p.inst_id || "")}">${esc(shortOptionsInst(p.inst_id))}</code></td>
|
||||
<td><code class="hub-options-inst" title="${esc(p.inst_id || "")}">${esc(shortOptionsInst(p.inst_id))}${
|
||||
p.margin_mode_label || p.margin_mode === "coin" ? ` <span class="hub-opt-mode">${esc(p.margin_mode_label || "币本位")}</span>` : ""
|
||||
}</code></td>
|
||||
<td>${esc(optType)}</td>
|
||||
<td>${esc(p.pos)}</td>
|
||||
<td>${optionsExpiryCdHtml(p.exp_time_ms != null ? p.exp_time_ms : p.exp_time)}</td>
|
||||
@@ -4056,7 +4058,14 @@
|
||||
const pos = Array.isArray(opt.positions) ? opt.positions : [];
|
||||
const targets = Array.isArray(opt.target_monitors) ? opt.target_monitors : [];
|
||||
html += renderOptionsAccountStatRow(opt);
|
||||
html += `<div class="section-title hub-options-title">期权持仓 · ${pos.length} 仓</div>`;
|
||||
const modeLab = esc(opt.options_margin_mode_label || (opt.options_margin_mode === "coin" ? "币本位" : "USDC"));
|
||||
const bridgeHint =
|
||||
opt.bridge_status === "pending_sell_spot"
|
||||
? " · 待卖回USDT"
|
||||
: opt.bridge_status
|
||||
? ` · 桥:${esc(opt.bridge_status)}`
|
||||
: "";
|
||||
html += `<div class="section-title hub-options-title">期权持仓 · ${pos.length} 仓 · ${modeLab}${bridgeHint}</div>`;
|
||||
html +=
|
||||
layout === "cards"
|
||||
? renderOptionsPositionsCards(pos)
|
||||
|
||||
Reference in New Issue
Block a user