Skip to content

Yashr4/solana-token-tracker

Repository files navigation

Solana Token Trading Bot

A data collection pipeline for Solana token discovery and trading analysis. Monitors new token launches on Pump.fun, tracks trade activity and market cap, and optionally correlates with Twitter sentiment.

Scripts

Script Description
import_coins.py Streams new token creation events from PumpPortal WebSocket and saves the 10 most recent to CSV
check_market_cap.py Tracks buy/sell trades and market cap for a specific token
check_tweets.py Monitors Twitter accounts for new tweets and extracts subjects using NLP

Setup

1. Clone and create virtual environment

git clone <your-repo-url>
cd Solana_bot
python -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate

2. Install dependencies

pip install -r requirements.txt
python -m spacy download en_core_web_sm

3. Configure environment variables

cp .env.example .env

Edit .env and fill in your values:

TWITTER_BEARER_TOKEN=your_actual_token_here
TWITTER_USERS=elonmusk,anotheruser
TOKEN_ADDRESS=YourSolanaTokenMintAddressHere

Then load the env file before running:

export $(cat .env | xargs)

Usage

Discover new tokens:

python import_coins.py

Track market cap for a specific token:

export TOKEN_ADDRESS=<mint_address>
python check_market_cap.py

Monitor Twitter sentiment:

export TWITTER_BEARER_TOKEN=<your_token>
export TWITTER_USERS=elonmusk,username2
python check_tweets.py

Getting API Keys

Twitter Bearer Token

  1. Go to Twitter Developer Portal
  2. Create a project and app
  3. Copy the Bearer Token from the "Keys and Tokens" section

Output Files

  • recent_tokens.csv — 10 most recently created tokens (overwritten each run)
  • token_trade_data.csv — Trade history for the tracked token
  • tweet_subjects.csv — Extracted subjects from monitored tweets

These files are excluded from git via .gitignore.

Requirements

  • Python 3.9+
  • Twitter Developer account (for check_tweets.py)
  • No Solana RPC node required — uses PumpPortal public WebSocket API

About

Python bot that monitors new Solana token launches on PumpFun, tracks market cap in real-time, and watches Twitter/X for mentions using NLP.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages