实现OKX单笔期权币本位与USDT桥复利(中控只读,不改Gate)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-08-20 12:10:29 +08:00
parent dd8fbae0dd
commit 72c84bb993
20 changed files with 1377 additions and 21 deletions
+8 -1
View File
@@ -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