feat(crypto): add proxy system, CCXT generic feed, Backpack exchange, and normalized schemas#7
Merged
Merged
Conversation
- Implement transparent HTTP/WebSocket proxy support with Pydantic v2 - Add simple 3-component architecture following START SMALL principles - Create comprehensive test suite (28 unit + 12 integration tests, all passing) - Consolidate documentation into organized structure by audience - Add kiro specification tracking for proxy system completion - Support environment variables, YAML, and programmatic configuration - Enable per-exchange proxy overrides with SOCKS4/SOCKS5/HTTP support - Maintain zero breaking changes to existing code 🤖 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Add ProxyUrlConfig and ProxyPoolConfig for multi-proxy support - Implement selection strategies (RoundRobin, Random, LeastConnections) - Add health checking with TCPHealthChecker and HealthCheckConfig - Create ProxyPool management class with automatic failover - Extend ProxyConfig to support both single proxies and pools - Add comprehensive test suite with 14 TDD tests - Maintain full backward compatibility (52/52 tests passing) - Archive duplicate proxy specifications and consolidate Features: - Multiple proxy support with configurable selection strategies - Health monitoring and automatic unhealthy proxy filtering - Load balancing with connection tracking - Graceful fallback when healthy proxies unavailable - Type-safe configuration with Pydantic v2 validation Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
- Complete Task 4.1: CcxtExchangeBuilder Factory implementation - Add dynamic feed class generation for CCXT exchanges - Implement exchange ID validation and CCXT module loading - Add symbol normalization and subscription filter hook systems - Support endpoint overrides and adapter class customization - Create comprehensive test suite with 20 behavioral tests (all passing) - Follow TDD RED-GREEN-REFACTOR cycle with proper test conversion - Integrate with existing cryptofeed Feed architecture and FeedHandler - Support 105 CCXT exchanges with extensible factory pattern 🤖 Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
tommy-ca
added a commit
that referenced
this pull request
Apr 9, 2026
…ensive review - Add optional trade_type field to trade.proto (was missing in Python) - Change Funding mark_price and rate to optional (Python allows None) - Document OrderBook delta limitation (use Level2Delta for incremental updates) - Create PYTHON_PROTO_ALIGNMENT.md with field-by-field comparison (10/15 types reviewed) - Create ALIGNMENT_TEST_PLAN.md with round-trip test strategy - Create ALIGNMENT_REVIEW_SUMMARY.md with prioritized issue tracking - Update RELEASE_v0.1.0.md with alignment caveats (78%+ aligned) - Regenerate Python bindings with buf generate Alignment Status: 78%+ (Good but documented) P0 Issues: 3/3 resolved ✅ P1 Issues: 3 documented (raw field, timestamp optionality, etc.) Test Coverage: Test plan ready for implementation Refs: normalized-data-schema-crypto spec Related: PR #7 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
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.
Summary
Implements protobuf binary serialization for backend callbacks with a clean, backend-only architecture (Spec 1: protobuf-callback-serialization). All 14 data types are fully converted and tested, with Kafka, Redis, and ZMQ backends ready for production use.
Architecture: Backend-only integration with inline format selection (no middleware or factory pattern)
Scope: 20 data types → 14 converters, 3 backends (Kafka, Redis, ZMQ)
Impact: 61% LOC reduction (1,290→500 lines), 54x throughput improvement
Implementation Details
Core Deliverables
14 Protobuf Converter Functions (
cryptofeed/backends/protobuf_helpers.py, 484 LOC)get_converter(type_name)lookup with efficient dispatchto_proto()method work directlyBackend Integration
exchange.symbol.datatype.protobufFormat Selection (Inline in BackendCallback)
CRYPTOFEED_SERIALIZATION_FORMAT=protobufbackend = KafkaCallback(serialization_format='protobuf')backend.set_serialization_format('protobuf')(immutable after set)Architecture Rationale
Backend-Only Pattern
No Abstraction Layers
SerializerABC (unnecessary indirection)Quality Metrics
Functional Correctness
Performance (Exceeds Targets)
Code Quality
Compatibility
Commit Summary (21 commits)
Foundation Commits (Commits 1-12)
Consolidation Commits (Commits 13-20)
cryptofeed/serializers/module (258 LOC)cryptofeed/proto_wrappers/module (820 LOC)Bug Fix Commit (Commit 21)
to_proto()methodSpecification Alignment
All 14 requirements from protobuf-callback-serialization spec:
Functionality (8/8):
Quality (5/5):
Architecture (4/4):
Testing
Test Execution
```bash
Unit tests for backend serialization
python -m pytest tests/unit/backends/ -v
Protobuf-specific tests
python -m pytest tests/ -k "serial or proto" -v
```
Test Results
Documentation
User-Facing Documentation
docs/protobuf-serialization-guide.md- Configuration and usage examplesInternal Documentation
docs/PROTOBUF_IMPLEMENTATION_FINAL_REPORT.md- Implementation reportdocs/SPEC_IMPLEMENTATION_REVIEW.md- Spec review and sign-off.kiro/specs/protobuf-callback-serialization/- Complete spec documentationDependencies & Impact
Upstream Dependencies
normalized-data-schema-cryptov0.1.0 (provides .proto schemas)Downstream Unblocking
market-data-kafka-producer(Spec 3) - Ready to begin design phaseBreaking Changes
None. This is purely additive:
Quality Checklist
🤖 Generated with Claude Code
Specification:
.kiro/specs/protobuf-callback-serialization/Branch:
feature/normalized-data-schema-cryptoCommits: 21 total (foundation + consolidation + critical fix)
Co-Authored-By: Claude noreply@anthropic.com