How appzfx13/marmot works
Marmot is a trading, quantitative research, and backtesting platform. The principal workflow runs from a trader’s web/API request through Django domain and backtest services, into Go worker pools for strategy execution and optimization, with datasets and Redis carrying data and task/progress messages; results are surfaced through charts and telemetry. Separate capabilities include live market feeds, broker execution and webhook reconciliation, risk configuration, AI-assisted analysis, and notifications. Several Go internals and unsampled Django subsystems are represented at their documented directory level; their detailed call paths are not verified here.
Main entry points: urls.py Django domain · backtest/services.py Backtest services · workers Go worker pools · market/services.py Market services
Components 27
Platform and Accounts
- Django domain
marmot/urls.py - REST API
apps/api/views.py - User accounts
apps/users/models.py - Admin operations
apps/admins/views.py - WebSocket hub
go-app/ws/hub.go
Research and Backtesting
- Backtest services
apps/backtest/services.py - Backtest models
apps/backtest/models.py - Trade analytics
apps/backtest/trade_vector_engine.py - Quant strategies
go-app/strategies/quant_engine.go - Go worker pools
go-app/workers - Chart service
go-app/services/chart_handler.go
Trading and Market Data
- Market services
apps/market/services.py - Market models
apps/market/models.py - Live feed
apps/common/services/live_feed_service.py - Risk and trade config
apps/trade_config/models.py - Broker selection
apps/trade_core/brokers/factory.py - Dhan adapter
apps/trade_core/brokers/dhan.py - Trade scheduler
apps/trade_core/scheduler.py - Webhook reconciliation
apps/postback/services.py
Persistence and Messaging
- Parquet datasets
go-app/parquet - Redis
- PostgreSQL
Integrations and Alerts
- AI analysis
apps/common/services/gemini_service.py - Notifications
apps/notifications/services - Broker services
Other components
- Trader
- Web client
Connections 35
- Trader → Web client: uses
- Web client → Django domain: HTTP / HTMX
- Trader → WebSocket hub: telemetry
- Django domain → REST API: routes requests
- Django domain → Backtest services: serves workflows
- Backtest services → Backtest models: stores tasks
apps/backtest/services.py - Backtest services → Market models: reads market data
apps/backtest/services.py - Backtest services → Market services: calls services
apps/backtest/services.py - Backtest services → Redis: dispatches tasks
- Redis → Go worker pools: dispatches tasks
- Go worker pools → Quant strategies: runs strategies
- Go worker pools → Parquet datasets: reads and writes
- Go worker pools → Redis: publishes progress
- Backtest services → Trade analytics: analyzes trades
- Backtest services → Chart service: requests chart data
- Django domain → User accounts: authenticates
- Django domain → Admin operations: serves admin
- Market services → Market models: reads and writes
apps/market/services.py - Market services → Redis: publishes progress
apps/market/services.py - Live feed → Broker selection: requests trade book
apps/common/services/live_feed_service.py - Live feed → Risk and trade config: reads settings
apps/common/services/live_feed_service.py - Live feed → Redis: caches quotes
apps/common/services/live_feed_service.py - Trade scheduler → Risk and trade config: reads configuration
apps/trade_core/scheduler.py - Trade scheduler → Broker selection: selects broker
- Broker selection → Dhan adapter: creates adapter
apps/trade_core/brokers/factory.py - Broker selection → Broker services: connects broker
- Broker services → Webhook reconciliation: sends webhooks
- Webhook reconciliation → Redis: publishes order events
apps/postback/services.py - Webhook reconciliation → Risk and trade config: uses account data
apps/postback/services.py - AI analysis → Market services: supports analysis
apps/market/services.py - Django domain → Notifications: sends alerts
- Redis → WebSocket hub: relays stream
- WebSocket hub → Web client: streams telemetry
- Django domain → PostgreSQL: persists domain data
- Go worker pools → Parquet datasets: processes datasets