DEV Community

Manpreet Brar
Manpreet Brar

Posted on

How I built a real-time whale tracker for Polymarket using their public API

Polymarket has a public data API that almost nobody talks about. I used it to build WhaleTrack — a live dashboard that tracks what the biggest traders on the platform are betting on.

The stack:

Vanilla JS frontend (no framework — just fast)
Vercel serverless functions to proxy all API calls (avoids CORS, keeps keys server-side)
Polymarket's data-api.polymarket.com for positions, leaderboard, and activity
The interesting parts:

The win rate calculation was tricky. Polymarket doesn't give you a clean "won/lost" field. You have to infer it:

redeemable === true = won (market resolved in their favour)
currentValue === 0 && redeemable === false = lost
Everything else = still open
Also learned the hard way that slug (market-level) and eventSlug (event-level) are different things on Polymarket. Market slugs 404 on polymarket.com/event/. Took me longer than I'd like to admit to figure that out.

Live at whaletrack.app — open to questions about the API or architecture.

Top comments (0)