Skip to content

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

Open
cesarenaldi wants to merge 1 commit into
mainfrom
fix/dev-274-user-stream-trade-events
Open

fix: omit user stream market filter for all markets#103
cesarenaldi wants to merge 1 commit into
mainfrom
fix/dev-274-user-stream-trade-events

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: [...]
  • Update protocol and manager tests for the all-market frame shape

Verification

  • uv run pytest tests/unit/test_streams_user_protocol.py tests/unit/test_streams_user_manager.py tests/unit/test_streams_user_events.py -q
  • uv run ruff format --check .
  • uv run ruff check .
  • uv run pyright
  • uv run pytest -q

Notes

  • Compared with the TypeScript SDK. Its user stream builder currently appears to send markets: [] for broad subscriptions too, so the same behavior likely needs a follow-up there.

Note

Low Risk
Small WebSocket protocol shape change with focused tests; risk is mainly if a server required markets: [] rather than a missing field.

Overview
Fixes the CLOB user WebSocket initial subscribe frame when the client wants all markets: it no longer sends markets: [] and instead omits the markets field entirely. Narrow subscriptions are unchanged and still send markets with the explicit market list.

build_initial_frame in user_protocol.py gates markets on include_all_markets. Unit and manager tests were updated to expect no markets key for broad subscriptions (including all-markets demotion/promotion flows).

Reviewed by Cursor Bugbot for commit 65f3ece. 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