Commit Graph

67 Commits

Author SHA1 Message Date
dekun 60112bf8eb Add mobile monitor layout with bottom nav and glance card.
EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 06:54:42 +08:00
dekun 56a4007130 Add WeCom markdown alerts and keep target exits while strategy is paused.
Notify open/close/start/pause/fault with SIM vs LIVE venue labels; configure webhook in Settings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 23:19:39 +08:00
dekun 4d331da962 Detect Python/Node/PM2 on deploy (install only if missing); uninstall removes /opt/eth_hedge_sim.
Keep .env and DB backup under /root/backups before deleting the install directory.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 23:08:51 +08:00
dekun 2b348854fe Add DB+.env auto backup with download and upload restore in Settings.
Backups land under /root/eth_hedge_backups; restore accepts zip body for new-server migration and restarts the process.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 23:05:58 +08:00
dekun 9d3b36826c Include LIVE close-fee estimate in target PnL; rest after manual and emergency close.
Align docs so LIVE exit matches SIM fee buffer; manual full close now enters rest_seconds like auto/emergency.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:58:10 +08:00
dekun 16efa44ffb Hide manual trade by default, block open while running, auto-refresh auth token.
Also fix flat-side reconcile to check both long and short residuals; document in 更新说明.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:43:38 +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 bc8d1fb127 Force LF for deploy shell scripts via .gitattributes.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:08:37 +08:00
dekun bffbdafbfc Fix CRLF in deploy shell scripts so Ubuntu bash can run updates.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:07:44 +08:00
dekun 8813fd3e37 Use 比特骆驼 logo for PWA/brand marks, remove install button, docs Ubuntu 22.04 only.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:07:11 +08:00
dekun 86d3c94f32 Rebrand to 比特骆驼自动化对冲系统; clear login autofill and sim subtitle.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 22:02:09 +08:00
dekun cb97a45051 Add PWA install badge for desktop and tablet (manifest, SW, Add to Home Screen).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:57:39 +08:00
dekun aca9d80e64 Collapse field hints into a default-folded 规则说明 on strategy and runtime settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:52:49 +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 b7e055e37b Add always-apply rule: deploy after edits; chat-only when user says 先聊.
Also split strategy settings into subtabs and hide sim equity in LIVE.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 21:41:16 +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
dekun c2113b1a57 Add live trading strategy doc with 1+2 ETH standard size and scale factor k.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 20:53:21 +08:00
dekun 5369b4b04f Document plan-page watch rules: pin held strike, residual list, new ATM when flat.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 19:37:20 +08:00
dekun 38ffbf728b Pin market watch to held option strike while a position is open.
Stop falling back to ATM quotes for unrealized/close PnL after ATM drifts or restart.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 18:37:20 +08:00
dekun 4994aaab16 Implement dual target-close paths and residual option expiry.
Document and enforce: A full dual-leg close, B perp-only when deep OTM with residual archive that does not block next open, and expiry settlement when target is missed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 18:32:05 +08:00
dekun 96e8e5cb70 Show option/perp PnL and fee-deducted net in trade details.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 16:14:48 +08:00
dekun 21b8f587a2 Clarify expiry settles at intrinsic in strategy docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 16:09:47 +08:00
dekun e3671d9798 Settle expiry options at intrinsic value like live exchange.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 16:08:44 +08:00
dekun a58d97938c Floor option close at intrinsic to fix expiry garbage quotes.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 16:07:20 +08:00
dekun b0dca59681 Add XMind strategy logic map and generator script.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-26 10:28:21 +08:00
dekun f25c79fd76 Close option before perp so the hedge stays while exiting the thin leg.
EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 13:03:51 +08:00
dekun 32e8de85cc Show option top-of-book size and open option before perp.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:57:16 +08:00
dekun 21ca5cbfe0 Survive Binance eapi 418/429 with cooldown, soft start, and no ticker raise.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:49:14 +08:00
dekun 867deba1bb Throttle Binance eapi REST to avoid 429 on Plan snapshot polls.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:44:41 +08:00
dekun fff285c1f9 Add ATM open-offset toggle default off.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:42:20 +08:00
dekun 79c074ec6c Prefer open direction from ATM vs spot (below=Call/short, above=Put/long).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:39:23 +08:00
dekun ee0ec57f89 Gate opens when ATM-spot offset exceeds configurable max (default 3).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:32:36 +08:00
dekun a4bcc3ab0d Show ATM distance to spot on Plan market card.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:25:27 +08:00
dekun 2a2b9f44c2 Update Binance options WS default in .env.example
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:18:34 +08:00
dekun 89ea3336c8 Fix Binance options WS endpoint and connected flag.
Use fstream /public/stream with lowercase bookTicker streams; keep market connected if futures WS is up.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:18:01 +08:00
dekun 586469482e Fix Binance boot using OKX symbols after restart.
Startup ignored DB exchange choice and kept OKX ATM ids under a Binance health label, so option bid/ask stayed empty.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:13:19 +08:00
dekun d701d30c04 Fix Binance option top-of-book via depth limit and ticker fallback.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:08:33 +08:00
dekun 78fd046fb6 Add Binance SIM market adapter and exchange switch in settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 12:02:36 +08:00
dekun 5dcec0fde0 Add configurable SIM equity (default 10k) and strategy docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 11:43:51 +08:00
dekun b50c134f5b Add weekend open skip, expiry force-close, and Chinese trade labels.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 10:28:33 +08:00
dekun 826362b556 Restore strategy/positions height sync and shared market columns.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:45:35 +08:00
dekun 0a824d9d1e Align plan columns and put option countdown on title row.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:43:02 +08:00
dekun 12a6365fc9 Lay out plan as strategy left and stacked position cards right.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:39:04 +08:00
dekun 8a148f8c2b Pack plan summary into multi-column layout for ultrawide screens.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:35:36 +08:00
dekun 974bf7fe34 Show perpetual and option floating PnL on separate rows.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:33:48 +08:00
dekun ab7daa31e6 Fix option UPL to bid times size minus initial premium.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:32:12 +08:00
dekun fd4597f735 Compute option UPL as initial premium minus bid times size.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:28:40 +08:00
dekun 77ae6a44b9 Show option expiry countdown and widen settings for ultrawide/tablet.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-25 09:24:11 +08:00