Cost-optimized, scheduled automated production runbook for QuadraTrades
The architecture uses an automated scheduled control plane to run strictly during NSE market hours (08:45 to 16:00 IST, Monday through Friday):
| AWS Service | Configuration | Monthly Cost (USD) | Monthly Cost (INR @ ₹84/$) |
|---|---|---|---|
| EC2 Compute | t4g.small ARM64 Graviton2 (159.5 hrs @ $0.0168/hr) |
$2.68 | ₹225 |
| Retained Elastic IP | Static EIP (idle ~570.5 hrs @ $0.005/hr) for FYERS whitelist | $2.85 | ₹239 |
| Encrypted EBS | 30 GiB gp3 root volume @ $0.096/GiB-mo |
$2.88 | ₹242 |
| S3 Storage | Encrypted daily trading journals & audit archives | $0.25 | ₹21 |
| EventBridge + Lambda | Free tier eligible (< 1M requests/mo) | $0.00 | ₹0 |
| AWS Systems Manager | Standard Session Manager (SSM) | $0.00 | ₹0 |
| CloudWatch Logs | Ingestion & 30-day retention | $0.57 | ₹48 |
| TOTAL SCHEDULED PRODUCTION | Full Automated Live Deployment | $9.23 / mo | ~₹775 / mo |
Deploy the complete VPC, EC2 instance, Elastic IP, IAM roles, and EventBridge schedulers:
Query the allocated static IP and paste it into the FYERS order origin IP whitelist:
Start a secure interactive shell without exposing SSH port 22:
Secure private port forwarding for the Live Operational HUD (connect to localhost:8080 on your local machine):
| Time (IST) | Action | Automation Trigger |
|---|---|---|
| 08:45:00 | Instance Boots | EventBridge Rule StartSchedule invokes Control Lambda |
| 08:47:00 | Engine Launches | Host systemd service nifty-runner.service starts engine |
| 09:00:00 | Pre-Market Routine | PreMarketAnalyzer ingests GIFT NIFTY, open interest, and gap levels |
| 09:15:00 | Trading Session Opens | Strategies monitor 5m/3m structure and sub-candle tick liquidity |
| 15:15:00 | Entry Gate Locks | No new trade entries permitted; positions managed dynamically |
| 15:20:00 | Auto-Square-Off | All intraday positions flattened automatically |
| 15:30:00 | EOD Audit & Analysis | Engine generates detailed forensic trade analysis HTML and pushes to Telegram |
| 15:55:00 | Safe-Stop Handshake | SSM command verifies 0 open positions and archives journals to S3 |
| 16:00:00 | Safe Shutdown | EventBridge triggers instance stop. Billing pauses until 08:45 next day. |