Toaster Whitepaper

v1.0 — April 2026 — t0aster.fun

1. Abstract

Toaster is a fully autonomous, agentic Solana memecoin trading system built on pump.fun's Agent Skills framework. It uses artificial intelligence (xAI Grok) to discover and evaluate newly launched tokens, executes on-chain trades via the pump.fun agent API (fun-block.pump.fun), monitors positions with dual-source pricing, and maintains an AI persona on X for trade announcements and community engagement.

The system runs as a single Python process with concurrent subsystems managed via asyncio, requiring only a Solana wallet and API keys to operate. The entire workflow is agentic — no human intervention is needed at any point in the trading lifecycle.

2. Introduction

The Solana memecoin ecosystem generates thousands of new tokens daily via platforms like pump.fun. Most tokens are short-lived, creating a high-frequency trading environment where speed and data-driven decisions are critical.

Toaster addresses this by automating the entire trading lifecycle: discovery, evaluation, execution, monitoring, and exit. Rather than relying on human judgment or static filters, it leverages a large language model (Grok) to analyze on-chain metrics and make buy decisions based on volume patterns, buyer diversity, and price momentum.

The system is built on pump.fun's newly introduced Agent Skills infrastructure — the same API layer that enables autonomous agents to create coins, execute swaps (/agents/swap), and collect creator fees (/agents/collect-fees) programmatically. This makes Toaster a fully agentic system: every subsystem operates autonomously, feeding outputs into the next stage of the pipeline without human intervention.

The agent also functions as a public-facing entity on X, posting about its trades with real data and responding to mentions with market analysis drawn from live on-chain data via the Moralis API.

3. Architecture

Toaster runs seven concurrent subsystems within a single Python asyncio event loop:

  1. Fee Claimer — Claims creator fees for the agent's own token every 2 minutes
  2. AI Coin Scanner — Fetches new pump.fun tokens, enriches with analytics, asks Grok to pick buys
  3. Buyer — Executes buy transactions via the pump.fun AMM, tracks positions
  4. Price Monitor — Polls Jupiter and pump.fun for live pricing, triggers sells
  5. Seller — Executes sell transactions when price thresholds are hit
  6. X Agent — AI-powered reply bot and trade announcement system
  7. Metrics Tracker — Monitors the agent's own token and posts about improvements
main()
  ├── fee_claimer_loop()      [every 120s]
  ├── ai_coin_scanner_loop()  [every 90s]
  ├── buyer_loop()            [queue-driven]
  ├── x_reply_loop()          [every 35s]
  ├── metrics_tracker_loop()  [every 60s]
  └── position_pusher_loop()  [every 10s]

  ca_queue: Scanner → Buyer
  active_positions: Buyer → Price Monitor → Seller
        

4. AI Coin Scanner

The scanner is the primary signal source. It operates on a configurable interval (default: 90 seconds) and follows this process:

4.1 Token Discovery

New tokens are fetched from pump.fun's /coins/currently-live endpoint, which returns the most recently launched coins. The scanner processes the top 10-20 tokens per cycle.

4.2 Data Enrichment

Each candidate is enriched with:

4.3 AI Evaluation

The enriched data is sent to Grok (via xAI API) with a structured prompt defining the selection criteria:

Grok returns a JSON array of recommended mint addresses, which are pushed into the buy queue. A configurable cap (default: 2) limits buys per cycle.

5. Trading Engine

5.1 Buy Execution

The buyer consumes contract addresses from the queue and executes trades using pump.fun's Agent Skills API at fun-block.pump.fun/agents/swap. The API handles account resolution, compute budget, and transaction building — the agent signs and submits. The process:

  1. Build a buy transaction specifying SOL amount, slippage, and optional Jito MEV protection
  2. Sign the transaction with the wallet's keypair using the solders library
  3. Submit via Solana RPC (or Jito bundle endpoints if enabled)
  4. Wait for on-chain confirmation
  5. Record the trade and start price monitoring

A deduplication set ensures no token is bought twice.

5.2 Sell Execution

When the price monitor triggers a sell (at the configured threshold), the seller:

  1. Queries the wallet's token balance via getTokenAccountsByOwner
  2. Builds a sell transaction for the full balance
  3. Signs and submits
  4. Records the trade with price-based PnL calculation
  5. Posts a sell announcement via the X agent

5.3 Jito Integration

When enabled, transactions are submitted as Jito bundles with a configurable tip. The system tries multiple Jito endpoints (mainnet, Amsterdam, Frankfurt, NY, Tokyo) for reliability.

6. Price Monitoring

After each buy, a dedicated price monitor coroutine is spawned for that position. The monitor uses a dual-source pricing strategy:

  1. Primary: Jupiter v3 lite APIhttps://lite-api.jup.ag/price/v3 with 5-second timeout
  2. Fallback: pump.fun API — derives price from usd_market_cap / 1,000,000,000 with 5-second timeout

The monitor polls every second (configurable) and calculates the percentage change from entry price. When the absolute change exceeds the threshold (default: 20%), it triggers a sell.

For new tokens not yet indexed by Jupiter, the monitor includes a retry window of 60 attempts at 3-second intervals before the initial price is established.

7. Fee Collection

Toaster's own token generates creator fees through pump.fun's fee mechanism. The fee claimer subsystem calls the fun-block API's /agents/collect-fees endpoint every 2 minutes to claim accumulated fees.

The transaction is signed and submitted through the same pipeline as trades, with on-chain confirmation.

8. X Agent

The X agent operates two functions: trade announcements and mention replies.

8.1 Trade Announcements

After every buy or sell, the agent generates a tweet using Grok. The prompt includes:

The AI is instructed to write concise, data-driven tweets that reflect the actual trade outcome (profit or loss).

8.2 Reply Bot

The agent polls for mentions every 35 seconds using the X API v2 mentions timeline. For each new mention:

  1. Extract any contract addresses from the tweet
  2. Fetch live data for mentioned tokens and the agent's own token
  3. Build a context string with market data and recent trades
  4. Generate a reply via Grok with the toasteragent persona
  5. Post the reply

A persistence file tracks replied tweet IDs to avoid duplicate responses.

8.3 AI Persona

The toasteragent persona is defined by a system prompt that establishes:

9. Metrics Tracker

The metrics tracker monitors the agent's own token by polling Moralis analytics every 60 seconds. Each snapshot records:

When improvements are detected compared to the previous snapshot (price up ≥1%, market cap up, increased buyers or volume), the agent generates a "bragging" tweet referencing the actual data points.

10. Persistence

All critical state is persisted to JSON files, enabling the bot to survive restarts without losing context:

11. Technical Stack

12. Risk Factors

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

Back to Home View Token