Skip to content

feat: fill data capture, IBKR d.ts fix, E2E stability#84

Merged
luokerenx4 merged 7 commits intomasterfrom
dev
Mar 23, 2026
Merged

feat: fill data capture, IBKR d.ts fix, E2E stability#84
luokerenx4 merged 7 commits intomasterfrom
dev

Conversation

@luokerenx4
Copy link
Contributor

Summary

  • Fill data capture in order sync: RequestBridge captures filled/avgFillPrice from orderStatus() callback. Added requestCompletedOrders() for detecting filled limit orders (previously invisible to sync). UTA sync() populates filledQty/filledPrice into OrderStatusUpdate → persisted in git commit history
  • IBKR package build: tsup → tsc: tsup's rollup-plugin-dts dropped declare module augmentations used by EClient mixin pattern, causing all mixin methods to be missing from exported types. Switched to tsc for multi-file d.ts output. Added bare imports in client/index.ts to retain mixin references
  • tsc zero errors: Fixed all pre-existing type errors (trading routes, specs, MockBroker, E2E null checks, tool return type)
  • E2E stability: IbkrBroker.init() idempotent, UTA tests share single instance via beforeAll, closePosition uses SMART routing (not position's actual exchange), quote timeout graceful skip

Test plan

  • pnpm test — 880 tests pass
  • pnpm test:e2e — 22 pass, 30 skipped (no broker config), 0 failed
  • npx tsc --noEmit — zero errors
  • pnpm build — success

🤖 Generated with Claude Code

Ame and others added 7 commits March 23, 2026 13:38
…ccountManager lifecycle

- Roadmap: check off IBKR broker (implemented)
- Configuration: remove deleted platforms.json/crypto.json/securities.json,
  update accounts.json description for brokerConfig nested format
- Project Structure: add registry.ts, git-persistence.ts, ibkr/ broker,
  update account-manager.ts description
- Key Concepts: mention broker self-registration + AccountManager lifecycle
- CLAUDE.md: add trading domain sub-structure

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d orders

RequestBridge: add completedOrdersCollector for reqCompletedOrders(),
capture filled/avgFillPrice from orderStatus() callback in fillData Map.
IbkrBroker: getOrder() falls back to completed orders when not found in
open orders (fixes sync() unable to detect filled limit orders).
UTA sync() extracts filledQty/filledPrice into OrderStatusUpdate.
TradingGit persists and displays fill data in commit history.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…oker

- trading.ts: handle undefined param('id')
- config.spec.ts: add missing 'enabled' field
- MockBroker.ts: null-check before UNSET_DOUBLE comparison
- TradingGit.spec.ts: 'pending' → 'submitted', remove non-existent 'leverage' field

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tsup's rollup-plugin-dts bundled all declarations into a single file,
dropping declare module augmentations used by the EClient mixin pattern.
This caused all mixin methods (placeOrder, reqOpenOrders, etc.) to be
missing from the exported EClient type.

Switch to tsc for compilation: multi-file d.ts output preserves module
augmentations. Add bare imports in client/index.ts so tsc retains
references to mixin files in the declaration output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ccxt-bybit.e2e.spec.ts: add b() helper to narrow nullable broker
- ccxt-raw-diagnostic.e2e.spec.ts: add e() helper to narrow nullable exchange
- trading.ts: explicit Record<string, Tool> return type for createTradingTools
  (avoids TS2742 non-portable internal path reference after ibkr d.ts change)

tsc --noEmit now passes with zero errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- IbkrBroker.closePosition: allow conId-only match (no symbol required),
  use position's contract for close order (has full TWS routing info)
- ibkr-paper quote test: catch snapshot timeout gracefully (TWS paper limitation)
- uta-ibkr: add position settle delay before close

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…MART routing

- IbkrBroker.init(): skip if already connected (prevents timeout on re-init)
- UTA E2E tests: create UTA once in beforeAll, share across tests
- closePosition: force exchange=SMART on position contract (TWS returns
  actual exchange like NASDAQ, causing redirect warning that blocks API)
- ibkr-paper: add position settle delay + longer timeout for close test
- ibkr-paper: graceful skip on quote snapshot timeout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@luokerenx4 luokerenx4 merged commit 057eb79 into master Mar 23, 2026
2 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.

1 participant