Skip to content

Claude/btc futures price feed 932 d6#1920

Open
SelfAIautomation wants to merge 6 commits intonpm:mainfrom
SelfAIautomation:claude/btc-futures-price-feed-932D6
Open

Claude/btc futures price feed 932 d6#1920
SelfAIautomation wants to merge 6 commits intonpm:mainfrom
SelfAIautomation:claude/btc-futures-price-feed-932D6

Conversation

@SelfAIautomation
Copy link

References

claude added 2 commits March 21, 2026 05:02
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
@SelfAIautomation SelfAIautomation requested a review from a team as a code owner March 21, 2026 09:20
claude added 4 commits March 21, 2026 09:53
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
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