A complete, production-ready TypeScript application for detecting and analyzing Pump.fun token launches on Solana.
solana-pump-radar/
├── .github/
│ └── workflows/
│ └── solana-pump-radar-ci.yml # CI/CD pipeline
├── docs/
│ ├── PRD.md # Product requirements
│ ├── DECISION_LOG.md # Technical decisions
│ ├── RISK_REGISTER.md # Risk analysis (FMEA)
│ ├── RUNBOOK.md # Operations guide
│ ├── CODEX_SAFE.md # AI dev guidelines
│ └── HELLFIRE_MODE.md # Quality gates
├── fixtures/
│ └── pumpfun-create.sample.json # Sample webhook payload
├── prisma/
│ └── schema.prisma # Database schema
├── scripts/
│ └── replay-fixture.ts # Webhook replay tool
├── src/
│ ├── detector/
│ │ ├── pumpfun-detector.ts # Instruction detection
│ │ └── pumpfun-detector.test.ts # Detector tests
│ ├── queue/
│ │ └── processing-queue.ts # Async job queue
│ ├── risk/
│ │ └── risk-scorer.ts # Risk computation
│ ├── routes/
│ │ ├── webhook.ts # Webhook endpoint
│ │ └── api.ts # REST API endpoints
│ ├── schemas/
│ │ └── webhook-schemas.ts # Zod validation
│ ├── config.ts # Config management
│ ├── db.ts # Prisma client
│ ├── logger.ts # Pino logger
│ └── index.ts # Main entry point
├── .env.example # Environment template
├── .eslintrc.json # ESLint config
├── .gitignore # Git ignore rules
├── .prettierrc # Prettier config
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
├── vitest.config.ts # Test config
└── README.md # Documentation
- Accepts POST requests with raw Solana transactions
- Validates Authorization header (Bearer token)
- Parses and validates payload with Zod
- Detects Pump.fun creates
- Stores in database (idempotent via UNIQUE signature)
- Enqueues for risk scoring
- Returns 200 immediately
- Matches Pump.fun program ID:
6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P - Checks instruction discriminator:
[24, 30, 200, 40, 5, 28, 7, 119] - Extracts mint address from accounts[0]
- Handles base58 decoding and binary parsing
- Fetches mint info via @solana/spl-token
- Checks mint/freeze authorities (+35/+25 points)
- Computes holder concentration (+10-30 points)
- Checks for Metaplex metadata (+5 if missing)
- Produces score (0-100), label (LOW/MED/HIGH), and reasons
- Uses p-queue for concurrency control
- Deduplicates by mint address
- Processes risk scoring async
- Configurable concurrency (default 3)
- GET /launches - List recent launches
- GET /tokens/:mint - Token detail + risk report
- GET /healthz - Health check
- LaunchEvent table (signature UNIQUE)
- TokenRiskReport table (mint UNIQUE)
- Automatic type generation
- Easy migration path to PostgreSQL
cd solana-pump-radar
cp .env.example .envEdit .env:
SOLANA_RPC_URL="https://api.mainnet-beta.solana.com" # Use Helius/QuickNode for production
WEBHOOK_SECRET="$(openssl rand -hex 32)" # Generate secure secretnpm install
npm run db:generate
npm run db:migratenpm run devServer runs on http://localhost:3000
# In another terminal
npm run replaycurl http://localhost:3000/healthz
curl http://localhost:3000/launchesnpm ci --only=production
npm run db:generate
npm run db:migrate
npm run build
npm startpm2 start npm --name "pump-radar" -- start
pm2 save
pm2 startupPORT=3000
NODE_ENV=production
DATABASE_URL=file:./prod.db # Or PostgreSQL connection string
SOLANA_RPC_URL=https://mainnet.helius-rpc.com/?api-key=YOUR_KEY
WEBHOOK_SECRET=<secure-secret>
QUEUE_CONCURRENCY=5
MAX_LAUNCHES_RESPONSE=100- Dashboard → Webhooks → Create
- Type: Raw Transaction
- URL:
https://your-domain.com/webhooks/helius - Auth Header:
Bearer <WEBHOOK_SECRET> - Account Address:
6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P - Transaction Types: All
Use Helius test button or:
npm run replayGitHub Actions workflow runs on every PR:
- ✓ Lint (ESLint + Prettier)
- ✓ Type check (TypeScript strict mode)
- ✓ Tests (Vitest)
- ✓ Build (TypeScript compilation)
All must pass before merge.
npm test # Watch mode
npm run test:ci # CI mode- Detector unit tests (instruction matching)
- Webhook validation tests (Zod schemas)
- Mock-based risk scorer tests (optional - add as needed)
# Health check
curl http://localhost:3000/healthz
# Replay fixture
npm run replay
# Check launches
curl http://localhost:3000/launches
# Check specific token (after launch detected)
curl http://localhost:3000/tokens/<MINT_ADDRESS>- Zero-config for MVP
- Type-safe with Prisma
- Easy migration to PostgreSQL later
- Reliable instruction parsing
- Provider-agnostic
- Better for discriminator matching
- Explainable to users
- Fast computation
- No training data needed
- Easy to iterate
See DECISION_LOG.md for full rationale.
All enforced by CI:
- ✓ All tests pass
- ✓ TypeScript compiles (strict mode)
- ✓ ESLint clean
- ✓ Build succeeds
Manual gates: 5. ✓ Idempotency (duplicate webhooks handled) 6. ✓ Input validation (Zod schemas) 7. ✓ Observability (structured logging) 8. ✓ No secrets in code
See HELLFIRE_MODE.md for details.
- Webhook latency (p50, p95, p99)
- Risk scoring duration
- Queue depth
- Launch detection rate
- RPC error rate
# Database connectivity
curl http://localhost:3000/healthz
# Recent activity
curl http://localhost:3000/launches?limit=10Structured JSON logs with Pino:
{
"level": "info",
"time": 1704067200000,
"msg": "Detected Pump.fun creates",
"detected": 2
}# Check secret matches
echo $WEBHOOK_SECRET
# Update provider config with correct Bearer token# Test with fixture
npm run replay
# Check webhook provider dashboard
# Verify account filter: 6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P# Check RPC connectivity
curl $SOLANA_RPC_URL -X POST -d '{"jsonrpc":"2.0","id":1,"method":"getHealth"}'
# Check queue stats (add endpoint or check logs)
# Increase QUEUE_CONCURRENCY if neededSee RUNBOOK.md for comprehensive troubleshooting.
- Set up production RPC provider (Helius, QuickNode, Alchemy)
- Configure webhook provider
- Deploy with process manager (PM2/systemd)
- Set up monitoring/alerting
- Configure database backups
- PostgreSQL migration for scale
- WebSocket updates for real-time feeds
- Historical backfill for past launches
- Advanced ML-based risk models
- Social sentiment integration
- Multi-chain support
- Alerting system (Discord/Telegram)
- Docs: solana-pump-radar/README.md
- Runbook: docs/RUNBOOK.md
- Issues: GitHub Issues
✓ No secrets committed ✓ Idempotent operations ✓ Input validation ✓ Error handling ✓ Structured logging ✓ CI/CD pipeline ✓ Comprehensive documentation ✓ Production-ready code