Skip to content

Comments

Add public trades subscription support#3

Merged
AirVan21 merged 2 commits intomainfrom
add-trades-subscription
Feb 7, 2026
Merged

Add public trades subscription support#3
AirVan21 merged 2 commits intomainfrom
add-trades-subscription

Conversation

@AirVan21
Copy link
Owner

@AirVan21 AirVan21 commented Feb 7, 2026

Summary

  • Add SubscribeTrades/UnsubscribeTrades methods for real-time trade event streaming
  • Add HandleTradeEvent to parse incoming trade messages into PublicTrade structs
  • Change BBO bid/ask fields to std::optional<double> since ticker updates may omit them
  • Remove lastPrice from BBO (not reliably present in ticker events)
  • Remove unused subscribed_markets_ set and its mutex
  • Subscribe to both ticker and trades for BTC-EUR and ETH-EUR in main.cpp

Test plan

  • Verify project builds successfully
  • Verify BBO streaming still works with optional fields
  • Verify trade events are received and printed correctly

🤖 Generated with Claude Code

AirVan21 and others added 2 commits February 7, 2026 17:45
…l setters

Replace SetBBOCallback/SetErrorCallback/SetConnectionCallback with a single
Callbacks struct passed at construction. Add OrderBook and PublicTrade data
types for future subscription support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add SubscribeTrades/UnsubscribeTrades for real-time trade events
- Add HandleTradeEvent to parse and deliver PublicTrade data via callback
- Change BBO bid/ask fields to std::optional since ticker updates may omit them
- Remove lastPrice from BBO (not reliably present in ticker events)
- Remove subscribed_markets_ tracking (unused)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AirVan21 AirVan21 merged commit 5a323ec into main Feb 7, 2026
3 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