Skip to content

fix(brokers): unify equity identity, HK aliases and account fill history - #413

Merged
brokermr810 merged 107 commits into
mainfrom
test
Nov 27, 2026
Merged

brokermr810 merged 107 commits into
mainfrom
test

Conversation

@brokermr810

@brokermr810 brokermr810 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

HK broker symbols differed across search, quick trading and strategy ledgers. A saved HK07709 selection could fail validation while 07709 worked, and record filters could hide real fills or positions.

Changes

  • Normalize HK numeric, HK-prefixed and .HK aliases for broker queries, board-lot rules and strategy position lookup. Keep US share classes distinct and preserve dated-futures and strategy canonical-symbol checks.
  • Deduplicate HK asset search before pagination while retaining saved catalog IDs and partial numeric searches. No historical data rewrite.
  • Use dedicated equity broker snapshots; failed or invalid reads never imply a flat account.
  • Add account-scoped IBKR executions and retain partial/cancelled fills separately from open orders; update the generated OpenAPI specification for /api/ibkr/fills.
  • Companion desktop changes keep Forthright trade authorization above all account tabs. Desktop and mobile share the watchlist alias and fill-history fixes.

Verification

  • Backend: 630 relevant regression tests passed; Ruff and structure checks passed. Two existing dependency deprecation warnings.
  • Desktop: 93 relevant unit tests and production build passed. Lint: 0 errors, 1,407 existing warnings.
  • Mobile: all 261 tests and production build passed.
  • Local UI: authorization remains visible on Orders; numeric HK search displays one result. Prefixed search requires the running backend to load the new code.

Deployment and limits

No schema migration, historical bulk rewrite, live order placement, actual authorization request, service restart or production deployment. Deploy backend API and trading workers together with the companion frontends. Submission payloads were tested with offline fixtures; live brokerage execution was not exercised. Broker history remains subject to provider retention. The main-history sync changes ancestry only. CI must pass before merging.

Companion heads

tianhe added 30 commits November 1, 2026 17:17
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/app/routes/community.py
tianhe and others added 25 commits November 22, 2026 14:45
Signed-off-by: TIANHE <[email protected]>

# Conflicts:
#	backend_api_python/tests/integration/test_runtime_readiness.py
The grid resting-order audit (verify / re-reconcile in the UI) only read the
exchange open-orders snapshot. An order cancelled on the exchange was
reported as "not_open" forever and its local row stayed open, because the
worker fill poller only polls strategies with a live runner and the UI has
no delete action.

For rows absent from open orders, query the order itself (Binance
GET /fapi/v1/order via query_grid_order_fill) and report its terminal
status. An exchange-confirmed cancel with no fill is applied to the local
row through a guarded update; orders with fills are left to the fill
poller so no fill is dropped from the strategy ledger.

Fixes #404

(cherry picked from commit 46ef975)
Signed-off-by: TIANHE <[email protected]>
Build on PR #407 by preserving confirmed terminal-order lookup and adding asynchronous persisted verification, bounded recovery, stopped-grid accounting without follow-up orders, and regression coverage.

Co-authored-by: Pranav Tomar <[email protected]>
Signed-off-by: TIANHE <[email protected]>
Add scoped broker access, HK board-lot metadata, dated-futures manual trading, and credential redaction. Keep automated futures strategies disabled. Persist advertisement settings and generate their OpenAPI contract.

Signed-off-by: TIANHE <[email protected]>
The main tree matches the pre-fix test tree exactly. Record the squash-merge ancestry while preserving the verified broker fixes.

Signed-off-by: TIANHE <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@brokermr810 brokermr810 changed the title fix(brokers): preserve equity identity and reconcile account fills fix(brokers): unify equity identity, HK aliases and account fill history Nov 27, 2026
@brokermr810
brokermr810 merged commit 734aa56 into main Nov 27, 2026
16 checks passed
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.

4 participants