fix真盈亏收口为币本位×卖回价减初始权利金U,禁指数冒充平仓价。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -403,7 +403,14 @@ def sync_open_options_trades(
|
||||
fee_ccy=fee_ccy,
|
||||
)
|
||||
realized_pnl = settled.get("realized_pnl")
|
||||
pnl_usdt = settled.get("realized_pnl_usdt")
|
||||
# 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")
|
||||
|
||||
conn.execute(
|
||||
"""
|
||||
@@ -431,7 +438,7 @@ def sync_open_options_trades(
|
||||
realized_pnl,
|
||||
close_ord_id,
|
||||
closed_at,
|
||||
settled.get("close_index_px"),
|
||||
close_px_store,
|
||||
settled.get("open_index_px"),
|
||||
pnl_usdt,
|
||||
prem_ccy,
|
||||
|
||||
Reference in New Issue
Block a user