Commit Graph

43 Commits

Author SHA1 Message Date
dekun 0978650cc0 Always show logout and render a single underlying text label.
Move exit next to the theme toggle so it remains visible when APP_AUTH_DISABLED=true; PO select shows only ETH or BTC copy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 20:27:30 +08:00
dekun 2fecbda450 Add logout control and show a single locked underlying on hedge select.
Nav gains an exit link when auth is enabled; PO option picker no longer shows unused ETH/BTC toggles.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 20:22:06 +08:00
dekun 5d161b4220 Add HEDGE_PO_MODE instance modes with shared sim/live path.
Lock one mode per instance/subaccount, cross-asset BTC option/ETH perp sizing, combo-U exit, and ship docs/tests/audit.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 20:05:25 +08:00
dekun ab7a2309ad Fold chain/account/PnL hints into rules; hide dust sell-coin.
Move the three noisy help lines into 规则说明, and show 手动卖回币 only when trading-coin balance meets the exchange min size.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 19:31:14 +08:00
dekun 1d71414c56 Align header title and ETH/BTC quotes with crypto_okx.
Match fullwidth title separator, page spacing, and move live tickers into the nav right column using the same spot-ticker UI/API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 19:27:33 +08:00
dekun 22de1fd40c Match options branding: title prefix and ETH/BTC header quotes.
Use 「加密货币 | OKX 对冲」 and show live top-right ETHUSDT/BTCUSDT quotes like the options instance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 19:17:00 +08:00
dekun fc83905cf6 Expand default strike rows and add hedge fund transfer / sell-coin.
Show the default five chain rows without a scroll box, add funding transfer under manual pick, and wire sell-back-coin above positions via hedge APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 19:11:44 +08:00
dekun d40a0d25be Make hedge the default home and drop unused product-surface entries.
Put永期/期期对冲 first in nav, default embed tab to hedge_plan, and remove risk-policy/options-account UI instead of only hiding them.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 18:51:57 +08:00
dekun cfecbcfbb5 Hide unused risk-policy nav and options-account env for hedge-only.
Gate system-settings options panels on STANDALONE_OPTIONS_UI so settings no longer 500 without the options trading module.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 18:47:36 +08:00
dekun 16bba2eb1a Enable hedge review with dual-timeframe K-line charts.
Always install the review module in hedge-only mode, expose 对冲复盘 in nav, and allow auto charts for closed hedge plans.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 18:43:02 +08:00
dekun 6607d09526 Make this repo hedge-only: skip standalone options UI by default.
Nav/env only expose 永期/期期; set STANDALONE_OPTIONS_UI=true for emergency opt-in.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 18:37:46 +08:00
dekun 14cbbc300d Refresh perp mark from public ticker when position metrics are unavailable.
Sim/no-keys mode was falling back to entry so 标记 stayed frozen at open price.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:34:43 +08:00
dekun 9295dcffe3 Show editable exit on live cards; price perp PnL via close-side book VWAP.
Align monitor profit-exit with the same book VWAP so card and auto-exit stay consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:29:58 +08:00
dekun 3f98ba1e88 Fix IndentationError in live positions import that broke 当前持仓 API.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:13:56 +08:00
dekun 746655acba Align hedge UI/fees: drop 未启动, premium coin/U, equity incl perp margin, OKX option fees.
Option net uses Min(0.03%×coin, 7%×premium) with bid/ask fills (no slip); live PnL colors fixed.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 17:12:10 +08:00
dekun be00991568 Fix post-close auto sell: restore missing spot min-size helpers used by sim sell.
Sell was silently failing on ImportError; surface sell result in close alert notes.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:58:09 +08:00
dekun d54bbdfcb3 Fix close-path SQLite lock by releasing write lock before exchange/sim ops.
Also enable WAL and busy_timeout on get_db so concurrent sim writes wait instead of failing immediately.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:54:56 +08:00
dekun 043b0aeded Bump instance_theme cache for unflat position tag styles.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:51:47 +08:00
dekun a83b6794d8 Keep unflat legs on 当前持仓 after plan end.
Closed plans with open legs stay visible and closable so residual positions are not orphaned from the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:51:33 +08:00
dekun 989accdc50 Wire manual close to actually flatten option then perp then sell coin.
UI 平仓 now calls /api/hedge-plan/<id>/close instead of end-only (不平仓).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:49:24 +08:00
dekun b7b1a7e7e0 Wide order dialog (calc|form); enrich live cards with lev/bid/margin/time.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:45:05 +08:00
dekun e6701563bd Bump options_panel.js cache bust after removing hedge source badge.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:32:55 +08:00
dekun 0b3dabbbd9 Split live positions from hedge plans; show option+perp net PnL after fees.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:32:13 +08:00
dekun 5c95625817 Relax perp order dialog spacing; fix styles when dialog mounts on body.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:25:22 +08:00
dekun 7d29181a04 Fix perp manual order watch_entry bug; slim dialog UI; nav shows 永期/期期.
Manual market_order was validated as watch (missing watch_entry=0). Collapse order calc into details, remove page head card, show mode name in nav.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:19:15 +08:00
dekun 78b909761d Perp hedge: dialog order like options; right panel shows positions/orders/history/stats.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 16:05:50 +08:00
dekun ab1582ed88 Fix max option sheets: shared trading USDT = buy premium + perp margin.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 15:53:12 +08:00
dekun e64c5ab322 Show ~5 option rows by default; hide available USDT in perp quote.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 15:48:29 +08:00
dekun d68e9c3946 永期手动下单:修币本位杠杆显示,张数定仓与双出场模式.
右侧以张数+比例算永续,杠杆取 env(BTC10/ETH5);开仓买币+5%滑点;出场可选盈利金额(扣双边费)或目标位;平仓后卖光币回 U.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 15:43:44 +08:00
dekun e474c89c35 Rename 永期「市价下单」文案为「手动下单」(卖一限价,非交易所市价单).
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 15:24:05 +08:00
dekun c9e69ce8ef 永期改为市价选约:左同期权人工选,右去掉选约条件.
左侧到期/CallPut/全部实虚值/展开全部;右侧仅资金杠杆与出场;下单走已选合约立即开仓而非条件盯盘.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 15:19:17 +08:00
dekun 73a1d5f709 Swap 永期 layout to left option select / right order; default opt:perp ratio 2.
Call pairs with perp short and Put with perp long; sizing shows coin notional so 1 BTC option hedges 0.5 BTC perp.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 12:54:09 +08:00
dekun 4c48c95562 Tune CoinOX env: drop auto-transfer; map leverage to hedge perp opens.
BTC_LEVERAGE/ALT_LEVERAGE now drive永期永续 default leverage in UI and start fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 12:46:14 +08:00
dekun 4b1c629d26 Remove temporary USDC cleanup scripts from repo.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 12:34:09 +08:00
dekun 2854d94e6b Remove USDC product path; CoinOX is coin-margined only.
Drop USDC open/quote/swap APIs and env knobs; retarget hedge/settings copy to USDT/coin.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 12:33:59 +08:00
dekun 5608173784 Slim CoinOX UI to okx对冲: drop records/stats nav and trim env.
Redirect removed pages, disable trade-records API, and keep only options/hedge-related env groups.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 11:38:50 +08:00
dekun a845da8d08 Fix CoinOX static JS path so hedge_plan.js is served.
dirname(BASE_DIR) pointed at /opt/lib and returned 404, leaving the hedge page stuck on loading.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 11:28:05 +08:00
dekun 135cdc13ba Fix hedge market quotes via public HTTP and default cloud-server deploy settings.
Avoid load_markets hangs on weak networks; enable login-required sim defaults and document Baota Nginx reverse proxy.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 10:13:39 +08:00
dekun b4d62ea0a6 Enable options by default and allow full sim trading without OKX API keys.
Relax hedge start gates in sim, route perp open/close through sim broker, and mount strategy templates for records pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 09:26:38 +08:00
dekun d4b970cfd5 Allow CoinOX to start without manual_trading_hub by stubbing hub settings imports.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 09:17:40 +08:00
dekun 369114ee1b Fix IndentationError in init_db that prevented coinox from starting.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 09:09:53 +08:00
dekun 4a4de8f5fb Add Ubuntu interactive one-click deploy; default sim mode.
Ship deploy/manage.sh toolkit for /opt/coinox, rewrite Ubuntu-only deploy docs, drop Windows deploy guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 08:35:07 +08:00
dekun 88b7fb7a0a Initial CoinOX instance: coin-margined options + USDT hedge.
Forked from crypto_monitor OKX instance (copy-only). Keeps standalone options, perp-options and options-options hedge; drops standalone perp entrypoints; forces coin margin; adds sim wallets; default port 5010.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-14 00:18:40 +08:00