fix复盘真盈亏改为期权币盈亏×平仓价,不再绑卖回与初始权利金差。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-13 12:39:15 +08:00
parent 839baea375
commit fc0d76d174
11 changed files with 98 additions and 211 deletions
+2 -9
View File
@@ -403,14 +403,7 @@ def sync_open_options_trades(
fee_ccy=fee_ccy,
)
realized_pnl = settled.get("realized_pnl")
# BTC/ETH:真盈亏U与平仓价等卖回VWAP,禁止用指数占位
pc = str(prem_ccy or "").strip().upper()
if pc in ("ETH", "BTC"):
pnl_usdt = None
close_px_store = None
else:
pnl_usdt = settled.get("realized_pnl_usdt")
close_px_store = settled.get("close_index_px")
pnl_usdt = settled.get("realized_pnl_usdt")
conn.execute(
"""
@@ -438,7 +431,7 @@ def sync_open_options_trades(
realized_pnl,
close_ord_id,
closed_at,
close_px_store,
settled.get("close_index_px"),
settled.get("open_index_px"),
pnl_usdt,
prem_ccy,