How dsrsubbu/openalgo works
OpenAlgo is a self-hosted algorithmic trading platform spanning broker-connected APIs, hosted and visual strategies, AI-assisted trading, analytics, and simulated execution. A typical journey enters through an API, strategy surface, or user interface; market and symbol data inform analysis and order decisions; broker adapters provide live trading, while sandbox components support simulation. The graph combines README-documented capabilities with sampled implementation evidence. Several feature modules are represented at directory level because their source was not sampled; those links are dashed where implementation wiring is unverified.
Main entry points: market_data_service.py Market data service · app.py Flask application · orders.py Unified REST API · agent.py AI agent
Components 23
Application entry
- Flask application
app.py - Unified REST API
blueprints/orders.py
Strategy surfaces
- Python strategy host
blueprints/python_strategy.py - Visual Flow
services/flow_executor_service.py - AI agent
blueprints/agent.py - Strategy module engine
services/strategy_module/engine.py
Market and analytics
- Market data service
services/market_data_service.py - Symbol lookup
database/symbol.py - Token cache
database/token_db_enhanced.py - Options and portfolio tools
blueprints - Arbitrage scanner
services/arbitrage_service.py
Execution
- Order analyzer
blueprints/analyzer.py - Broker plugins
broker - Sandbox order manager
sandbox/order_manager.py - Sandbox execution
sandbox/execution_engine.py - Sandbox funds
sandbox/fund_manager.py
Platform services
- Sandbox records
database/sandbox_db.py - Broker sessions
database/auth_db.py - WebSocket proxy
websocket_proxy/server.py - Alerts and webhooks
services/alerts/router.py - MCP integration
services/agent/mcp/client.py - Event bus
utils/event_bus.py
Other components
- Trader or client
Connections 27
- Trader or client → Flask application: uses
README.md - Flask application → Unified REST API: registers
app.py - Flask application → Python strategy host: registers
app.py - Flask application → AI agent: registers
app.py - Trader or client → Visual Flow: builds strategies
README.md - Trader or client → Options and portfolio tools: analyzes markets
README.md - Unified REST API → Order analyzer: may analyze orders
README.md - Python strategy host → Order analyzer: may analyze orders
README.md - Visual Flow → Order analyzer: may analyze orders
README.md - Unified REST API → Broker plugins: dispatches trades
- Unified REST API → Market data service: requests data
- AI agent → Market data service: reads market data
README.md - AI agent → Broker plugins: approved orders
README.md - Strategy module engine → Broker plugins: dispatches orders
services/strategy_module/engine.py - Market data service → WebSocket proxy: serves streaming
services/market_data_service.py - Options and portfolio tools → Market data service: streams live data
- Arbitrage scanner → Symbol lookup: reads contracts
services/arbitrage_service.py - Symbol lookup → Token cache: uses token lookup
database/symbol.py - Sandbox order manager → Sandbox funds: checks margin
sandbox/order_manager.py - Sandbox order manager → Sandbox records: writes orders
sandbox/order_manager.py - Sandbox execution → Sandbox order manager: processes pending orders
sandbox/order_manager.py - Sandbox execution → Sandbox records: reads pending orders
sandbox/execution_engine.py - Sandbox execution → Market data service: fetches quotes
- Broker plugins → Broker sessions: uses sessions
broker/upstox/streaming/upstox_client.py - Alerts and webhooks → Trader or client: sends notifications
- AI agent → MCP integration: offers MCP access
- Sandbox order manager → Event bus: publishes updates
sandbox/order_manager.py