DEV Community

Manpreet Brar
Manpreet Brar

Posted on

How I built an automated Twitter + Telegram whale alert bot for Polymarket

Built WhaleTrack — it tracks big Polymarket traders and alerts when they place large bets. Here's the technical stack behind the automated alert system.

  • The core loop (runs every 5 min):
  1. Polls Polymarket's API for recent trades across known whale wallets

  2. Detects new bets above $10K threshold

  3. Sends Telegram alert immediately

  4. Waits 10 min (Telegram subscribers get early access)

  5. Posts to Twitter with a visual card

  • Tweet card generation:
  1. Puppeteer renders an HTML card → screenshot → PNG

  2. Uploaded via Twitter media API (v1.1) before posting text via v2

  3. Falls back to text-only if Puppeteer fails

  • One lesson on Twitter character limits:

Twitter's 280 weighted char limit counts URLs as 23 chars regardless of length. My referral link was getting silently truncated because the tweet was ~336 weighted chars. Fixed by restructuring the tweet and adding a proper twitterLen() counter.

Stack:

1.Node.js (single process, 24/7)

2.Bullpen CLI for Polymarket data

3.Puppeteer for card screenshots

4.Twitter API v1.1 (media) + v2 (tweets)

5.Telegram Bot API

6.Vercel for the web app

Live at whaletrack.app. The full alert bot is ~1,200 lines of Node.js. Happy to share specific snippets if useful.

Top comments (0)