Skip to content

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

Open
cesarenaldi wants to merge 6 commits into
mainfrom
fix/user-stream-all-markets
Open

fix: omit user stream market filter for all markets#131
cesarenaldi wants to merge 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.

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