feat: import Futu OpenAPI (moomoo) integration from upstream PR #203 - #3
Merged
Conversation
Integrate Futu market data and trading with secure OpenD configuration, resilient client lifecycles, and simulated/live execution support.
Prevent duplicate fills, preserve session-bar routing, and make push/REST reconciliation fail closed across reconnects.
Keep OpenD loopback-only for WSL deployments while preventing relay, SDK log, and reconciliation connection leaks.
Reuse quote/trade contexts per credential, release projection clients, and stop stacking orphaned execution-stream threads. Co-authored-by: Cursor <cursoragent@cursor.com>
Merging the Futu OpenAPI integration on top of an already-modified pending_order_worker.py (fix: normalize live order and template precision) pushed the file 23 lines past the baseline the source branch had bumped it to. Resync the recorded line count to the actual post-merge state; verified with the full non-integration test suite (1480 passed) and the Futu-specific suite (55 passed, 1 skipped).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
futu-apiSDK — this is the same underlying broker integration the earlier scaffold was targetingWhat's included
Merged via
git merge(preserving upstream authorship) of the 4 commits fromdl-sdu/QuantDinger:feat/futu-openapi:app/data_sources/futu.py— market-data adapterapp/services/futu_trading/— client, config, symbol mapping, quote client/feed, session pooling, timezonesapp/routes/futu.py— API routesapp/routes/credentials.py)trading_executor.py,pending_order_worker.py,strategy_v2/)scripts/opend_relay.py— secure WSL/Docker bridge to a host-run OpenD gatewaydocs/architecture/FUTU_OPEND.mdFix on top of the merge
The merge combined two independent changes to
pending_order_worker.py— this fork'smainhad already modified it (fix: normalize live order and template precision) on top of the same base commit OpenByteInc#203 branched from. The additive merge pushed the file 23 lines past the line-count baseline OpenByteInc#203's branch had bumped it to. Resyncedscripts/backend_quality_baseline.jsonto the true post-merge line count.Test plan
git diffreviewed for merge conflict markers — none found, clean auto-mergerequirements.txt/requirements.lockdiff before installing anything — confirmed only one new dependency (futu-api, the official Futu/moomoo SDK) was introduced; this fork's CVE-patched floors (cryptography,pypdf,aiohttp,ccxt) were preserved by git's 3-way merge, not overwritten by the older pins on the source branch