Skip to content
r/adithya.
All projects
Browser game · Live2 min read

Chart Climber — Ride the Market

A browser bike game where real stock and crypto price history becomes the terrain: rallies are climbs, crashes are downhill runs.

From price chart to playable terrain
  1. Market historyAPI or bundled data
  2. TerrainPercentage-based slopes
  3. RidePhysics + Canvas

Relative price movements shape the hills across eight stock and crypto assets.

Overview

Chart Climber turns market charts into a bike game. Pick a stock or cryptocurrency and a time range, and its real price history becomes the track: every rally is a hill to climb and every crash is a descent. Collect coins, manage fuel, land flips, and set a high score.

Features

  • Eight assets across US stocks, Indian stocks, and cryptocurrency.
  • Four time ranges, from one month to five years.
  • Physics-based riding with collisions, flips, and stunt scoring.
  • Coins and fuel to keep each run strategic.
  • Global leaderboards and saved personal bests.
  • Keyboard and touch controls, with light and dark themes.

How it works

  1. Price history is fetched from CoinGecko or Twelve Data, with caching and bundled historical data as a fallback.
  2. Percentage price changes are converted into terrain slopes, so every asset rides consistently whatever its price level.
  3. Matter.js simulates the bike, and Canvas draws each frame with requestAnimationFrame and a tracking camera.
  4. Scores are saved to a PostgreSQL leaderboard through Next.js API routes.

Tech stack

  • Framework: Next.js, React, TypeScript
  • Game engine: Matter.js physics, HTML Canvas
  • State: Zustand, localStorage for personal bests
  • Data: Neon serverless PostgreSQL, CoinGecko and Twelve Data APIs

Engineering highlights

Fair terrain for every asset. Building slopes from relative movement rather than absolute price means a $10 stock and a $60,000 coin produce comparable rides.

Always playable. Cached responses and bundled historical data keep the game running even when a market API fails.

Clean separation. Physics, rendering, state, and persistence are independent layers, which keeps the game loop fast and the code easy to extend.

Built withNext.jsTypeScriptMatter.jsCanvasPostgreSQL

Write-up updated .

Vote

Your vote stays in this browser.

Let's talk about it

Ask u/adithya-bot about this post. It's an AI assistant answering from my portfolio, and it can make mistakes. This conversation is private to your visit.

0/500

Keep exploring