98 Commits

Author SHA1 Message Date
dekun fc74b8e913 Align funds bar and win-rate with OO expiry intrinsic repair; wire Binance balances.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 17:18:16 +08:00
dekun 3520fc0214 Fix OO expiry Put PnL: overlay wrong near-zero settlement fills with intrinsic.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 17:02:44 +08:00
dekun 77d2effb6d Backfill OO expiry settle display via public ETHUSDT and intrinsic overlay.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 16:58:02 +08:00
dekun 3264dd4381 Fix OO expiry settle index: persist spot and never invent strike from OTM fill.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 16:44:56 +08:00
dekun 4a5d19e30f Fix OO trade records: include Put PnL and show dual-leg detail clearly.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 09:34:35 +08:00
dekun 26e6d98338 Add three-page strategy format doc for auto, OO, and semi-auto.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:23:05 +08:00
dekun 3491681c28 Mirror option expiry settlements from exchange bills; debit OO LIVE open premiums.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 16:02:16 +08:00
dekun 8d67f3fc6c Fix LIVE SoT P0/P1: closing state machine, OO exchange fills, BN balances.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:54:45 +08:00
dekun 99e58910d3 Treat exchange as LIVE SoT: expiry closes perp only, no invented option settles.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 15:44:15 +08:00
dekun 4f56eff40c Anchor semi exit to strike +/- move points; side-by-side semi cards.
Forward target is K+/-N not spot+/-N; UI shows option target and perp net lock.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:59:48 +08:00
dekun 5ea54db43b Let semi-auto reopen nearest expiry; ignore one-expiry-per-day.
Far quarterly skips were masking usable near OTM quotes like 260810.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:48:07 +08:00
dekun 4db1e0c470 Estimate semi forward PnL from strike intrinsic on move points.
Replace misleading exit-unit label with option/perp point-move preview vs selected K.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:35:10 +08:00
dekun b09d1b0886 Show semi risk-based open size from ask and unit ratio.
Semi sizing uses market ask with semi units; Plan panel previews option/perp qty under the form.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 14:27:19 +08:00
dekun 457838ef64 Extend semi-auto with ITM/ATM/OTM, offset, and 1:4 sizing.
Moneyness and perp:option units are plan-only; OTM enforces leverage >=180.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 11:42:57 +08:00
dekun 4585dba3c3 Add 永期半自动: human arm, machine open/close, then stop.
Settings toggle, Plan panel, Fleet monitor, exit locks and armed TOCTOU gates; docs and dual audits.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-08 11:20:11 +08:00
dekun 24a860ad3f Split OO budget per leg and size Call/Put independently.
Each half of the risk budget buys its own qty from ask; equal qty no longer forced.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 17:08:05 +08:00
dekun eaf94448a2 Treat option-option amplitude as a maximum cap.
Reject opens when range exceeds the setting; update UI and docs labels.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 16:35:39 +08:00
dekun ec244c63c6 Add option-option hedge mode with SIM/LIVE parity.
Mutual hedge_mode, amplitude OTM selection, 1:1 risk sizing, win-leg/full close, dual audits and docs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-07 16:01:16 +08:00
dekun a10ecf7409 Gate one-open-per-expiry by historical expiry_ymd across days.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 07:35:44 +08:00
dekun 4059d826e1 Document detailed open/close logic and LIVE failure handling.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 14:44:20 +08:00
dekun 640ecc9530 Sell residual options at latest bid via IOC limit, not market.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 14:25:03 +08:00
dekun 62c91d4bd0 Close residual options when premium recovers above configurable threshold.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 14:19:21 +08:00
dekun 079dc83132 Show strategy stats in control monitor detail modal.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 09:49:27 +08:00
dekun aab0b9bdf6 Support up to 3 strategy slots on one host with auto ports.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 23:33:41 +08:00
dekun 021b0d0a22 Align emergency option close to OKX: use bid only, never mark.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 17:15:38 +08:00
dekun b3ba0fd431 Add SSE second-level status push for control monitor.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 13:32:28 +08:00
dekun e7529e9dc4 Document Fleet control center across README and core docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 13:07:25 +08:00
dekun da5eb4c18c Add Fleet control plane and split manage.sh deploy menu.
Strategy nodes gain fleet token APIs; control/ app for local ops; manage.sh offers strategy vs control one-click deploy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 10:46:40 +08:00
dekun 200702d066 Harden strategy SoT: fail-closed funds gate, shared open pipeline, LIVE switch guards.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 01:06:32 +08:00
dekun cc0f0ffd0d Run OKX auto USDC convert before option pick when trading USDC is short.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:28:11 +08:00
dekun a9939bbbdd Route manual USDT/USDC convert through trading account (not funding).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-30 00:23:16 +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 a47a9b6377 Polish risk sizing: 2dp money preview, editable ratio/exit, plan badge.
Exit unit and perp/option units scale with k; plan page shows 以损定仓.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 23:48:34 +08:00
dekun 3a4c8d639c Add risk-based position sizing (以损定仓) with per-open k resize.
Manual vs risk modes are exclusive; each open floors k to 1 decimal so estimated premium+fees stay within the loss budget.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 23:32:42 +08:00
dekun c425a08a8f Rebuild broken .venv when activate is missing after ensurepip failure.
Half-created venvs often keep bin/python3 without activate; directory existence is not enough.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 21:37:04 +08:00
dekun 467203b61d Detect ensurepip and auto-install python3-venv in one-click deploy.
Avoid false OK on bare python3; repair broken .venv; re-check deps after git pull.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 21:33:18 +08:00
dekun 17ba41923a Wait for apt lock during deploy on fresh Ubuntu hosts.
Avoid failing Node install when unattended-upgrades holds dpkg; poll up to 10 minutes then retry.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 21:20:40 +08:00
dekun c41122ae71 Document cloud server sizing and region guidance.
Add recommended VPS specs and low-latency region notes for deploy and commercial delivery.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 20:57:56 +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 50a4540aaf Remove background from header brand and top nav.
Use transparent text links; active state is accent color only.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:49:03 +08:00
dekun 9b3693e542 Drop index from option market card title.
Index remains only on the perp quote card.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:45:11 +08:00
dekun a668214e5d Show perp mark and option index on market cards.
Uppercase ETH in 选约条件; add 市价 to perp quote; append index after ATM strike title.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:41:52 +08:00
dekun b2e23e973f Show qty on plan card and merge float PnL row.
Read perp/option ETH size into 选约条件; combine 永续/期权浮盈 on one line.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:38:55 +08:00
dekun e1da830eac Improve desktop settings and trades list UX.
Fold backup/WeCom help into rules; backup list one-per-line (5 visible); trades table with 10/page; hide funds bar on mobile.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:31:30 +08:00
dekun 0ee1d8be5d Add fixed-direction switch for perp/option open side.
When enabled, lock perp long→buy Put or short→buy Call with ITM/ATM only; off keeps ATM/ask rules.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 19:18:12 +08:00
dekun 55109e82d3 Hide SIM label in WeCom; count completed rounds from closed groups.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-29 18:15:09 +08:00