Year:
2026
Live at:
https://github.com/danielafriheart/Token-Radar


A real-time on-chain token radar that watches Twitter and Dexscreener for fresh Base & Solana launches, validates them on-chain, scores their risk, and pushes actionable alerts to Telegram with one-tap chart and swap buttons.
Stack: TypeScript · Node.js · ethers.js · @solana/web3.js · zod · vitest · Telegram Bot API · Dexscreener API · Twitter API v2 · Docker
THE PROBLEM
New-token chatter on Twitter is mostly bots, the v2 search API is now paywalled, and the few real signals are buried under thousands of false positives. The interesting problem isn't finding contract addresses — regex does that in three lines — it's deciding which ones are real, tradeable, and not already-rugged before they hit a user's phone. Self-imposed constraint: no database, no queue, no paid API tier.
PROJECT LAYOUT
src/
├── config/env.ts # zod-validated environment loader
├── utils/
│ ├── logger.ts # leveled, scoped logger
│ ├── regex.ts # address-shaped patterns
│ ├── addresses.ts # checksum / base58 validators + blacklists
│ ├── retry.ts # exponential backoff + jitter
│ └── dedupe.ts # persistent seen-set with TTL
├── parser/parser.ts # tweet → validated candidates
├── chains/
│ ├── base.ts # ERC20 surface read via ethers
│ └── solana.ts # SPL mint validation via web3.js
├── dexscreener/client.ts # market data enrichment
├── filter/risk.ts # heuristic risk model
├── telegram/
│ ├── bot.ts # shared bot, command handlers
│ ├── formatter.ts # HTML message + button builder
│ └── alerts.ts # outbound alert sender
├── scraper/twitterScraper.ts # search loop with cursor persistence
├── pipeline/pipeline.ts # stage orchestrator
├── scheduler/scheduler.ts # interval runner with overlap protection
├── types/token.ts # shared types
└── index.ts # bootstrap + signal handling
tests/ # vitest unit tests
HIGHLIGHT
Multi-stage pipeline — fetch → parse → validate → enrich → score → alert. Each stage is isolated, individually testable, and easy to swap.
Strict typed config — every environment variable is parsed by zod at boot. Bad config fails fast with a clear error instead of crashing in production at 3 a.m.
Address validation, not just regex — EVM addresses are checksum-validated with
ethers.getAddress; Solana addresses are base58-decoded and length-checked. Common false positives (zero address, system programs, wrapped SOL) are blacklisted.Persistent dedupe with TTL — restarts don't spam users with old alerts. The seen-set is JSON-persisted under
.data/and pruned automatically.Risk scoring — liquidity floor, 24h volume floor, sell-pressure ratio, drawdown, pair age. Filters obvious rugs before they hit your phone.
Single Telegram bot instance — one connection serves both inbound commands (
/start,/status,/help) and outbound alerts.Rich Telegram alerts — HTML-formatted with price, liquidity, MC, volume, age, and inline buttons for chart / explorer / Uniswap or Jupiter.
Resilient I/O — every external call is wrapped in
withRetry(exponential backoff + jitter, retry-aware error classification).Cursor-based polling — uses Twitter's
since_idso each cycle only sees new tweets; cursors persist across restarts.Graceful shutdown — SIGINT/SIGTERM stop the scheduler and flush the dedupe store before exit.
Tested — unit tests for the parser, regex, dedupe and risk modules using Vitest.
Container-ready — Multi-stage Dockerfile with a non-root user.