How maxrindia/jettone-copy-trading- works
Jettone is an Alice Blue copy-trading platform: an owner configures demat accounts and master/follower strategies, then the live engine detects master orders, validates and sizes copies, dispatches them to child accounts, and records outcomes. The web app also exposes order, reconciliation, dashboard/P&L, and reliability controls. The README documents the product workflow; source excerpts and the SOURCE INDEX establish the main runtime wiring. Some API, reliability, and UI implementation details were not sampled, so uncertain links are omitted.
Main entry points: engine_loop.py Runtime engine · route.ts API proxy · pipeline.py Copy execution pipeline · service.py P&L service
Components 28
Web application
- Demat accounts
frontend/src/app/(app)/demat/page.tsx - Group strategies
frontend/src/app/(app)/group-strategy/page.tsx - Trading dashboard
frontend/src/app/(app)/page.tsx - Order manager
frontend/src/app/(app)/orders/page.tsx - Reconciliation view
frontend/src/app/(app)/reconciliation/page.tsx - API proxy
frontend/src/app/api/v1/[...path]/route.ts
API and account setup
- FastAPI application
backend/app/main.py - API routes
backend/app/api - Account records
backend/app/models/accounts.py - Strategy records
backend/app/models/strategies.py
Live trading
- Runtime engine
backend/app/services/runtime/engine_loop.py - Broker manager
backend/app/services/alice_blue/manager.py - Alice Blue client
backend/app/services/alice_blue/client.py - Master order detector
backend/app/services/copy_engine/detector.py - Copy execution pipeline
backend/app/services/copy_engine/pipeline.py - Copy sizing
backend/app/services/copy_engine/calculator.py - Alice Blue broker
Persistence and insights
- P&L service
backend/app/services/pnl/service.py - P&L calculator
backend/app/services/pnl/calculator.py - Database access
backend/app/core/database.py - Orders and audit records
backend/app/models/trades.py - System event records
backend/app/models/audit.py - PostgreSQL
- Redis cache and pub/sub
backend/app/core/redis.py
Safety and monitoring
- Reconciliation and recovery
backend/app/services/reliability - Event notifier
backend/app/services/monitoring/notifier.py - Telegram alerts
backend/app/services/monitoring/telegram.py
Other components
- Platform owner
Connections 34
- Platform owner → Demat accounts: adds accounts
- Platform owner → Group strategies: configures strategy
- Platform owner → Trading dashboard: reviews activity
- Platform owner → Order manager: reviews executions
- Platform owner → Reconciliation view: checks positions
- Demat accounts → API proxy: sends API requests
- Group strategies → API proxy: sends API requests
- Trading dashboard → API proxy: requests dashboard data
- Order manager → API proxy: requests order data
- Reconciliation view → API proxy: requests reconciliation
- API proxy → FastAPI application: proxies requests
- FastAPI application → API routes: registers routes
backend/app/main.py - API routes → Account records: manages accounts
backend/app/api/dashboard.py - API routes → Strategy records: manages strategies
backend/app/api/dashboard.py - FastAPI application → Runtime engine: starts runtime
backend/app/main.py - Runtime engine → Broker manager: uses account clients
backend/app/services/runtime/engine_loop.py - Broker manager → Alice Blue client: creates clients
backend/app/services/alice_blue/manager.py - Alice Blue client → Alice Blue broker: sends broker requests
- Runtime engine → Master order detector: processes order events
backend/app/services/runtime/engine_loop.py - Runtime engine → Copy execution pipeline: dispatches copies
backend/app/services/runtime/engine_loop.py - Copy execution pipeline → Copy sizing: calculates quantities
backend/app/services/copy_engine/pipeline.py - Copy execution pipeline → Alice Blue client: places child orders
backend/app/services/copy_engine/pipeline.py - Runtime engine → Orders and audit records: persists order events
backend/app/services/runtime/engine_loop.py - Copy execution pipeline → Orders and audit records: records executions
backend/app/services/copy_engine/pipeline.py - Trading dashboard → P&L service: displays P&L
- P&L service → P&L calculator: calculates P&L
backend/app/services/pnl/service.py - P&L service → Alice Blue client: reads broker data
- Reconciliation view → Reconciliation and recovery: requests safety audit
- Runtime engine → Reconciliation and recovery: runs recovery loops
backend/app/services/runtime/engine_loop.py - P&L service → Event notifier: alerts mismatches
backend/app/services/pnl/service.py - Event notifier → System event records: persists events
backend/app/services/monitoring/notifier.py - Event notifier → Telegram alerts: dispatches alerts
backend/app/services/monitoring/notifier.py - Database access → PostgreSQL: connects to
backend/app/core/database.py - Runtime engine → Redis cache and pub/sub: uses runtime messaging