DEV Community

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

  • Frontend: Vanilla JS (no framework - just fast)
  • Backend: Vercel serverless functions to proxy all API calls (avoids CORS, keeps keys server-side)
  • Data source: 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.

Comments

No comments yet. Start the discussion.