Claude/btc futures price feed 932 d6#1920
Open
SelfAIautomation wants to merge 6 commits intonpm:mainfrom
Open
Conversation
Python application that connects to Binance and Bybit BTCUSDT perpetual futures WebSocket APIs to stream BBO (best bid/ask), mark price, index price, and funding rate data in real-time, saving to Parquet files with hourly rotation and buffered writes. https://claude.ai/code/session_01SgQFN7Mnn9K9B3DAQ4u4eu
1. Add aggTrade stream to Binance to populate last_price (was always NULL) 2. Add record_type and source_stream columns to distinguish event types 3. Split exchange_ts into exchange_event_ts / exchange_tx_ts for precision 4. Write to .parquet.part files and rename on close to prevent partial reads 5. Add monitoring metrics: drop count, flush success/fail, records written https://claude.ai/code/session_01SgQFN7Mnn9K9B3DAQ4u4eu
…earned - CLAUDE.md: development guidelines for future sessions (auto-read by Claude Code) - DESIGN.md: detailed design rationale, architecture, and improvement candidates https://claude.ai/code/session_01SgQFN7Mnn9K9B3DAQ4u4eu
…tdown - Binance: separate bookTicker (/public) and markPrice+aggTrade (/market) per 2026 endpoint migration guidance - BookTickerFeed parses unwrapped single-stream JSON - MarketFeed parses combined stream wrapper - Writer: discard buffer after 5 consecutive flush failures (memory guard) - main.py: platform-aware signal handling with KeyboardInterrupt fallback - Bybit: ping_interval configurable via config.yaml - Add .gitignore, config.example.yaml for project scaffolding - Update CLAUDE.md and DESIGN.md with all design decisions https://claude.ai/code/session_01SgQFN7Mnn9K9B3DAQ4u4eu
Major changes: - BinanceFeed: single class managing 2 internal TaskGroup tasks (/public bookTicker + /market markPrice+aggTrade), both combined stream - BaseFeed: add stop_event for cooperative shutdown, get_stats() for monitoring - Writer: stop_event-based run loop, queue drain on shutdown, configurable compression and temp_suffix - main.py: ordered shutdown (feeds→writer drain→stats), periodic stats logging, platform-aware signal handling with KeyboardInterrupt fallback - schema.py: add sequence column (Binance u / Bybit cs) - source_stream format changed to "exchange:stream" (e.g. "binance:bookTicker") - config.yaml: add writer section, queue_maxsize, reconnect, subscribe_args, stats_interval_seconds - BybitFeed: subscribe_args and ping_interval from config https://claude.ai/code/session_01SgQFN7Mnn9K9B3DAQ4u4eu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References