How balenoanurag/fyers-cas-paper-trader works
This is a mobile PWA for discovering FYERS options and monitoring a paper strategy around 3:20. The documented workflow is: authenticate, discover and select contracts, receive live ticks, persist them, then let a persistent worker evaluate the reference-based strategy and expose status to the UI. The README explicitly says there is no order-placement endpoint. The excerpts are partial, so internal server components are separated by responsibility; uncertain implementation details are omitted.
Main entry points: index.html PWA interface · server.py FastAPI app · manifest.webmanifest PWA manifest · sw.js Service worker
Components 15
Mobile interface
- PWA interface
index.html - PWA manifest
manifest.webmanifest - Service worker
sw.js
Market data
- FastAPI app
server.py - FYERS authentication
server.py - Option discovery
server.py - Contract selection
server.py - WebSocket feed
server.py - Tick handling
server.py
Paper strategy
- Strategy worker
server.py - Reference strategy
server.py - Paper execution
server.py
Persistent state
- Tick database
server.py
Other components
- Phone user
- FYERS services
Connections 17
- Phone user → PWA interface: opens
- PWA interface → FastAPI app: API requests
- PWA interface → PWA manifest: loads
- PWA interface → Service worker: registers
- FastAPI app → FYERS authentication: handles login
- FYERS authentication → FYERS services: authenticates
- FastAPI app → Option discovery: discovers contracts
- Option discovery → FYERS services: requests chain
- Option discovery → Contract selection: provides chain
- Contract selection → WebSocket feed: subscribes contracts
- FYERS services → WebSocket feed: streams ticks
- WebSocket feed → Tick handling: delivers messages
- Tick handling → Tick database: persists ticks
- Strategy worker → Tick database: reads ticks
- Strategy worker → Reference strategy: evaluates strategy
- Reference strategy → Paper execution: records simulation
- PWA interface → FastAPI app: reads status