Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Meme Token Screener

 β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—
 β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•    β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•‘
 β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ•”β–ˆβ–ˆβ•— β–ˆβ–ˆβ•‘
 β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•      β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•”β•β•β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘
 β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
 β•šβ•β•     β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•     β•šβ•β•β•šβ•β•β•β•β•β•β•    β•šβ•β•β•β•β•β•β• β•šβ•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β•  β•šβ•β•β•β•

AI-Powered Meme Token Scanner with LLM Agent, Wallet Integration & Token Usage Analytics

License: MIT Python 3.11+ Chain LLM Telegram


What Is This?

An intelligent meme token screening system that combines real-time blockchain data with LLM-powered analysis to identify, score, and trade meme tokens on the Base chain.

Key differentiators:

  • LLM Agent Core β€” Every token analysis goes through an LLM agent that reasons about risk, narrative, and opportunity. Token usage is tracked per-session with full cost transparency.
  • Wallet Integration β€” Direct on-chain execution via Base chain wallet (buy, sell, snipe).
  • Token Usage Analytics β€” Track every LLM call: prompt tokens, completion tokens, cost per analysis, cumulative spend.
  • Telegram Bot Interface β€” Full control via Telegram commands with real-time alerts.

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Telegram Bot Interface                         β”‚
β”‚   /screen  /buy  /sell  /snipe  /price  /pnl  /usage  /alert   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
        β”‚             β”‚              β”‚              β”‚
        β–Ό             β–Ό              β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Scanner    β”‚ β”‚  Wallet  β”‚ β”‚    LLM    β”‚ β”‚    Alert      β”‚
β”‚   Engine     β”‚ β”‚  Engine  β”‚ β”‚   Agent   β”‚ β”‚    Engine     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ DexScreener  β”‚ β”‚ Base     β”‚ β”‚ Analysis  β”‚ β”‚ Price Monitor β”‚
β”‚ API          β”‚ β”‚ Chain    β”‚ β”‚ Scoring   β”‚ β”‚ Whale Track   β”‚
β”‚ Token Data   β”‚ β”‚ web3.py  β”‚ β”‚ Narrative β”‚ β”‚ Custom Alert  β”‚
β”‚ Liquidity    β”‚ β”‚ Uniswap  β”‚ β”‚ Reasoning β”‚ β”‚ Cron Jobs     β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚              β”‚             β”‚               β”‚
       β–Ό              β–Ό             β–Ό               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Token Usage Tracker                            β”‚
β”‚  prompt_tokens | completion_tokens | cost_usd | model | timestampβ”‚
β”‚  session_stats | daily_stats | cumulative | per_analysis_breakdownβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Features

LLM Agent Analysis

Feature Description
Risk Scoring 0-100 score based on liquidity, holders, contract safety, social signals
Narrative Detection AI identifies meme narrative strength and virality potential
Contract Analysis Detects honeypot, mint functions, ownership renounced
Social Sentiment Analyzes Twitter/Telegram buzz for the token
Buy/Sell Reasoning Agent explains why it recommends or warns against a trade

Token Usage Tracking

Metric Granularity
Prompt Tokens Per-call, per-session, daily
Completion Tokens Per-call, per-session, daily
Estimated Cost (USD) Per-call, per-session, cumulative
Model Used Logged per-call
Analysis Duration Latency tracking
Breakdown Screen cost, alert cost, report cost

Wallet Operations

Feature Status Chain
Token Buy Production Base
Token Sell Production Base
Snipe (auto-buy on liquidity add) Production Base
Balance Check Production Base
Approve Token Production Base
Gas Estimation Production Base

Telegram Commands

/screen <query>     β€” Search and analyze a token
/buy <token> <amt>  β€” Buy token with ETH amount
/sell <token> <pct>  β€” Sell percentage of holdings
/snipe <token> <amt> β€” Auto-buy when liquidity added
/price <token>       β€” Get current price
/pnl                 β€” Portfolio PnL summary
/usage               β€” LLM token usage report
/alerts              β€” List active alerts
/trending            β€” Trending tokens on Base
/rugcheck <token>    β€” Deep contract analysis
/status              β€” System status

Quick Start

Prerequisites

  • Python 3.11+
  • Telegram Bot Token (from @BotFather)
  • LLM API Key (OpenAI-compatible endpoint)
  • Base chain wallet with ETH

Installation

git clone https://github.com/joykinder67/meme-token-screener.git
cd meme-token-screener
pip install -r requirements.txt
cp config/.env.example .env
# Edit .env with your credentials
python -m src.main

Environment Variables

# Telegram
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

# LLM Configuration
LLM_API_KEY=your_api_key
LLM_API_BASE=https://api.openai.com/v1
LLM_MODEL=gpt-4o-mini
LLM_MAX_TOKENS=2000
LLM_TEMPERATURE=0.3

# Base Chain Wallet
BASE_RPC_URL=https://mainnet.base.org
WALLET_PRIVATE_KEY=your_private_key
WALLET_ADDRESS=0xYourAddress

# DexScreener (no key needed, but rate limits apply)
DEXSCREENER_BASE_URL=https://api.dexscreener.com/latest/dex

# Token Usage Tracking
USAGE_DB_PATH=./data/token_usage.db
USAGE_ALERT_THRESHOLD_USD=10.00

Token Usage Analytics

The system tracks every LLM call with full transparency:

Per-Analysis Breakdown

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Token Analysis: PEPE on Base                         β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ LLM Calls: 3                                         β”‚
β”‚ β”œβ”€ Risk Scoring:      847 prompt + 234 completion    β”‚
β”‚ β”œβ”€ Narrative Check:   512 prompt + 189 completion    β”‚
β”‚ └─ Contract Analysis: 1203 prompt + 567 completion   β”‚
β”‚                                                      β”‚
β”‚ Total: 2,562 prompt + 990 completion = 3,552 tokens  β”‚
β”‚ Cost: $0.0043 USD (gpt-4o-mini)                      β”‚
β”‚ Duration: 2.4s                                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Daily Summary

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Daily Usage β€” 2026-05-17                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Analyses: 47                                         β”‚
β”‚ Total Tokens: 156,832 (98,210 prompt + 58,622 compl)β”‚
β”‚ Total Cost: $0.19 USD                                β”‚
β”‚ Avg per Analysis: 3,337 tokens / $0.004 USD          β”‚
β”‚                                                      β”‚
β”‚ Breakdown by Operation:                              β”‚
β”‚ β”œβ”€ Screening:   89,420 tokens (57%)                  β”‚
β”‚ β”œβ”€ Alerts:      34,210 tokens (22%)                  β”‚
β”‚ β”œβ”€ Rugcheck:    21,890 tokens (14%)                  β”‚
β”‚ └─ Reports:     11,312 tokens (7%)                   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Database Schema

CREATE TABLE token_usage (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
    operation TEXT NOT NULL,          -- 'screen', 'rugcheck', 'alert', 'report'
    model TEXT NOT NULL,              -- 'gpt-4o-mini', 'mimo-v2.5', etc.
    prompt_tokens INTEGER NOT NULL,
    completion_tokens INTEGER NOT NULL,
    total_tokens INTEGER NOT NULL,
    estimated_cost_usd REAL NOT NULL,
    latency_ms INTEGER,
    token_address TEXT,               -- related token if applicable
    session_id TEXT,
    metadata TEXT                     -- JSON blob for extra context
);

CREATE TABLE usage_sessions (
    session_id TEXT PRIMARY KEY,
    started_at DATETIME,
    ended_at DATETIME,
    total_prompt_tokens INTEGER DEFAULT 0,
    total_completion_tokens INTEGER DEFAULT 0,
    total_cost_usd REAL DEFAULT 0,
    analysis_count INTEGER DEFAULT 0
);

Scoring Engine

The LLM agent evaluates tokens across 5 dimensions:

Dimension Weight Data Source
Liquidity Safety 25% DexScreener pool data
Holder Distribution 20% On-chain analysis
Contract Safety 25% Bytecode + ABI scan
Social Signal 15% Twitter/Telegram metrics
Narrative Strength 15% LLM reasoning

Each dimension gets an LLM-generated score (0-100) with reasoning, then weighted into a final score.

Score Interpretation

  • 80-100 β€” Strong buy signal, high confidence
  • 60-79 β€” Moderate opportunity, proceed with caution
  • 40-59 β€” Mixed signals, small position only
  • 20-39 β€” High risk, avoid or very small gamble
  • 0-19 β€” Likely rug/honeypot, do not buy

Project Structure

meme-token-screener/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ main.py                    # Application entry point
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ config.py              # Configuration management
β”‚   β”‚   β”œβ”€β”€ database.py            # SQLite database manager
β”‚   β”‚   └── scheduler.py           # Cron task scheduler
β”‚   β”œβ”€β”€ llm/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ agent.py               # LLM agent with reasoning
β”‚   β”‚   β”œβ”€β”€ prompts.py             # Prompt templates
β”‚   β”‚   β”œβ”€β”€ token_tracker.py       # Token usage tracking
β”‚   β”‚   └── cost_calculator.py     # Cost estimation per model
β”‚   β”œβ”€β”€ scanner/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ dexscreener.py         # DexScreener API client
β”‚   β”‚   β”œβ”€β”€ scoring.py             # Multi-dimensional scoring
β”‚   β”‚   └── trending.py            # Trending token detection
β”‚   β”œβ”€β”€ wallet/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ base_chain.py          # Base chain wallet operations
β”‚   β”‚   β”œβ”€β”€ uniswap.py             # Uniswap V2/V3 router
β”‚   β”‚   └── snipe.py               # Liquidity snipe engine
β”‚   β”œβ”€β”€ telegram_bot/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ bot.py                 # Bot initialization
β”‚   β”‚   β”œβ”€β”€ handlers.py            # Command handlers
β”‚   β”‚   └── formatters.py          # Message formatting
β”‚   └── utils/
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ logger.py              # Structured logging
β”‚       └── helpers.py             # Utility functions
β”œβ”€β”€ config/
β”‚   β”œβ”€β”€ .env.example               # Environment template
β”‚   └── settings.yaml              # Default settings
β”œβ”€β”€ data/                          # SQLite DB, usage logs
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ architecture.md            # System architecture
β”‚   β”œβ”€β”€ llm-integration.md         # LLM agent details
β”‚   β”œβ”€β”€ token-usage.md             # Usage tracking guide
β”‚   └── wallet-setup.md            # Wallet configuration
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ screen_token.py            # Screen a token
β”‚   β”œβ”€β”€ usage_report.py            # Generate usage report
β”‚   └── batch_analysis.py          # Batch token analysis
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_scanner.py
β”‚   β”œβ”€β”€ test_llm_agent.py
β”‚   └── test_token_tracker.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ LICENSE
└── README.md

Tech Stack

  • Runtime: Python 3.11+
  • LLM: OpenAI-compatible API (GPT-4o-mini, MiMo-V2.5, DeepSeek)
  • Blockchain: web3.py, Base chain (L2)
  • DEX: Uniswap V2/V3 on Base
  • Data: DexScreener API
  • Bot: python-telegram-bot
  • Storage: SQLite (usage tracking, alerts, history)
  • Scheduling: APScheduler / cron

Cost Efficiency

Using gpt-4o-mini as default model:

Operation Avg Tokens Avg Cost Frequency
Token Screen 3,500 $0.004 On-demand
Rugcheck 5,000 $0.006 On-demand
Price Alert Check 800 $0.001 Every 15 min
Auto-Screen Report 15,000 $0.018 Every 6 hours
Daily PnL Report 8,000 $0.010 Daily

Estimated daily cost: $0.15 - $0.50 depending on activity level.

License

MIT License β€” see LICENSE for details.


Built by joykinder67

About

AI-Powered Meme Token Scanner with LLM Agent, Base Chain Wallet Integration & Token Usage Analytics

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages