BTX Exchange
BTX Stock Exchange
BTX (BizTech Exchange) is a simulated stock market where event attendees trade virtual shares of Kickstart startup projects. Think of it like a mini stock exchange where each project is a "stock" with a ticker symbol, and attendees start with virtual cash to buy and sell shares.
Prices move based on supply and demand (how many people buy vs. sell), and there's even random "drift" to make the charts look realistic. It's a fun, gamified way to get attendees engaged with Kickstart projects.
How It Works (The Big Picture)
- Admin creates projects → Each Kickstart team becomes a "stock" with a ticker symbol (e.g.,
$TEAM1) - Attendees get virtual cash → Everyone starts with $2,500 in virtual money
- Attendees buy/sell shares → Prices move based on net demand
- Real-world events affect prices → Judges can trigger "phase bumps" (e.g., "MVP shipped" → price jumps 30%)
- Investments affect prices → When real investment money flows to a team, their stock price rises
- Leaderboard → Top traders are ranked by portfolio value
Admin creates projects → Attendees trade → Prices move → WebSocket broadcasts updates → Charts update live
Key Files
Backend (services/btx/)
| File | What it does |
|---|---|
handler.js | All HTTP + WebSocket endpoint handlers |
helpers.js | Core business logic: trade execution, price calculation, drift, broadcasting |
constants.js | Configuration: initial cash, price sensitivity, phase bumps, drift settings |
serverless.yml | API routes, DynamoDB table definitions, IAM permissions |
Frontend
| File | What it does |
|---|---|
src/pages/btx.tsx | Main exchange page (~2900 lines) with market view, trading UI, charts, portfolio |
src/features/kickstart/2025/btx/BtxStockChart.tsx | Reusable price chart component using Recharts |
src/hooks/useBtxExchange.ts | Custom hook for market data, WebSocket connection, trading actions |
What's Covered in This Section
Price Mechanics
How prices work: base price, supply & demand, drift, phase bumps, and investment impact.
Database & API
All 6 DynamoDB tables, REST API endpoints, and WebSocket routes.
Trade Execution & Frontend
Atomic trade flow, frontend components, price charts, and WebSocket hook.
Configuration & Development
Tunable constants, local dev setup, common admin tasks, and tips.