Skip to content

fix: omit user stream market filter for all markets#131

Merged
cesarenaldi merged 6 commits into
mainfrom
fix/user-stream-all-markets
Jun 16, 2026
Merged

fix: omit user stream market filter for all markets#131
cesarenaldi merged 6 commits into
mainfrom
fix/user-stream-all-markets

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Omit the user stream markets filter when subscribing to all markets
  • Keep narrowed user stream subscriptions sending markets: [...]
  • Add coverage for the broad user stream initial subscribe frame

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm test:client

Notes


Note

Medium Risk
Changes live websocket subscription wire format for a common { topic: 'user' } path, which can affect real-time order/trade delivery; behavior is intentional and test-covered but touches trading-adjacent infrastructure.

Overview
Broad user websocket subscriptions no longer send a markets field on the initial subscribe frame when includeAllMarkets is true (buildUserSubscribeMessage in protocol.ts). Narrow subscriptions still include markets: [...]. This aligns with the Python SDK fix so all-market user streams can receive trade events (and related updates) that were previously filtered incorrectly.

Bindings: e6-scaled bigint string parsing is centralized as E6BigIntStringToDecimalStringSchema in shared.ts (RFQ schemas now import it). Order response empty-string amount normalization is renamed to OrderResponseAmountSchema with no behavior change.

Tests: Unit coverage for the all-markets subscribe frame; user subscription integration tests move into subscriptions.test.ts, including a metered test that asserts a trade event after a market order. Standalone user-subscriptions.test.ts is removed.

Reviewed by Cursor Bugbot for commit 11818ef. Bugbot is set up for automated code reviews on this repo. Configure here.

@cesarenaldi cesarenaldi merged commit 844c6d2 into main Jun 16, 2026
8 checks passed
@cesarenaldi cesarenaldi deleted the fix/user-stream-all-markets branch June 16, 2026 14:43
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