Skip to content
View toasteragent's full-sized avatar

Block or report toasteragent

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
toasteragent/README.md
banner

Toaster — Autonomous Solana Memecoin Trading Agent

An AI-powered trading bot that autonomously discovers, buys, monitors, and sells memecoins on pump.fun. Uses xAI (Grok) for coin analysis, trade announcements, and as a reply bot on X.

What it does

Subsystem Description
AI Coin Scanner Fetches newly launched pump.fun tokens, enriches them with Moralis analytics, and asks Grok to pick the best candidates
Buyer Executes buys via pump.fun AMM, tracks positions, never buys the same token twice
Price Monitor Polls Jupiter + pump.fun for live price, auto-sells at configurable +/- threshold
Fee Claimer Claims creator fees for your own token on a loop
X Agent AI-powered reply bot + trade announcements using the toasteragent persona
Metrics Tracker Monitors your token's on-chain metrics and posts when things improve

Setup

1. Install dependencies

pip install -r requirements.txt

2. Configure environment

Copy the example env file and fill in your keys:

cp .env.example .env

Required variables:

Variable Description
PRIVATE_KEY Your Solana wallet private key (base58)
RPC_URL Solana RPC endpoint (Helius, QuickNode, etc.)
XAI_API_KEY xAI API key for Grok (powers the AI scanner + agent)

Optional but recommended:

Variable Description
MORALIS_API_KEY Moralis API key for token analytics
FEE_CLAIM_CA Your token's contract address (for fee claiming)
X_CONSUMER_KEY / X_CONSUMER_SECRET / X_ACCESS_TOKEN / X_ACCESS_TOKEN_SECRET X API credentials for posting tweets

3. Load env and run

# Linux/Mac
export $(cat .env | xargs)
python app.py

# Windows (PowerShell)
Get-Content .env | ForEach-Object { if ($_ -match '^\s*([^#]\S+?)=(.*)$') { [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2]) } }
python app.py

How the AI Scanner works

  1. Fetches the latest coins from pump.fun's live feed
  2. Enriches each coin with live price (Jupiter/pump.fun) and Moralis analytics (volume, buyers, momentum)
  3. Sends the data to Grok and asks it to pick the best candidates based on:
    • Buy volume > sell volume (bullish pressure)
    • Multiple unique buyers
    • Market cap $2k–$100k (early but alive)
    • Positive price momentum
  4. Winning picks go into the buy queue

Trading flow

AI Scanner picks coin → Buyer executes swap → Price Monitor tracks → Auto-sell at ±20%
                                                                   → Post tweet about trade

Persistence

The bot saves state to JSON files so it survives restarts:

  • bought_cas.json — tokens already bought (never re-buys)
  • trades.json — full trade history
  • replied_ids.json — X tweet IDs already replied to
  • own_metrics.json — last metrics snapshot for your token

Configuration

All settings are configurable via environment variables. See .env.example for the full list. Key trading parameters:

Setting Default Description
BUY_AMOUNT_SOL 0.01 SOL per buy
PRICE_CHANGE_THRESHOLD 20 Sell trigger (± percent)
SCAN_INTERVAL 90 Seconds between AI scans
MAX_BUYS_PER_SCAN 2 Max tokens to buy per scan cycle

APIs used

  • pump.fun — token data + AMM swaps via fun-block API
  • Jupiter — price feeds (v3 lite API)
  • Moralis — token metadata + analytics
  • xAI — Grok model for AI analysis + tweet generation
  • X API v2 — posting tweets + reading mentions

Disclaimer

This is experimental software. Trading memecoins is extremely risky. Use at your own risk. Never trade with more than you can afford to lose.

Popular repositories Loading

  1. toasteragent toasteragent Public

    An AI-powered trading bot that autonomously discovers, buys, monitors, and sells memecoins on [pump.fun](https://pump.fun). Uses xAI (Grok) for coin analysis, trade announcements, and as a reply bo…

    Python