Add OKX trading-account USDC auto-swap and lock exit target while in position.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-30 00:16:47 +08:00
parent f0b0b91f1b
commit 0837982714
16 changed files with 626 additions and 36 deletions
+4
View File
@@ -34,6 +34,7 @@ CREATE TABLE IF NOT EXISTS groups (
expiry_ymd TEXT,
entry_index_px REAL,
initial_premium REAL DEFAULT 0,
exit_target_usdt REAL,
open_at_ms INTEGER,
close_at_ms INTEGER,
close_reason TEXT,
@@ -79,6 +80,7 @@ CREATE TABLE IF NOT EXISTS positions (
option_entry_px REAL,
entry_index_px REAL,
initial_premium REAL DEFAULT 0,
exit_target_usdt REAL,
status TEXT
);
@@ -166,6 +168,8 @@ class Database:
("groups", "funding_usdt", "REAL"),
("groups", "settle_index_px", "REAL"),
("groups", "perp_margin_mode", "TEXT"),
("groups", "exit_target_usdt", "REAL"),
("positions", "exit_target_usdt", "REAL"),
("fills", "exec_mode", "TEXT"),
("fills", "fee_ccy", "TEXT"),
):