统计已实现盈亏扣手续费,并按平仓时指数冻结为 U。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-08 22:50:21 +08:00
parent e8f8a76753
commit 5e8b578f75
12 changed files with 726 additions and 54 deletions
+8
View File
@@ -103,6 +103,14 @@ def init_sim_tables(conn: sqlite3.Connection) -> None:
)
"""
)
try:
conn.execute("ALTER TABLE sim_option_orders ADD COLUMN fee REAL DEFAULT 0")
except Exception:
pass
try:
conn.execute("ALTER TABLE sim_option_orders ADD COLUMN fee_ccy TEXT")
except Exception:
pass
row = conn.execute("SELECT id FROM sim_wallets WHERE id=1").fetchone()
if row is None:
equity = max(0.0, _env_float("SIM_INITIAL_EQUITY_USDT", 10000.0))