How marketcalls/openbull works
OpenBull is a self-hosted, multi-user options-trading platform for Indian markets. Users authenticate, configure a broker, then use the web UI or typed API for market data, analytics, and orders; broker plugins normalize account/order operations and stream ticks through a shared WebSocket proxy. Users can switch the same trading paths between live and simulated execution. Separate product branches cover strategy design and automated strategy runs, options analytics, sandbox lifecycle/P&L, and interactive API testing. Edges cite README-documented relationships or shown source references; several subsystem internals were not sampled, so their links are documentation-based.
Main entry points: main.py Web and external API · market_data_cache.py Market data cache · execution_engine.py Sandbox execution · App.tsx Trading UI
Components 22
Client applications
- Trading UI
frontend/src/App.tsx - API Playground
frontend/src/pages/Playground.tsx
API and trading
- Web and external API
backend/main.py - Authentication
backend/routers/auth.py - Trading services
backend/services - Application database
backend/database.py - Redis cache
backend/utils/redis_client.py
Broker integrations
- Broker APIs
backend/broker - Streaming adapters
backend/broker - WebSocket proxy
backend/websocket_proxy/server.py - Broker services
backend/services/market_data_service.py
Strategies
- Strategy builder
backend/services/strategy_builder_service.py - Strategy engine
backend/strategy/engine.py - Strategy webhooks
backend/strategy/webhook_handler.py
Market data and analytics
- Options analytics
backend/services - Market data cache
backend/services/market_data_cache.py
Sandbox trading
- Sandbox service
backend/services/sandbox_service.py - Sandbox execution
backend/sandbox/execution_engine.py - Sandbox books
backend/sandbox
Other components
- Trader
- Broker systems
- PostgreSQL
Connections 25
- Trader → Trading UI: uses
README.md - Trader → API Playground: tests endpoints
README.md - Trading UI → Web and external API: calls web API
- API Playground → Web and external API: tests API
README.md - Web and external API → Authentication: routes auth
README.md - Web and external API → Trading services: dispatches requests
README.md - Trading services → Broker APIs: dispatches broker calls
README.md - Broker APIs → Broker systems: calls
README.md - Broker systems → Streaming adapters: streams ticks
README.md - Streaming adapters → WebSocket proxy: publishes ticks
README.md - WebSocket proxy → Trading UI: streams market data
README.md - Broker services → Market data cache: updates cache
- Web and external API → Strategy builder: routes strategy tools
README.md - Strategy builder → Strategy engine: starts strategy runs
- Strategy webhooks → Strategy engine: dispatches actions
backend/strategy/webhook_handler.py - Strategy engine → Trading services: dispatches orders
backend/strategy/engine.py - Web and external API → Options analytics: serves analytics
README.md - Options analytics → Market data cache: reads ticks
backend/services/sandbox_service.py - Web and external API → Sandbox service: dispatches by mode
README.md - Sandbox service → Sandbox execution: manages execution
backend/services/sandbox_service.py - Sandbox execution → Market data cache: subscribes to ticks
backend/sandbox/execution_engine.py - Sandbox execution → Sandbox books: updates fills and books
backend/sandbox/execution_engine.py - Sandbox books → PostgreSQL: reads and writes
backend/sandbox/_db.py - Application database → PostgreSQL: connects
backend/database.py - Redis cache → Market data cache: backs cache layer
backend/services/market_data_cache.py