// chapter 1
The idea
Polls tell you what people say; markets tell you what they’re willing to back. A prediction market lets people buy shares in an outcome (“Will India win the T20 World Cup?”). Each share pays out if that outcome happens, so its price reads as the crowd’s probability.
The goal was the full experience of a modern prediction market: browse and filter markets, connect a wallet, trade YES or NO, follow your positions, and see markets close and resolve.
// chapter 2
What I built
Markets
Binary YES/NO markets and multi-outcome markets, with categories (politics, sports, crypto, finance, entertainment), end dates, liquidity levels and resolved results.
Discovery
Filters for Trending, Hot, Liquid, Ending Soon and Competitive, category filters, grid and list views, and sorting by volume.
Wallet sign-in
Connect with MetaMask, WalletConnect, Phantom or OKX Wallet through wagmi and viem, with support for Polygon networks.
Automated pricing
Each market has a YES pool and a NO pool. A constant-product market maker prices every trade, so there’s always a price without needing a buyer on the other side.
Your activity
A dashboard, a portfolio of your positions, and a leaderboard of traders.
Admin dashboard
Create markets (question, description, category, end date, image) and resolve each one to YES or NO when the event is decided. Markets trade until their end date, then close.
// chapter 3
How the pricing works
The market maker keeps the product of the two pools constant (YES pool × NO pool = k). Buying YES adds money to the market and takes YES shares out of its pool, so YES gets scarcer and its price rises, while NO gets cheaper. The YES price is always the NO pool’s share of the total, so the two prices add up to 100%.
This is the same idea behind automated market makers in decentralised finance: liquidity is always available, and prices respond smoothly to demand instead of jumping between scattered orders.
// chapter 4
Results
- A live, working demo of a Polymarket-style platform, from browsing to trading to resolution.
- Real markets created, traded and resolved, alongside sample markets that show the full range of formats.
- Shows the Web3 skills clients ask for: wallet connection, on-chain-ready pricing logic and a polished trading interface.
- Next.js
- React
- wagmi
- viem
- ethers.js
- WalletConnect
- MetaMask
- Polygon
- MongoDB
- Vercel

