pump-analyzer-solana
Real-time monitoring and analytics platform for Pump.fun tokens on Solana using WebSockets, HTML/CSS/JS
What this skill does
# PumpAnalyzer — Solana Token Monitoring Platform
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
PumpAnalyzer is a **static front-end platform** (pure HTML/CSS/JS, no build tools) that provides real-time monitoring, analytics, and alerts for tokens launched on [Pump.fun](https://pump.fun) on the Solana blockchain. It connects to Pump.fun's WebSocket API for sub-second updates, displays price/volume charts, supports custom alert criteria, and includes non-custodial Solana wallet connection.
---
## Installation
```bash
git clone https://github.com/happyboy4ty25/pump-analyzer.git
cd pump-analyzer
open index.html # or use a local dev server
```
No npm, no bundler, no dependencies — open `index.html` directly in a browser or serve with any static file server:
```bash
# Python
python3 -m http.server 8080
# Node (npx)
npx serve .
# VS Code
# Use the "Live Server" extension
```
---
## Project Structure
```
pump-analyzer/
├── index.html # Main landing page & app shell
├── css/
│ └── style.css # All styles, animations, responsive layout
├── js/
│ ├── main.js # App init, UI interactions, animations
│ ├── websocket.js # Pump.fun WebSocket connection & event handling
│ ├── wallet.js # Solana wallet adapter (Phantom, Solflare, etc.)
│ ├── alerts.js # Custom alert criteria logic
│ └── charts.js # Price/volume chart rendering
└── assets/
└── ... # Icons, images
```
---
## Key Concepts & Architecture
### 1. Pump.fun WebSocket Connection
PumpAnalyzer subscribes to Pump.fun's real-time data stream. The core pattern:
```javascript
// js/websocket.js
const PUMP_FUN_WS_URL = 'wss://pumpportal.fun/api/data';
class PumpWebSocket {
constructor(onToken, onTrade) {
this.onToken = onToken; // callback for new token launches
this.onTrade = onTrade; // callback for trade events
this.ws = null;
this.reconnectDelay = 1000;
}
connect() {
this.ws = new WebSocket(PUMP_FUN_WS_URL);
this.ws.addEventListener('open', () => {
console.log('[PumpWS] Connected');
this.reconnectDelay = 1000;
// Subscribe to new token creation events
this.ws.send(JSON.stringify({
method: 'subscribeNewToken'
}));
// Subscribe to all trades on new tokens
this.ws.send(JSON.stringify({
method: 'subscribeTokenTrade',
keys: [] // empty = all tokens
}));
});
this.ws.addEventListener('message', (event) => {
const data = JSON.parse(event.data);
if (data.txType === 'create') {
this.onToken(data);
} else if (data.txType === 'buy' || data.txType === 'sell') {
this.onTrade(data);
}
});
this.ws.addEventListener('close', () => {
console.warn('[PumpWS] Disconnected — reconnecting in', this.reconnectDelay, 'ms');
setTimeout(() => this.connect(), this.reconnectDelay);
this.reconnectDelay = Math.min(this.reconnectDelay * 2, 30000);
});
this.ws.addEventListener('error', (err) => {
console.error('[PumpWS] Error:', err);
this.ws.close();
});
}
// Subscribe to trades for a specific token mint
subscribeToken(mintAddress) {
if (this.ws?.readyState === WebSocket.OPEN) {
this.ws.send(JSON.stringify({
method: 'subscribeTokenTrade',
keys: [mintAddress]
}));
}
}
disconnect() {
this.ws?.close();
}
}
export default PumpWebSocket;
```
### 2. Handling New Token Events
```javascript
// js/main.js
import PumpWebSocket from './websocket.js';
const tokenList = [];
function onNewToken(tokenData) {
// tokenData shape from Pump.fun:
// {
// signature: string,
// mint: string, // token mint address
// traderPublicKey: string,
// txType: 'create',
// name: string,
// symbol: string,
// description: string,
// imageUri: string,
// initialBuy: number, // SOL amount
// marketCapSol: number,
// uri: string,
// timestamp: number
// }
tokenList.unshift(tokenData);
renderTokenCard(tokenData);
checkAlerts(tokenData);
}
function onTrade(tradeData) {
// tradeData shape:
// {
// signature: string,
// mint: string,
// traderPublicKey: string,
// txType: 'buy' | 'sell',
// tokenAmount: number,
// solAmount: number,
// newTokenBalance: number,
// bondingCurveKey: string,
// vTokensInBondingCurve: number,
// vSolInBondingCurve: number,
// marketCapSol: number,
// timestamp: number
// }
updateTokenMetrics(tradeData.mint, tradeData);
}
const pumpWS = new PumpWebSocket(onNewToken, onTrade);
pumpWS.connect();
```
### 3. Rendering Token Cards
```javascript
// js/main.js
function renderTokenCard(token) {
const container = document.getElementById('token-feed');
const card = document.createElement('div');
card.className = 'token-card';
card.dataset.mint = token.mint;
card.innerHTML = `
<div class="token-header">
<img src="${token.imageUri || 'assets/placeholder.png'}"
alt="${token.symbol}"
class="token-image"
onerror="this.src='assets/placeholder.png'">
<div class="token-info">
<span class="token-name">${escapeHtml(token.name)}</span>
<span class="token-symbol">$${escapeHtml(token.symbol)}</span>
</div>
<span class="token-time">${formatTimestamp(token.timestamp)}</span>
</div>
<div class="token-metrics">
<div class="metric">
<label>Market Cap</label>
<span class="market-cap">${formatSol(token.marketCapSol)} SOL</span>
</div>
<div class="metric">
<label>Initial Buy</label>
<span>${formatSol(token.initialBuy)} SOL</span>
</div>
</div>
<div class="token-actions">
<a href="https://pump.fun/${token.mint}" target="_blank" rel="noopener"
class="btn btn-small">View on Pump.fun</a>
<button class="btn btn-small btn-outline"
onclick="setAlert('${token.mint}')">Set Alert</button>
</div>
`;
// Animate in
card.style.opacity = '0';
card.style.transform = 'translateY(-10px)';
container.prepend(card);
requestAnimationFrame(() => {
card.style.transition = 'opacity 0.3s, transform 0.3s';
card.style.opacity = '1';
card.style.transform = 'translateY(0)';
});
// Cap the list at 50 cards
while (container.children.length > 50) {
container.removeChild(container.lastChild);
}
}
function escapeHtml(str) {
const div = document.createElement('div');
div.textContent = str;
return div.innerHTML;
}
function formatSol(amount) {
return amount ? Number(amount).toFixed(2) : '0.00';
}
function formatTimestamp(ts) {
return new Date(ts * 1000).toLocaleTimeString();
}
```
### 4. Custom Alerts System
```javascript
// js/alerts.js
const MAX_FREE_ALERTS = 5;
class AlertManager {
constructor() {
this.alerts = JSON.parse(localStorage.getItem('pump_alerts') || '[]');
this.dailyCount = parseInt(localStorage.getItem('pump_alert_count') || '0');
this.plan = localStorage.getItem('pump_plan') || 'free';
}
canAddAlert() {
if (this.plan !== 'free') return true;
return this.dailyCount < MAX_FREE_ALERTS;
}
addAlert({ mint, criteria }) {
// criteria: { minMarketCap, maxMarketCap, minVolume, keywords }
if (!this.canAddAlert()) {
showUpgradeModal('You've reached the free plan limit of 5 alerts/day.');
return false;
}
const alert = { id: Date.now(), mint, criteria, active: true };
this.alerts.push(alert);
this._save();
return alert;
}
checkToken(tokenData) {
for (const alert of this.alerts) {
if (!alert.active) continue;
if (this._matches(tokenData, alert.criteria)) {
this._trigger(alert, tokenData);
}
}
}
_matches(token, criteria) {
if (criteria.minMarketCap && token.marketCapSol < criteria.minMarketCap) return false;
if (criteria.maxMarketCap Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.