ββββ ββββββββββββββββ ββββββββββββ ββββββββ ββββββββββββββ ββββββββββββββββββββ βββ
βββββ ββββββββββββββββββ βββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββ βββ
βββββββββββββββββ βββββββββββββββββ βββββββββββ ββββββββββββββ ββββββ ββββββ βββ
βββββββββββββββββ βββββββββββββββββ βββββββββββ ββββββββββββββ ββββββ ββββββββββ
βββ βββ ββββββββββββββ βββ βββββββββββ βββββββββββββββββββ ββββββββββββββββββββββ ββββββ
βββ ββββββββββββββ βββββββββββ ββββββββ ββββββββββ ββββββββββββββββββββββ βββββ
AI-Powered Meme Token Scanner with LLM Agent, Wallet Integration & Token Usage Analytics
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.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| 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 |
| 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 |
| 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 |
/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
- Python 3.11+
- Telegram Bot Token (from @BotFather)
- LLM API Key (OpenAI-compatible endpoint)
- Base chain wallet with ETH
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# 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.00The system tracks every LLM call with full transparency:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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 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%) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
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
);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.
- 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
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
- 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
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.
MIT License β see LICENSE for details.
Built by joykinder67