Skip to content

feat: withdraw excess USDT automatically when Futures becomes flat - #309

Merged
jackhai9 merged 4 commits into
mainfrom
feat/automatic-usdt-rebalance
Oct 7, 2026
Merged

jackhai9 merged 4 commits into
mainfrom
feat/automatic-usdt-rebalance

Conversation

@jackhai9

@jackhai9 jackhai9 commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Automatically withdraw excess Futures USDT once an ordinary USDⓈ-M account has no positions or open orders for two seconds. The automatic path retains the existing 10% allocation target but never debits Funding/Spot or refills Futures after losses. Manual full rebalancing still requires confirmation.

Account-specific persistent state prevents duplicate transfers across tabs and reloads. Each transfer rechecks identity, all-symbol positions, basic and conditional orders, and balances; an unknown outcome stops further transfers. Script trading and transfers share a browser lock. Task controllers are established before waiting for that lock so an immediate Stop remains effective. Automatic status appears separately from retained trading results.

Validation:

  • 2,257 Node tests passed on the final source; test lint, generated build, syntax, and diff checks passed.
  • Targeted browser scenarios cover no-refill, two tabs, reloads, unknown responses, lock contention, immediate Stop, cancellation boundaries, native validation, manual confirmation, and independent status messages.
  • Independent architecture and final code reviews passed. The final automatic-completion panel was rendered and inspected locally.
  • Read-only live checks verified the native identity and complete Basic/Conditional order response contracts. No real transfer was executed for testing.
  • Remote CI validates the final PR commit, including the complete browser suite. These checks do not claim complete source coverage.

Version: orderbook v2.7.221. Automatic execution is limited to ordinary symbol routes without query parameters and verified non-portfolio accounts. Native Binance actions, older loaded script versions, other browsers, and external devices remain outside the script lock.

@jackhai9
jackhai9 marked this pull request as ready for review October 7, 2026 10:04
@jackhai9 jackhai9 changed the title feat: automatically withdraw excess USDT after account closure feat: withdraw excess USDT automatically when Futures becomes flat Oct 7, 2026
@jackhai9
jackhai9 merged commit b06cba9 into main Oct 7, 2026
2 checks passed
@jackhai9
jackhai9 deleted the feat/automatic-usdt-rebalance branch October 7, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant