How digbenjamins/solanatokensniper works
Project type and purpose
• This is a Node.js (TypeScript) “sniper” and “tracker” bot for the Solana blockchain.
• Purpose: automatically detect and purchase tokens on Solana (PumpSwap/Raydium), perform rug-checks, optionally skip certain tokens, and track trades for stop-loss/take-profit or logging.
File structure
• Top-level:
• package.json / tsconfig.json / eslint.config.mjs – Node/TS project config
• README.md / CHANGELOG.md – documentation
• src/
• config.ts – loads .env and parameters
• index.ts – entry point, dispatches “sniper” or “tracker” mode
• test/ – unit tests for individual handlers
• tracker/
– db.ts – persistence of trade events or order history
• utils/
– env-validator.ts – guarantees required env vars
– handlers/ – business‐logic units (rugCheck, signature, sniperoo, token)
– managers/ – websocketManager for live events
– notification.ts – alerts/logging
• types.ts – shared TypeScript types and interfaces
Key architecture insights from README
• Two runtime modes: sniper (real-time token purchase) and tracker (persist / monitor trades)
• Integrates four external services/APIs: Solana RPC (Helius), rugcheck.xyz, Sniperoo, JITO
• Pipeline of checks & actions: incoming token event → rug check → signature check → JITO or Sniperoo buy → optionally monitor & auto-sell
Final advice
• Two parallel paths: the real-time sniper pipeline and the tracker persistence pipeline.
• Don’t overthink: break the project into components exactly as they appear in the file tree and README, then illustrate how they connect.