52 - Broker Factory Implementation
Architecture Overview
┌─────────────────────────────────────────────────────────────┐
│ WebSocket Proxy Server │
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Broker Factory │ │
│ │ create_broker_adapter(broker_name) → Adapter Instance │ │
│ └──────────────────────────┬─────────────────────────────┘ │
│ │ │
│ ┌───────────────────────┼───────────────────────┐ │
│ ▼ ▼ ▼ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Zerodha │ │ Angel │ │ Dhan │ │
│ │ Adapter │ │ Adapter │ ... │ Adapter │ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ └───────────────────┼──────────────────────┘ │
│ │ │
│ ▼ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ Base Broker WebSocket Adapter │ │
│ │ • initialize() • connect() • subscribe() │ │
│ │ • disconnect() • unsubscribe() • on_data() │ │
│ └────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘Broker Factory
Base Adapter Interface
Broker-Specific Adapters
Zerodha Adapter
Angel Adapter
Dhan Adapter
Supported Brokers (29)
Broker
Max Symbols
Depth Levels
Notes
Data Normalization
Connection Pooling
Usage in Application
Key Files
File
Purpose
Adding a New Broker
Last updated