Fix LIVE open/close double-book and security audit findings.

Prevent expiry dual-close from re-booking option cash, abandon ledger rejection, margin-mode mismatch, and manual close races; harden fill wait and refuse default AUTH_SECRET on LIVE.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-29 20:11:29 +08:00
parent c6e8f6fe1e
commit ec87cf2104
10 changed files with 229 additions and 80 deletions
+3 -1
View File
@@ -43,7 +43,8 @@ CREATE TABLE IF NOT EXISTS groups (
note TEXT,
exec_mode TEXT,
funding_usdt REAL,
settle_index_px REAL
settle_index_px REAL,
perp_margin_mode TEXT
);
CREATE TABLE IF NOT EXISTS fills (
@@ -164,6 +165,7 @@ class Database:
("groups", "exec_mode", "TEXT"),
("groups", "funding_usdt", "REAL"),
("groups", "settle_index_px", "REAL"),
("groups", "perp_margin_mode", "TEXT"),
("fills", "exec_mode", "TEXT"),
("fills", "fee_ccy", "TEXT"),
):