Skip to content

smvlx/jupiter-dca-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jupiter DCA Tracker

A Solana blockchain monitoring service that tracks Jupiter DCA (Dollar Cost Averaging) positions in real time and sends notifications via Telegram. Built for traders who want alerts about significant DCA activity on memecoins and low-cap tokens.

What It Does

When someone opens or closes a DCA position on Jupiter, this bot:

  1. Captures the event via a webhook from Helius
  2. Fetches market data (price, market cap, liquidity) from DexScreener
  3. Applies filters — global thresholds + per-user preferences
  4. Detects whales — checks if the wallet holds >$50k in tokens (via Helius)
  5. Sends a Telegram notification with all relevant info and quick links

It also tracks DCA closings, calculates ROI, and provides performance analytics.

Features

  • Real-time DCA monitoring via Helius webhooks
  • Telegram bot with subscribe/unsubscribe and per-user filter settings
  • Smart filtering by USD amount, market cap, FDV, token include/exclude lists
  • Whale detection — flags wallets with large holdings
  • Performance analytics — tracks ROI, optimal entry times, and market conditions
  • Data persistence — MongoDB for DCA orders and metrics, Redis for caching

Architecture

Solana Blockchain
       |
       v
  Helius Webhook ──> Express Server (webhook_server.ts)
                          |
                          ├── DexScreener API (token prices, market data)
                          ├── Helius RPC API (whale detection)
                          ├── Redis (caching, deduplication, subscribers)
                          ├── MongoDB (DCA orders, metrics, user prefs)
                          └── Telegram Bot (notifications, commands)

Quick Start

Prerequisites

  • Node.js 18.x or higher
  • MongoDB — local or MongoDB Atlas (free tier works)
  • Redis — local or cloud (Redis Cloud free tier works)
  • Telegram Bot Token — from @BotFather
  • Helius API Key — from helius.dev (free tier available)

Installation

git clone https://github.com/YOUR_USERNAME/jupiter-dca-tracker.git
cd jupiter-dca-tracker

npm install

cp .env.example .env
# Edit .env with your credentials (see below)

npm run build
npm start

Development

npm run dev    # Runs with hot reload via nodemon

Setting Up the Telegram Bot

Step 1: Create a bot with BotFather

  1. Open Telegram and search for @BotFather
  2. Send /newbot
  3. Choose a name (display name, e.g. "Jupiter DCA Tracker")
  4. Choose a username (must end in bot, e.g. jupiter_dca_tracker_bot)
  5. BotFather will give you a token like 123456789:ABCdefGhIjKlMnOpQrStUvWxYz
  6. Copy this token to your .env file as TELEGRAM_BOT_TOKEN

Step 2: Get your Telegram user ID (for admin commands)

  1. Open Telegram and search for @userinfobot
  2. Send /start — it will reply with your user ID (a number like 123456789)
  3. Copy this to your .env file as ADMIN_USER_ID

Step 3: Set up the Helius webhook

The bot receives blockchain events via a webhook. You need to set this up on Helius:

  1. Sign up at helius.dev and get an API key
  2. Go to Webhooks in the Helius dashboard
  3. Create a new webhook with these settings:
    • Webhook URL: https://your-server-url.com/ (your deployed server's URL)
    • Transaction Type: Select "Any"
    • Account Addresses: Add DCA265Vj8a9CEuX1eb1LWRnDT7uK6q1xMipnNyatn23M (Jupiter DCA program)
    • Webhook Type: "Enhanced" (to get decoded event data)
  4. Save the webhook

Step 4: Start the bot

npm start

Open your bot in Telegram and send /start to subscribe to notifications.

Environment Variables

Variable Required Default Description
TELEGRAM_BOT_TOKEN Yes Bot token from @BotFather
MONGODB_URL Yes MongoDB connection string
REDIS_URL Yes Redis connection URL
HELIUS_API_KEY Yes Helius API key for Solana RPC + webhooks
ADMIN_USER_ID No Your Telegram user ID for admin commands
REDIS_PASSWORD No Redis password (if required)
PORT No 3000 Webhook server port
BIRDEYE_API_KEY No Birdeye API key (alternative data source)

Telegram Commands

User Commands

Command Description
/start Subscribe to DCA notifications
/stop Unsubscribe from notifications
/status Check your subscription status
/settings Open interactive settings menu
/filters View your current filter settings
/setmin <amount> Set minimum USD amount (e.g. /setmin 5000)
/setmax <amount> Set maximum USD amount (e.g. /setmax 100000)
/exclude <address> Add a token to your personal exclude list
/include <address> Add a token to your personal include list
/toggleinclude Switch between include-list and exclude-list mode

Admin Commands

Command Description
/exclude <address> Add token to the global exclude list
/include <address> Remove token from the global exclude list
/listexcluded List all globally excluded tokens
/stats Get bot statistics (subscribers, volumes, DCA counts)
/analyze Run performance analysis on successful DCAs

Filter Configuration

Filters work at two levels: global (applied to all notifications) and per-user (each user configures their own).

Global Filters (hard-coded defaults)

These are applied before any notification is sent:

Filter Value Purpose
Min SOL amount 10 SOL Ignore small DCA positions
Max SOL amount 500 SOL Ignore very large positions
Min USD amount $1,000 For non-SOL input tokens
Max USD amount $300,000 For non-SOL input tokens
Min market cap $1,000,000 Filter out micro-caps
Max market cap $50,000,000 Focus on low/mid-cap tokens
Excluded tokens USDC, USDT, jitoSOL, bSOL, mSOL, JUP, HUB Skip stablecoins and LSTs

To change global filters, edit the constants at the top of src/webhook_server.ts.

Per-User Filters

Each user can customize their own filters via Telegram:

Amount range — Only receive notifications for DCAs within your preferred USD range:

/setmin 5000      # Only show DCAs worth $5,000+
/setmax 50000     # Hide DCAs worth more than $50,000

Exclude list mode (default) — See all tokens EXCEPT the ones you exclude:

/exclude So11111111111111111111111111111111111111112   # Exclude SOL

Include list mode — ONLY see specific tokens you're tracking:

/toggleinclude    # Switch to include-list mode
/include <token_address>   # Add a token to track

Use /settings for an interactive menu to manage all of these.

How Filters Stack

  1. Global filters run first — if a DCA doesn't pass global thresholds, no one sees it
  2. Per-user filters run next — each subscriber's preferences are checked individually
  3. A notification is only sent to users whose filters match

API Endpoints

Method Path Description
POST / Webhook endpoint for Helius blockchain events
GET / Health check (returns { status: "OK" })
GET /analysis/performance/:dcaKey Get performance data for a specific DCA
GET /analysis/strategies Get top performing DCA strategies

Project Structure

src/
├── index.ts                 # Entry point — initializes services and starts server
├── types.ts                 # TypeScript interfaces (DcaEvent, TokenInfo, etc.)
├── webhook_server.ts        # Express server — processes blockchain events
├── telegram_bot.ts          # Telegram bot — commands, notifications, settings
├── mongo_service.ts         # MongoDB — DCA orders, metrics, user preferences
├── redis_service.ts         # Redis — caching, deduplication, subscriber list
├── dexscreener_service.ts   # DexScreener API — token prices and market data
├── helius_service.ts        # Helius API — whale detection
├── analysis_service.ts      # Performance analytics — ROI, timing patterns
├── birdeye_service.ts       # Birdeye API (optional alternative data source)
├── rugcheck_service.ts      # RugCheck API (token safety checks)
├── dca_tracker.ts           # Legacy RPC-based tracker (kept for reference)
└── services.ts              # Service re-exports

Deployment

Railway / Render / Fly.io

Set the environment variables in your platform's dashboard and deploy. The postinstall script auto-builds on npm install.

Docker

docker build -t dca-tracker .
docker run -d --env-file .env -p 3000:3000 dca-tracker

Heroku

heroku create your-app-name
heroku config:set TELEGRAM_BOT_TOKEN=your_token
heroku config:set MONGODB_URL=your_mongodb_url
heroku config:set REDIS_URL=your_redis_url
heroku config:set HELIUS_API_KEY=your_helius_key
git push heroku main

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/your-feature)
  3. Make your changes
  4. Submit a pull request

License

MIT


Disclaimer: This tool is for informational purposes only. Not financial advice. Always DYOR.

About

Real-time Solana DCA position tracker with Telegram notifications, smart filtering, whale detection, and performance analytics. Monitors Jupiter DCA program activity.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors