Inspiration
Most high school students have no idea how the stock market works. We sit through economics classes reading textbooks about supply and demand, but when it comes to actually understanding trading, investing, or even reading financial news—we're lost. The problem isn't that finance is too hard. It's that learning from textbooks is boring and doesn't stick.
I wanted to create something that teaches finance the way people actually learn best: by doing it, making mistakes, and getting instant feedback. That's how you learn video games, sports, or any skill that actually matters. So why not finance?
What it does
Bull vs Bear is a multiplayer trading game where you compete against friends (and AI bots) to build the best portfolio. Here's how it works:
Every round, breaking news hits the market—maybe tech stocks are soaring, or crypto is crashing. You have 30 seconds to react: buy the dip, sell before it tanks, or diversify to play it safe. Prices move in real-time based on the news sentiment, just like real markets.
At the end of 5 rounds, you get an AI-powered coach that analyzes your trades and tells you exactly what you did well and where you messed up. It even shows you a "Decision Replay"—what would've happened if you'd bought 10 seconds earlier or sold at a different time.
You're not just playing to win. You're learning concepts like risk management, diversification, sentiment analysis, and timing—all without realizing you're in a finance class.
How we built it
Frontend: React + TypeScript + Tailwind CSS for a clean, responsive UI Backend: Node.js + Express + Socket.IO for real-time multiplayer AI: Google Gemini API for personalized feedback and analysis State Management: Zustand for client-side state Deployment: Netlify (frontend) + Render (backend)
The trickiest part was the price simulation. I needed prices to react realistically to news without being random or exploitable. I built a formula that combines:
- Market drift (natural growth/decay)
- Sentiment scores from news
- Volatility factors per asset type
- Deterministic noise (using sine waves instead of random numbers)
This creates realistic price movements that are fair and reproducible.
Challenges we ran into
1. The Price Algorithm: Making prices feel realistic but stay balanced was brutal. My first version was too random—players complained it felt like gambling. My second version was too predictable—players found exploits. I went through probably 10 iterations before landing on the current formula with deterministic sine waves.
2. Multiplayer State Management: Keeping game state synced across multiple players in real-time was harder than I expected. When one player disconnects mid-game, the game needs to keep running for others. When all players leave, it needs to reset. Getting this logic right with bot players in the mix took a lot of debugging.
3. Making AI Feedback Actually Useful: The first version of AI feedback was super generic—"You should diversify more." Useless. I had to build a detailed context system that tracks every trade, every news event, and every price movement, then feeds that to the AI so it can give specific, actionable advice like "You sold AAPL right before the tech boom in Round 3."
Accomplishments that we're proud of
- It actually teaches finance. I tested it with friends who knew nothing about trading, and after a few games, they were talking about diversification and risk-adjusted returns naturally.
- The AI feedback is legitimately helpful. It doesn't just say "good job"—it analyzes your specific trades and tells you exactly what you could've done better.
- It's fun. This was the goal. Finance education doesn't have to be boring lectures. It can be competitive, fast-paced, and actually engaging.
- It works in production. Fully deployed, multiplayer works smoothly, and the game is stable even with multiple concurrent players.
What we learned
- Real-time multiplayer is hard. Socket.IO makes it easier, but managing game state, handling disconnects, and keeping everything in sync requires careful architecture.
- Balancing game mechanics is an art. Every number—round duration, starting cash, price volatility—affects whether the game feels fair and fun. I spent as much time tuning these as writing code.
- AI is only as good as the context you give it. Generic prompts get generic responses. Building a detailed trading context with news history, trade logs, and patterns made the AI feedback 10x better.
- Education works best when it doesn't feel like education. Players don't think "I'm learning about risk management." They think "I need to beat my friend." But they're learning anyway.
What's next for Bull vs Bear
- Mobile support: Right now it's desktop-only. Making it work on phones would let students play during lunch or between classes.
- Classroom mode: A teacher dashboard where educators can create private games for their class and track student progress.
- More scenarios: Right now there are a few market scenarios. I want to add historical events (2008 crash, COVID market, crypto winter) so students can learn from real history.
- Leaderboards and seasons: Global leaderboards and monthly competitions to keep players coming back.
- More educational content: Tooltips, mini-lessons, and concept explanations built into the game itself.
The goal is to make Bull vs Bear the go-to way high schools teach finance. Not as a supplement to textbooks—as a replacement.
Built With
- express.js
- gemini
- node.js
- react
- socket.io
- tailwind
- typescript
- zustand
Log in or sign up for Devpost to join the conversation.