Commit Graph

14 Commits

Author SHA1 Message Date
dekun dffcd77837 Add trade move points; label option UPL price as bid not mark.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-31 15:44:52 +08:00
dekun 0837982714 Add OKX trading-account USDC auto-swap and lock exit target while in position.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:16:47 +08:00
dekun 101cb3c045 Fix ghost finalize on unknown perp size and open rollback hazards.
Distinguish exchange query None from flat zero; keep opening when size unknown; idempotent half_open cash; scan options while opening; continue manage after recover.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 20:47:29 +08:00
dekun e2a19a1614 Recover stuck opening and harden LIVE open/close reconcile.
Stamp open intent, recover opening from exchange option/perp state, skip resell/reopen when already flat, and persist Binance margin mode.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 20:32:45 +08:00
dekun 44fd0371b9 Fix OKX abandon residual double-book and fill/residual ledger holes.
After dual-close leaves option pending, continue close_group instead of false residual; reject partial fills on wait timeout; LIVE residual settle allow_negative.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 20:20:36 +08:00
dekun ec87cf2104 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>
2026-07-29 20:11:29 +08:00
dekun c6e8f6fe1e Support LIVE exchange funds and perp margin mode.
Hide sim equity when LIVE is selected; OKX funds bar uses exchange balances; add cross/isolated for perp only (options stay cash).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:57:09 +08:00
dekun 1c75db4a19 Split fee stats by leg and hide LIVE slip.
SIM shows perp/option fees and slip separately; LIVE keeps real exchange fees only with slip forced to zero.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 16:37:18 +08:00
dekun 14c6ba51a8 Show trade open/close times and hold period by target exit.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 15:37:37 +08:00
dekun 0cf3756b09 Harden LIVE opens with slot claim and exchange reconcile.
Prevent duplicate opens by atomically claiming an opening slot, verifying exchange perp is flat before live orders, setting leverage from ledger, and preferring exchange position size when closing perps.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:39:27 +08:00
dekun f48ea5bbcc Audit fixes: LIVE symbols/fills/expiry/pending, security harden, add 更新说明.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:28:03 +08:00
dekun ca66c494e7 Use exchange fees, UPL, funding for LIVE PnL; USDC 1:1 to USDT.
Option open P&L stays local (option net); exit target ignores estimated close fees.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:49:20 +08:00
dekun dbc86a1ce6 Add Binance live trading, anti-stuck open/close recovery, and configurable rate limits.
OKX/Binance LIVE share half_open and option_closed_perp_pending repair paths; private REST throttles default to 1s and are tunable in settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:35:10 +08:00
dekun e666230d0b Add SIM/LIVE switch with API keys saved to .env and OKX live executor.
Enable settings UI for mode/keys, gate strategy start when LIVE is not ready, and stop PM2 from forcing MODE=SIM.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:08:39 +08:00