Track whale trades on Polymarket, classify wallets (Smart Money / Degen / Insider), and get real-time alerts via Telegram and X/Twitter.
- Backend (
/backend): Node.js + TypeScript. Polls PolygonOrderFilledevents from Polymarket's CTF Exchange contracts via Alchemy RPC, processes trades, scores wallets, sends alerts. - Frontend (
/frontend): React + TypeScript (Vite). Dashboard showing whale trades, wallet explorer with classification badges, trade feed with filters. - Database: Supabase (PostgreSQL) for trades, wallets, markets, scanner state.
- Alerts: Telegram bot for all whale trades; X/Twitter for smart money and insider trades only.
Create a Supabase project and run the SQL schema:
-- Copy contents of backend/src/db/schema.sql into the Supabase SQL editorcd backend
cp .env.example .env
# Fill in your API keys in .env
npm install
npm run devRequired environment variables:
ALCHEMY_RPC_URL— Alchemy Polygon mainnet RPC URLSUPABASE_URL— Supabase project URLSUPABASE_SERVICE_KEY— Supabase service role keyTELEGRAM_BOT_TOKEN/TELEGRAM_CHAT_ID— (optional) Telegram alertsTWITTER_API_KEY/TWITTER_API_SECRET/TWITTER_ACCESS_TOKEN/TWITTER_ACCESS_SECRET— (optional) X/Twitter posting
cd frontend
cp .env.example .env
# Fill in VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY
npm install
npm run dev- Block Scanner polls
eth_getLogsevery 12s from both CTF Exchange (0x4bFb41...8982E) and Neg Risk CTF Exchange (0xC5d563...0f80a) - Trade Processor decodes
OrderFilledevents, filters trades > $5,000 USD, resolves market metadata - Wallet Tracker aggregates stats per wallet (volume, win rate, ROI) and classifies:
- Smart Money (win rate >= 65%, positive ROI)
- Degen (win rate < 40%)
- Possible Insider (win rate >= 80%, large bets, bets before odds move)
- Insider Detection snapshots prices at trade time, checks 5min/30min price movements
- Market Resolution background job checks if markets resolved, updates trade outcomes, recalculates wallet scores
- Alerts go to Telegram (all whales) and X/Twitter (smart money + insiders)
- Backend: Railway (run
npm startafternpm run build) - Frontend: Vercel (auto-deploys from git, framework preset: Vite)