Copy top traders in prediction markets using virtual credits.
PolyTrade is a full-stack prediction market simulator where users trade YES/NO outcomes using virtual credits. It lowers the barrier for new users through copy trading β discover top traders on the leaderboard, follow them, set a copy ratio, and automatically mirror their future trades.
π Live Demo Β |Β π οΈ Backend API Β |Β π Demo Flow Β |Β π API Reference
PolyTrade is a browser-based prediction market simulator built around three ideas: markets, wallets, and copy trading.
Users receive 1,000 virtual credits on signup and can immediately start trading on binary YES/NO markets. Each market displays probability-style prices, trade volume, and live status. Users can place manual trades or choose to follow experienced traders through the copy trading engine.
When a copied trade fires, the follower's wallet and portfolio update automatically β no action required. When markets close, an admin resolves the outcome, and virtual payouts are distributed to winning positions. Every transaction, copy event, and payout is recorded in the wallet ledger and visible in the portfolio.
Prediction markets are genuinely powerful tools for aggregating information and gauging probability. But for most people, they're hard to use:
- Binary pricing and probability percentages are confusing for newcomers
- Users don't know how to evaluate a market's quality or activity
- There's no natural discovery path for learning who trades well
- The feedback loop between a trade and its outcome is long and opaque
Most platforms drop new users into a live market with no guidance. The result is low engagement, poor decisions, and fast drop-off.
The insight behind PolyTrade: copy trading turns expert behavior into a structured onboarding path. Instead of asking every user to figure out the market from scratch, PolyTrade lets beginners follow traders they trust, observe the mechanics in real time, and gradually develop their own judgment β all within a risk-free virtual environment.
PolyTrade connects three core loops:
Manual Trading β Users browse active markets, view probabilities and volume, and place YES/NO trades. Their wallet is debited, and their position is opened immediately.
Copy Trading β Users discover top performers on the leaderboard, follow them at a custom copy ratio (e.g. 50%), and automatically mirror every future trade proportionally. The copy activity log shows exactly what was copied and when.
Resolution & Payouts β Admins close markets and resolve outcomes. Winners receive virtual payouts proportional to their positions. Settled positions remain visible for portfolio review.
All activity β starter credits, manual trades, copied trades, and payouts β is recorded in the wallet ledger with full history.
PolyTrade was built for BuildRush, a research-driven innovation challenge focused on practical problem-solving, technical execution, and real working prototypes.
The project explores a concrete question: can social and copy mechanisms make prediction markets meaningfully more accessible to non-expert users? It addresses that question with a functional full-stack system β not a mockup β that executes trades, automates copy logic, settles markets, and tracks everything transparently.
π Binary YES/NO Markets Markets display probability-style prices, volume, recent activity, and status. Users can evaluate sentiment shifts over time.
π±οΈ Manual Trading Place YES or NO trades on any open market. Shares are calculated, wallet is debited, and position is opened instantly.
π Copy Trading Engine Follow any trader at a custom ratio. Every future trade they place is automatically mirrored proportionally into the follower's account.
π Trader Leaderboard Discover traders ranked by balance, trade volume, number of followers, and market participation. Find who's worth following.
π° Virtual Wallet Ledger Every credit event is recorded β starter credits, trade debits, copied trades, and resolved payouts. Full transaction history always visible.
π Portfolio Tracking View open and settled positions with shares, entry prices, estimated value, and PnL. Positions update automatically on copy trades and resolution.
π Recent Trades & Copy Activity Per-market and per-user trade history. Separate copy activity log showing every mirrored trade, source trader, and copy ratio applied.
π Admin Market Resolution Admins can close markets and resolve YES or NO outcomes. Resolution triggers automatic payout distribution to all winning positions.
πΈ Payout Settlement Winners receive virtual credits proportional to their position size and shares. Settled positions are marked and remain visible in portfolio history.
π₯οΈ Full-Stack Dashboard A polished Next.js interface covering markets, trading, wallet, portfolio, leaderboard, copy settings, activity logs, and admin tools.
Register / Login
β
βΌ
Receive 1,000 virtual credits
β
βΌ
Browse YES/NO markets
β
ββββββββββββββββββββββββββββ
βΌ βΌ
Place a manual trade Follow a top trader
β β
β Set copy ratio (e.g. 50%)
β β
β Auto-copy future trades
β β
ββββββββββββββββββββββββββββ
β
βΌ
Wallet & portfolio update in real time
β
βΌ
Admin closes and resolves market
β
βΌ
Winners receive virtual payouts
ββββββββββββββββββββββββββββββββββββ
β Frontend (Next.js) β
β TypeScript Β· Tailwind Β· Zustandβ
ββββββββββββββββββ¬ββββββββββββββββββ
β REST API
βΌ
ββββββββββββββββββββββββββββββββββββ
β Backend (Go + Gin) β
β Markets Β· Trades Β· Copy Engine β
β Wallet Β· Portfolio Β· Resolution β
ββββββββββββββββββ¬ββββββββββββββββββ
β GORM
βΌ
ββββββββββββββββββββββββββββββββββββ
β PostgreSQL (Neon / Local) β
β Users Β· Markets Β· Trades β
β Positions Β· Wallet Β· Copy Rels β
ββββββββββββββββββββββββββββββββββββ
The frontend communicates with the Go REST API over HTTP. The backend handles all trade execution, copy logic, wallet updates, and market resolution. PostgreSQL persists users, markets, trades, positions, wallet transactions, copy relationships, and resolution records.
| Layer | Technology |
|---|---|
| Frontend | Next.js, TypeScript, Tailwind CSS, Zustand, Axios, Recharts, Lucide React |
| Backend | Go, Gin, GORM |
| Database | PostgreSQL (Neon in production, local for development) |
| Deployment | Vercel (frontend), Render (backend API) |
| Docs | Markdown β docs/DEMO_FLOW.md, docs/API_QUICK_REFERENCE.md |
polytrade/
βββ frontend/ # Next.js app β pages, components, state, API client
βββ backend/ # Go API β routes, handlers, models, DB logic
βββ docs/ # DEMO_FLOW.md and API_QUICK_REFERENCE.md
βββ docker-compose.yml # Local multi-service setup
βββ README.md
frontend/β All UI pages (markets, trading, wallet, portfolio, leaderboard, copy settings, admin), Zustand state, Axios API client, Recharts visualizations.backend/β Gin router, handler modules (markets, trades, wallet, portfolio, leaderboard, copy trading, admin resolution), GORM models, seed data.docs/β Step-by-step demo flow and full API endpoint reference.
- Node.js (v18+)
- Go (v1.21+)
- PostgreSQL
cd backend
cp .env.example .env
# Edit .env with your local DATABASE_URL
go mod tidy
go run ./cmd/apiBackend runs at http://localhost:4000
# Health check
curl http://localhost:4000/healthcd frontend
cp .env.local.example .env.local
# Set NEXT_PUBLIC_API_URL=http://localhost:4000
npm install
npm run devFrontend runs at http://localhost:3000
Backend (.env):
PORT=4000
DATABASE_URL=postgres://<user>@localhost:5432/polytrade?sslmode=disable
FRONTEND_URL=http://localhost:3000
JWT_SECRET=<any-long-random-string>
JWT_SECRETis required β the backend refuses to start without it.
Frontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:4000The database seeds three demo users, active markets, starter credits, and copy relationships out of the box. All seed users share the demo password password123.
| User | User ID | Login Email | Password | Starting Balance |
|---|---|---|---|---|
| Vansh | 1 | vansh@polytrade.dev |
password123 |
1,000 virtual credits |
| Nitish | 2 | nitish@polytrade.dev |
password123 |
1,000 virtual credits |
| Alice | 3 | alice@polytrade.dev |
password123 |
1,000 virtual credits |
Pre-seeded copy relationships:
- Vansh follows Alice at 50% copy ratio
- Nitish follows Alice at 30% copy ratio
Alice's trades will automatically trigger proportional copied trades for both followers, demonstrating the copy engine immediately on first run.
- Open the app and log in as any seed user
- Browse the YES/NO market listing
- Place a manual trade and check the wallet ledger
- Open the leaderboard and follow Alice
- Trigger a trade as Alice β observe it copy to followers
- View copy activity and portfolio positions
- Open the admin dashboard
- Close and resolve a market
- Check wallet for virtual payout and portfolio for settled positions
Full walkthrough: docs/DEMO_FLOW.md
PolyTrade operates entirely on virtual credits. It does not process real money, connect to financial systems, or represent real financial instruments of any kind. It is designed for simulation, learning, and product demonstration only.
| Document | Description |
|---|---|
docs/DEMO_FLOW.md |
Step-by-step walkthrough for judges and reviewers |
docs/API_QUICK_REFERENCE.md |
Full REST API endpoint reference |