FinSim — Project Story
Inspiration
The journey of FinSim began with a simple but powerful realization: financial literacy is best taught through experience, not just theory. Our story started at a high school in Thailand, where we launched a pilot investment simulation workshop in collaboration with the Bank of Thailand (Southern Region Office). Back then, the game was built using humble tools like Google Forms and Google Sheets — yet the impact was profound. We witnessed participants navigating complex scenarios and experiencing the genuine rush of reacting to "breaking news" in real-time. Students who had never opened a financial newspaper were suddenly debating interest rate hikes, hedging strategies, and the ripple effects of geopolitical conflict on commodity prices.
The success of that pilot proved there was a massive, unmet demand for interactive financial education — not just in classrooms, but across all demographics. It inspired us to evolve from manual spreadsheets to a dedicated, high-performance web platform that brings high-stakes market simulation to everyone's fingertips.
By transforming global news into a playable experience, we have created a vital bridge between theoretical knowledge and the volatile reality of the markets. This platform serves as a "financial sandbox" where anyone, regardless of age or background, can experiment with diverse investment strategies in a risk-free environment. It allows users to make mistakes and learn from market cycles without any real-world financial consequences, fostering the emotional resilience needed to stay calm during actual volatility.
More than just a game, this digital evolution democratizes financial intelligence by removing the "barrier of boredom" and replacing it with intuitive, news-driven gameplay. It provides instant, data-driven feedback that helps users refine their instincts — turning every headline into a lesson and every decision into a step toward lifelong financial mastery.
What It Does
Real-Time Market Simulation: The platform hosts live investment sessions where users react to a series of dynamic news scenarios that directly impact asset prices across 7 distinct asset classes — including stocks, bonds, commodities, crypto, real estate, gold, and cash equivalents. Each asset responds differently to macroeconomic shifts, rewarding players who understand the underlying relationships.
News-Driven Gameplay: Unlike static simulators, our macro-economic engine triggers "breaking news" events — ranging from geopolitical crises and central bank policy announcements to pandemic outbreaks and tech sector disruptions — forcing players to interpret information and act quickly. Each headline carries mathematically modeled consequences: an interest rate hike might boost bank stocks while crushing growth tech and real estate. The engine ensures no two sessions feel the same.
AI-Powered Analysis with Google Gemini: At the end of each session, Google Gemini AI evaluates every player's performance across multiple institutional-grade metrics — including Sharpe Ratio, maximum drawdown, sector diversification, and crisis survival rate. It then generates a personalized performance critique with letter grades and strategic recommendations, transforming raw data into actionable financial wisdom.
Virtual Portfolio Management: Users can buy, sell, and manage a diverse portfolio of over 70 real-world assets (AAPL, NVDA, BTC, Gold, Treasury Bonds, and more) in a risk-free environment, allowing them to test contrarian strategies, momentum plays, and defensive positioning without any real-world financial consequences.
Synchronized Multiplayer Rooms: Powered by Socket.IO technology, the platform supports dedicated game rooms where all participants receive updates and news at the exact same millisecond, creating a competitive and fair environment. A facilitator controls the session flow — starting rounds, triggering news, and monitoring player progress in real-time from a dedicated admin dashboard.
Instant Performance Analytics: Beyond the AI grading, the platform provides a detailed breakdown of the user's decisions — showing how their reactions to specific news headlines affected their overall portfolio growth, with interactive charts powered by Recharts that visualize price movements, allocation shifts, and ranking trajectories throughout the game.
How We Built It
Building FinSim required us to architect a system that could handle the unique demands of a real-time, multiplayer financial simulation — where milliseconds matter and every player must experience the same market reality simultaneously.
Architecture & Monorepo Strategy We adopted a Turborepo monorepo structure, splitting the codebase into clearly defined packages:
Package Purpose apps/web Next.js 14 frontend (player & facilitator interfaces) apps/api NestJS 10 backend (game engine, auth, WebSocket gateway) packages/database Prisma ORM schema & database client packages/engine Core macro-economic simulation logic packages/ui Shared React component library This architecture allowed us to iterate on the game engine independently from the UI, share type definitions across the stack, and maintain a single source of truth for our database schema.
Frontend — The Trading Floor The player-facing interface is built with Next.js 14 (App Router) and React 18, delivering server-side rendering for fast initial loads and client-side navigation for a seamless, app-like experience. The visual design follows a "Cyber-Terminal" aesthetic — dark backgrounds, neon accent colors, and monospaced typography — designed to evoke the intensity of a real trading desk.
Key frontend technologies:
Framer Motion — Every price tick, news flash, and countdown timer is animated with spring-based physics, making the interface feel alive and responsive. Recharts — Portfolio performance, asset price histories, and leaderboard rankings are rendered with interactive, real-time updating charts. Socket.IO Client — A persistent WebSocket connection ensures that market updates, round transitions, breaking news, and leaderboard changes arrive at every player's screen simultaneously — with zero polling overhead. Zustand — Lightweight global state management keeps the UI responsive even when processing rapid-fire market events. Backend — The Game Engine The API server is powered by NestJS 10, chosen for its modular architecture that cleanly separates concerns:
Macro-Economic Engine: The heart of the simulation. A deterministic pricing model calculates how each asset responds to three core macroeconomic variables — interest rates ($r$), inflation ($\pi$), and GDP growth ($g$). Each asset has unique sensitivity coefficients: $$\Delta P_i = P_i \times \left( \beta_{r,i} \cdot \Delta r + \beta_{\pi,i} \cdot \Delta \pi + \beta_{g,i} \cdot \Delta g + \epsilon_i \right)$$
where $\beta_{r,i}$, $\beta_{\pi,i}$, and $\beta_{g,i}$ are asset-specific sensitivity factors (e.g., tech stocks have high negative $\beta_r$ because rising rates crush growth valuations), and $\epsilon_i$ introduces controlled randomness to simulate market noise.
WebSocket Gateway: A dedicated Socket.IO gateway manages the entire game lifecycle — player joins, round starts/ends, trade submissions, timer ticks, news broadcasts, and leaderboard updates. All events are pushed server-to-client, eliminating the latency inherent in polling-based architectures.
News Generation with Google Gemini: When a facilitator triggers a scenario (e.g., "Tech Crisis" or "Geopolitical Meltdown"), the engine calls the Google Gemini API (gemini-2.0-flash) to generate contextually rich, realistic news headlines and summaries. These aren't random — they're tied to the specific macroeconomic shifts the engine is applying, creating a coherent narrative that teaches players to connect headlines to market movements.
Authentication & Authorization: The platform supports dual authentication paths — guest access (instant join with a 6-character invite code for workshop participants) and staff login (email/password with bcrypt hashing and JWT tokens for facilitators and administrators). This ensures frictionless onboarding for students while maintaining administrative security.
Database & Persistence All game state — sessions, portfolios, individual trades, macro conditions, asset prices, and audit logs — is persisted in PostgreSQL hosted on Supabase, accessed through Prisma ORM. The schema tracks over 70 real-world assets with their baseline prices and macroeconomic sensitivity coefficients, enabling the engine to simulate realistic, differentiated price movements across sectors.
Testing & Quality Assurance End-to-end test suites are written with Playwright, simulating complete game sessions — from authentication through multi-round trading to final portfolio evaluation — catching regressions before they reach players. We also built custom stress-testing scripts (e2e-loop.ts, e2e-macro.ts) that simulate high-concurrency scenarios to validate our WebSocket infrastructure under load.
Challenges We Ran Into
Challenge 1: Real-Time Synchronization Transitioning from a manual setup to a dynamic web platform brought our most significant technical challenge: real-time synchronization. In our early development phases, we encountered severe server bottlenecks when managing concurrent game rooms. Using traditional HTTP requests caused lag in news delivery and portfolio updates, which broke the fast-paced, immersive nature of the game. When multiple users joined a room simultaneously, the server struggled to keep everyone in sync — some players would see news 2–3 seconds before others, creating an unfair advantage. To solve this, we pivoted our architecture to implement WebSockets (Socket.IO). By establishing a persistent, two-way communication channel, we moved away from delayed request-response cycles to a "push-based" system. This allowed us to handle high-concurrency game rooms with ease, ensuring that every participant receives "breaking news" and market updates at the exact same millisecond. This technical pivot didn't just fix our server issues; it transformed the platform into a truly responsive, high-performance financial simulator.
Challenge 2: Deterministic Yet Realistic Pricing Creating a pricing model that was both mathematically deterministic (so facilitators could predict and control session outcomes) and realistic enough to teach genuine financial intuition was a delicate balancing act. If prices moved too predictably, players would learn the wrong lessons. If they were too random, the educational value would be lost. We solved this by implementing asset-specific sensitivity coefficients calibrated against real-world sector behavior — tech stocks crash when rates rise, gold surges during uncertainty, bonds rally during deflation — combined with a controlled noise factor ($\epsilon$) that introduces just enough unpredictability to simulate genuine market conditions.
Challenge 3: Balancing Accessibility and Depth Our platform needed to be instantly accessible to high school students who had never seen a stock ticker, while simultaneously deep enough to engage university-level economics students. We addressed this through progressive disclosure in the UI — beginners see simplified buy/sell actions and clear news headlines, while advanced users can dive into portfolio analytics, Sharpe Ratios, and sector allocation charts. The AI-powered post-game analysis bridges both levels by explaining why certain decisions worked or failed in plain, actionable language.
Accomplishments That We're Proud Of
We take immense pride in the milestones we've reached, as they represent not just technical growth, but a real-world impact on financial education.
Transitioning to a Custom Web Platform: We successfully moved from a manual, spreadsheet-based system using Google Forms to a custom-built web application. By implementing Socket.IO technology, we resolved previous real-time synchronization issues, ensuring that every player in a game room receives updates simultaneously and without lag. The platform now supports over 70 tradable assets across 7 asset classes — a far cry from the 5 simple options we offered in our spreadsheet days.
Integrating AI-Powered Evaluation: By leveraging Google Gemini AI, we moved beyond simple profit-based rankings to institutional-grade performance evaluation. Players now receive personalized critiques that analyze their Sharpe Ratio, drawdown management, diversification strategy, and crisis response — metrics used by real hedge funds and asset managers. This transforms a fun game into a genuinely educational tool that teaches risk-adjusted thinking.
Creating Genuine Engagement: We have seen a clear, measurable shift in how participants interact with financial news when it is presented through gameplay. By turning "dry" economic data into interactive, high-stakes scenarios, we've helped users of various ages practice making strategic decisions and managing their emotional reactions to market volatility. Students who initially panicked at the sight of red numbers learned, over multiple rounds, to see downturns as buying opportunities — a critical mindset shift for real-world investing.
Scaling Beyond the Classroom: What began as a local workshop in a single high school in Southern Thailand is now a scalable digital tool. Moving to a web platform means our simulation is no longer limited to a single physical location; it is now accessible to anyone with a browser and an internet connection, regardless of their background, location, or prior experience.
Building a Production-Grade Architecture: The decision to use a Turborepo monorepo with shared packages means our codebase is modular, maintainable, and ready to scale. The separation between the game engine, API layer, and frontend allows each component to evolve independently — a critical design choice as we prepare for larger deployments with the Bank of Thailand.
What We Learned
Developing this platform taught us that technical stability is the foundation of an immersive simulation. We learned that traditional web requests were insufficient for high-stakes, time-sensitive environments, leading us to implement WebSockets to ensure every player experiences market changes in real-time. The difference between a 200ms delay and a 0ms push might seem trivial on paper, but in a competitive trading simulation, it's the difference between immersion and frustration.
Beyond the technology, we discovered that financial literacy is deeply rooted in psychology. The game is as much about managing emotions — fear during crashes, greed during rallies, impatience during sideways markets — as it is about understanding numbers. Players who performed best weren't necessarily those with the most financial knowledge, but those who stayed rational under pressure and made data-driven decisions when headlines screamed panic.
We also learned the power of AI as an educational amplifier. Raw performance data (returns, drawdowns, allocation percentages) is meaningless to most beginners. But when Google Gemini translates that data into natural language — "Your heavy tech allocation left you vulnerable to the rate hike in Round 3. Consider diversifying into bonds as a hedge next time" — the learning becomes immediate and actionable.
Most importantly, starting with a simple Google Forms pilot validated our concept early and at near-zero cost. It proved that participants learn far more effectively when they are forced to act on news rather than just study it. That single insight — learning by doing, under pressure, with real consequences (even if simulated) — has guided every architectural and design decision we've made since.
What's Next for FinSim
We are part of a team of university representatives collaborating with the Bank of Thailand (Southern Region Office) to provide financial literacy workshops across Southern Thailand. Our next stage is to bridge the gap between our pilot success and a professional-grade educational tool ready for institutional deployment.
Immediate next steps:
Bank of Thailand Presentation: We plan to present the new web platform to the Bank of Thailand to gather expert feedback and refine its features based on real-world economic insights and regulatory perspectives.
Enhanced Scenario Library: We will expand our scenario engine to include more diverse economic events — from emerging market currency crises to climate-driven commodity shocks — creating a richer, more comprehensive learning experience.
Mobile-First Optimization: While the current platform works on mobile browsers, we plan to optimize the trading interface specifically for touch interactions, making it even more accessible for workshop environments where participants may be using phones or tablets.
Workshop Deployment: Once these improvements are integrated and validated by financial experts, we will officially deploy the platform in our upcoming community workshops — bringing AI-powered, real-time financial education to students, young professionals, and community members across Thailand.
Our ultimate vision is simple: to make every person a more confident, informed financial decision-maker — one simulated headline at a time.
Built With
- framer-motion
- google-gemini-ai
- nestjs
- next.js
- playwright
- postgresql
- prisma
- react
- recharts
- socket.io
- supabase
- turbor
- typescript
Log in or sign up for Devpost to join the conversation.