Astro Trader
High-load simulated trading & mining ecosystem inside Telegram.
Astro Trader is a cutting-edge, high-load gamified cryptocurrency mining and simulated trading ecosystem deployed natively as a Telegram Mini App. Capitalizing on the viral Web3 gaming wave of late 2024, the platform allows users to engage in dynamic micro-activities, compete in global leaderboards, and monitor simulated asset charts in real time.
NSWEB stepped in as the core technology and engineering partner for Azulon Studios, which was responsible for the UI/UX and game design, taking full architectural ownership of both the high-frequency frontend client and the enterprise-grade backend infrastructure. Our mission was to build a system capable of handling massive concurrency spikes during viral user acquisition loops while maintaining perfect data synchronization.

1. Astro Trader promo material
The Challenge
Developing within the embedded Telegram Webview container introduces severe device resource constraints. During peak viral loops, thousands of users interact with the app simultaneously, creating unique engineering roadblocks:
- Database Transaction Bottlenecks: Every user "tap" or mining tick triggers a state write request. Processing these millions of micro-transactions directly into a persistent database like MongoDB would instantly lead to server timeouts and deadlocks.
- Webview Performance Degradation: Rendering continuous, real-time price fluctuations and cryptocurrency charts using standard DOM or unoptimized SVG structures caused massive frame drops and battery drain on mid-range mobile devices.
- Vulnerability to Automated Botnets: The clicker and mining mechanics made the application a prime target for automated scripts, macros, and synthetic requests designed to exploit client-side state logic and forge balances.
Our Solutions
Next.js
NestJS
MongoDB
Redis
1. Ultra-Lean Webview Client & Real-Time Canvas Charts
To ensure a premium, liquid-smooth user experience within Telegram, we completely optimized the client-side rendering pipeline.
- Throttled Canvas Rendering: Instead of forcing the DOM to re-render price tickers, we implemented an isolated HTML5 Canvas graphics layer powered by a highly optimized instance of Chart.js.
- 60 FPS Performance: By throttling incoming data streams and using strict React memoization, we achieved a stable 60 FPS chart rendering that operates seamlessly inside both iOS and Android embedded browsers without draining device resources.
- Native Telegram Integration: Fully leveraged the Telegram WebApp SDK to enable zero-touch user authentication via secure
initData, seamless referral link sharing via native deep-linking, and smooth haptic feedback loops for in-game interactions.

2. Real-time candlestick and line chart rendering running at 60 FPS
2. High-Throughput Architecture & Asynchronous Redis Layer
To handle massive concurrent write traffic without increasing infrastructure costs exponentially, we decoupled the presentation and persistence layers.
- In-Memory State Caching: Built an intermediary write-heavy data layer using a Redis Cluster. Active mining sessions, rapid clicker actions, and active user balances are tracked entirely in-memory.
- Debounced Batch Writing: Developed an asynchronous worker inside NestJS that debounces user state changes. Instead of hammering MongoDB with individual writes, the system flushes compiled memory blocks to the database in optimized batches, reducing persistent storage operations by over 85%.

3. Scalable global leaderboard tracking concurrent user states
3. Server-Side Anti-Cheat Engine & Verification
To protect the application's economy, we enforced strict zero-trust validation rules on the backend infrastructure.
- Timestamp Delta Validation: Implemented an anti-cheat verification system within NestJS. Every incoming click or mining reward packet is validated against cryptographic Telegram server signatures and checked with strict timestamp delta constraints to ensure humanly impossible tap speeds or macro patterns are blocked immediately.
- JWT Session Security: Sessions are dynamically verified and bound to unique Telegram user IDs, eliminating the possibility of cross-account script exploits or session hijacking.
The Business Outcome
- Flawless Zero-Downtime Launch: The asynchronous Redis caching architecture successfully absorbed massive concurrent user spikes during primary marketing campaigns with 0% database deadlocks.
- Uncompromised Device Coverage: Retained fluid-smooth animations and UI performance across 100% of tested mobile devices, preserving user engagement and app session times.
- Complete Bot-Net Mitigation: The NestJS anti-cheat engine successfully identified and blocked 100% of automated script exploits, securing the application's data integrity and in-game economy metrics.
- Production-Ready Scalability: Delivered an end-to-end typed, highly modular codebase (
TypeScript) that allowed the client to comfortably scale operations to millions of active sessions.