How ashraful3ra/polytrade works
PolyTrade is a web dashboard for managing Binance USD-M futures accounts and trades. Users add encrypted exchange credentials, select symbols and trade settings, submit orders, then poll positions and ROI or close trades; they can also save and reuse settings templates. Flask routes orchestrate the browser-facing workflows, while Binance and database access are delegated to utility modules. The excerpts show these main paths, but not every route or template detail, so the graph omits uncertain wiring.
Main entry points: app.py Flask routes · account.js Account management · dashboard.js Trading dashboard · db.py Database access
Components 13
Web interface
- Account management
static/js/account.js - Trading dashboard
static/js/dashboard.js - Account page
templates/account.html - Dashboard page
templates/dashboard.html - Login page
templates/login.html
Flask application
- Flask routes
app.py
Runtime services
- Database access
utils/db.py - Credential encryption
utils/crypto.py - Binance client
utils/binance.py
External systems
- MySQL database
- Binance Futures API
- JWT identity provider
Other components
- User
Connections 14
- User → Account management: manages accounts
- User → Trading dashboard: trades
- Flask routes → Account page: renders
- Flask routes → Dashboard page: renders
- Flask routes → Login page: renders
- Account management → Flask routes: account requests
- Trading dashboard → Flask routes: trade requests
- Flask routes → Database access: queries and writes
- Database access → MySQL database: reads and writes
- Flask routes → Credential encryption: encrypts credentials
- Flask routes → Credential encryption: decrypts credentials
- Flask routes → Binance client: calls exchange methods
- Binance client → Binance Futures API: REST requests
- Flask routes → JWT identity provider: validates JWT