← ~/blog

Building tradegame.org — A Risk-Free Crypto Trading Simulator

The idea

I've been trading for years — you can find me on TradingView as crypto_poet. But I kept running into the same problem when friends asked how to get started: there's no good way to practise without putting real money on the line.

I wanted to build a free trading simulator anyone could use to learn the basics. My first instinct was stocks, but reliable stock market data requires expensive paid plans that don't make sense for a free product. Crypto market data, on the other hand, is freely available — so I went with that.

The result is tradegame.org — a crypto trading simulator where you start with $100,000 in virtual cash and trade against real market data. No sign-up fees, no real money, no risk.

How it works

The app pulls live prices from CoinGecko across an extensive list of cryptocurrencies — not just the top 10, but a broad selection you can browse on the market page. You buy and sell with your virtual balance, and a persistent leaderboard tracks everyone's total portfolio value. Whoever makes the most money wins — no resets, no gimmicks.

If your trades go sideways, you can choose to reset your account back to $100k and start fresh. But the leaderboard stays intact — it's a real competition.

The core loop is simple: check prices, make a trade, watch your portfolio. But the learning happens in the patterns — you start recognising momentum, understanding spreads, and developing instincts about when to hold and when to cut losses.

The stack

The backend is Python with FastAPI, serving a React frontend. Market data comes from the CoinGecko API, and PostgreSQL handles user portfolios and trade history. The whole thing runs in Docker containers, same as everything else I deploy.

I chose FastAPI over Flask for this one because the async support made handling concurrent price updates and trade executions much cleaner. The WebSocket-friendly architecture also opened the door for real-time price feeds down the line.

What I learned

Building a trading simulator forces you to think about problems you don't encounter in typical CRUD apps:

  • Race conditions — what happens when two trades execute against the same balance simultaneously?
  • Data freshness — how stale can a price be before a trade becomes unfair?
  • Leaderboard performance — recalculating portfolio values across all users adds up fast when the crypto list is large

The voluntary reset mechanic was an important design choice. Without it, a bad run of trades could leave someone stuck with no buying power and no way to recover. Letting users reset to $100k keeps the learning going without undermining the leaderboard's integrity.

Try it

The app is live at tradegame.org. Start with $100k, make some trades, see where you land on the leaderboard. No account needed to browse — and if things go wrong, you can always reset and try again.