Fix roll first-lots display and make market add use pending orders.

Store initial_lots on roll groups, submit market roll as CTP pending legs with cancel closing empty groups, and backfill first-lots for existing active groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-02 22:12:04 +08:00
parent 3c53b2063f
commit 530738ae93
5 changed files with 392 additions and 105 deletions
+2
View File
@@ -130,6 +130,8 @@ ROLL_LEG_EXTRA_COLUMNS = (
"ALTER TABLE roll_legs ADD COLUMN last_mark_price REAL",
"ALTER TABLE roll_legs ADD COLUMN invalidated_reason TEXT",
"ALTER TABLE roll_legs ADD COLUMN capital_snapshot REAL",
"ALTER TABLE roll_legs ADD COLUMN vt_order_id TEXT",
"ALTER TABLE roll_groups ADD COLUMN initial_lots INTEGER",
"ALTER TABLE trade_order_monitors ADD COLUMN risk_percent REAL",
)