DEV Community

Cover image for How I Built a Real-Time Whale Tracker for Polymarket in a Weekend
Manpreet Brar
Manpreet Brar

Posted on

How I Built a Real-Time Whale Tracker for Polymarket in a Weekend

Prediction markets just hit $3.6B in volume. I wanted to know what the biggest traders were betting on — in real time. So I built WhaleTrack.

Here's how it works under the hood.

The Problem

Polymarket has a public leaderboard. But it only shows P&L totals — not what whales are currently betting on, not their recent activity, not their win rate. If you want to follow smart money, you're flying blind.

I wanted something that answered: what are the top traders doing right now?

The Stack

  • Vanilla JS frontend (no framework, keeps it fast)
  • Vercel serverless function as a backend proxy (avoids CORS issues)
  • Polymarket's public data API — no auth required

Step 1: Finding the Whales

Polymarket exposes a leaderboard endpoint:

https://data-api.polymarket.com/v1/leaderboard?limit=20

This returns traders ranked by P&L. I pull the top 10, grab their wallet addresses, and that's my whale list.

Step 2: Fetching Live Activity

For each whale wallet, I hit:

https://data-api.polymarket.com/activity?user={address}&limit=20

This returns their recent trades — market name, size in USDC, timestamp. Refreshes every 60 seconds.

Step 3: Calculating Win Rate (the tricky part)

The key is the redeemable flag — redeemable: true means they won, currentValue: 0 + redeemable: false means they lost. Took a few wrong attempts with cashPnl (always negative, not useful).

Step 4: The Whale Alert Banner

Every 60 seconds I check for trades over $5,000 placed in the last 10 minutes. When it fires, a green banner slides down with the whale name, market, and amount. Auto-dismisses after 12 seconds. First time I saw it fire live with a $28K bet — genuinely exciting.

Results

  • 129+ users in the first few days
  • Zero ad spend
  • Traffic from Twitter, Reddit, Quora

What's Next

  • More whale wallets (suggestions welcome)
  • Click-through to open the same market on Polymarket directly
  • Email/push alerts for big trades

Check it out: whaletrack.app

All feedback welcome — especially if you spot a whale I'm missing.

Top comments (0)