Skip to content

Fix Gemini emitting trades for symbols not subscribed to TRADES - #1151

Merged
bmoscon merged 1 commit into
bmoscon:masterfrom
wavebyrd:fix/gemini-trades-subscription-filter
Oct 18, 2026
Merged

bmoscon merged 1 commit into
bmoscon:masterfrom
wavebyrd:fix/gemini-trades-subscription-filter

Conversation

@wavebyrd

@wavebyrd wavebyrd commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Description of code - what bug does this fix / what feature does this add?

Gemini's single l2 subscription carries trades for every subscribed symbol, so a symbol subscribed only to L2_BOOK also produced TRADES callbacks. _book() already skips symbols that aren't in its subscription; this adds the same check to _trade() and _trade_batch().

  • - Tested
  • - Changelog updated
  • - Tests run and pass
  • - Flake8 run and all errors/warnings resolved
  • - Contributors file updated (optional)

Comment thread tests/unit/test_gemini.py Outdated

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i dont want 100 lines of AI test code for a 4 line fix. Remove this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, the fix is unchanged.

Gemini's l2 subscription covers every symbol across all channels and carries trades, both as live trade messages and batched inside l2_updates. _book already drops messages for symbols that weren't subscribed to L2_BOOK, but _trade and _trade_batch had no such check, so a symbol subscribed only to L2_BOOK also produced TRADES callbacks.
@wavebyrd
wavebyrd force-pushed the fix/gemini-trades-subscription-filter branch from 068e085 to 4a81a4d Compare October 18, 2026 23:18
@bmoscon
bmoscon merged commit a69c4e9 into bmoscon:master Oct 18, 2026
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.

2 participants