fix多笔买/卖回用VWAP计入真盈亏,卖完再结算并标记待卖回。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -306,6 +306,20 @@ def open_coin_option_buy_full(
|
||||
"budget": budget_info,
|
||||
}
|
||||
_spot_bridge.update_bridge(conn, bridge_id, coin_bought=float(coin_bought))
|
||||
# 买侧 VWAP 累加(多笔买同理);USDT 优先成交回报,否则用计划买额
|
||||
try:
|
||||
usdt_spent = float(buy.get("usdt_spent") or buy_usdt)
|
||||
except (TypeError, ValueError):
|
||||
usdt_spent = float(buy_usdt)
|
||||
try:
|
||||
_spot_bridge.add_bridge_buy_fill(
|
||||
conn,
|
||||
bridge_id,
|
||||
usdt_spent=usdt_spent,
|
||||
coin_bought=float(coin_bought),
|
||||
)
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
conn.commit()
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user