# Pump.fun Real-Time Token & Buyer Analytics Dashboard

A zero-latency dashboard that monitors every new token minted on Pump.fun (Solana), capturing and analyzing the first 100 unique buyers per token, and visualizing their holdings, trades, P&L, and supply share in an interactive, real-time frontend. Features include live buyer tracking, sortable/expandable tables, real-time stats, and advanced analytics powered by Solana WebSockets, Helius API, and PostgreSQL, with a modern React.js UI for seamless, instant updates.

## How it works

1. **Pick your starting point**  
   Use this app or start from scratch  
2. **Describe your changes**  
   Tell AI what to customize — in plain English  
3. **Ship it**  
   Your app goes live with free hosting

## The AI prompt behind this app

```
Objective
Develop a zero-latency dashboard monitoring every new token minted on Pump.fun (Solana), capturing and analyzing the first 100 unique buyers for each token, and visualizing their holdings, trades, P&L, and supply share in an interactive frontend.

⚙️ Backend Requirements
Tech Stack:

- Node.js (with TypeScript) or FastAPI (Python)
- PostgreSQL for structured data
- Redis for real-time/live cache
- WebSocket Solana RPC, Helius API, or Bitquery/Tracker WebSocket for streaming chain events
- Optional: Supabase/Hasura for instant GraphQL APIs

Token & Buyer Monitoring:

- Detect new Pump.fun mints:
  - Subscribe to Solana logs using RPC/Helius/Bitquery/Tracker WebSockets.
  - Filter mint instructions originating from Pump.fun smart contracts.

For each new token:
  - Store token metadata: mint address, symbol, decimals, total supply, logo (if available), launch timestamp.  
  - Enrich with market data (liquidity pool, market cap, launch price).

First 100 Unique Buyers:
Monitor buy transactions via getSignaturesForAddress or trade endpoints.
- Parse each transaction:
  - Buyer (wallet) address
  - SOL spent (buy-in amount)
  - Tokens received
  - Timestamp & transaction signature

Track unique wallets; capture only the first 100 for each token.

Live Buyer Tracking:
- For each of the first 100 buyers per token:
  - Update buy/sell activity in real time—track on-chain token/SOL transfers, not just initial buys.
  - Continuously query getTokenAccountsByOwner and listen for transfers.
  - Detect sells by outgoing token transfers and receipt of SOL.
  - Calculate and update:
    - Total SOL spent, total SOL sold, current token holdings
    - Profit/loss (use best effort via average buy price and executed sales—track price curve updates if possible).
    - % of token supply owned (divide holding by total_supply)
- Store buyer history, update positions live.

API Exposure:
Provide REST or WebSocket/GraphQL endpoints for:

- Latest tracked tokens and full tracked state of their 100 buyers (see sample schema below)
- Token details, buy/sell history
- Per-buyer performance analytics (P&L, volume, supply share)
- Real-time push (WebSocket/SSE) for frontend

Example API Schema:

```json
GET /api/tokens/latest
{
  "mint": "XXXX...",
  "name": "BONK42",
  "launch_time": "2025-08-02T13:00:00Z",
  "total_supply": 1000000000,
  "buyers": [
    {
      "wallet": "F5K....88K",
      "buy_amount_sol": 2.5,
      "sell_amount_sol": 0.8,
      "current_holding": 1023000,
      "supply_percent": 1.02,
      "pnl": "+1.7 SOL"
    }
  ]
}
```

Recommended Libraries / Platforms:

- Helius API, Solana Tracker API (@solana-tracker/data-api), or Bitquery for efficient real-time streaming and transaction parsing.

Use their specific methods for:

- /first-buyers/{token} (get tracked first buyers automatically with P&L data).
- /pnl/{wallet}/{token} for live profit/loss snapshot by buyer and token.
- WebSocket endpoints for event/transfer streaming.

🖥️ Frontend Requirements
Tech Stack:

- React.js or Next.js
- TailwindCSS, Framer Motion (for smooth UX/UI)
- Shadcn/UI or Radix UI for interactive table/card layouts
- Socket.IO or React Query for live API/data updates

Features:
- Responsive, modern real-time dashboard for all tracked tokens.
- Each token displays:
  - Token logo, name, mint address, launch time, total supply, real-time stats (buyers/volume/liquidity)
- Collapsible or navigable sections for token details vs. buyers.
- Live Buyers Table: (sortable, filterable, expandable rows)
  - Wallet address (shortened, copyable), buy/sell amounts (SOL), holding (tokens), supply %, profit/loss (P&L)
  - Tooltip for all transaction timestamps.
- Etherscan-like expandable table rows to show buyer’s full activity.
- Dark mode and smooth mobile-responsiveness.

Live Update Mechanics:
- Use WebSocket feed or incremental polling for instant data refresh.

🧩 Optional/Bonus (for Extra Credit)
Render a chart of token price vs. first 100 buyer inflows (time series)

- Live leaderboard for most profitable first 100 buyers
- Email/Discord notifications on new launches, whales, or top profits
- DEX integration for real-time price feed (e.g., Jupiter/SolanaFM)
- Social/trending highlight, liquidity indicators

📝 Notes & Key References
- Use Subscriptions/WebSockets for all on-chain events for true real-time experience.
- Use indexed databases for fast lookups and history replay.
- Leverage third-party data APIs (Solana Tracker, Bitquery) for enriched, scalable analytics and price/P&L endpoints out-of-the-box.
- Table row expansion for complete on-chain history per buyer.
- Use described REST/WebSocket API schema for clear frontend/backend contract.

**Following this prompt will let your devs ship a robust, professional, real-time Pump.fun token dashboard.
```

## Ready to build yours?

This app was built with AI in minutes — and you can do the same. Start with Pump.fun Real-Time Token & Buyer Analytics Dashboard and customize it however you want.
