The Pump Fun WebSocket API provides real-time monitoring of the Pump Fun platform on Solana, enabling developers to track buy/sell transactions and new token launches as they occur on-chain.

WebSocket Endpoint

wss://api.nolimitnodes.com/socket?apikey=YOUR_API_KEY

Trade Events

Subscribe to Trades

{
  "method": "dataSubscribe",
  "params": {
    "referenceId": "PUMP_TRADES",
    "streams": [
      {
        "stream": "pumpFunTradesSubscribe",
        "params": {
          "token": "2M4QNeba4PAorsCmi6gkg3Gn7NvBqnL9A6BTj9zApump",
          "wallet": "GPSwijrmxy7ChMHB1P8YSp5sa5Rsj4bYnrTZYF4Ydbow",
          "isBuy": true
        }
      }
    ]
  },
  "id": 1
}

Trade Filter Parameters

token
string
Token mint address to filter trades by.
wallet
string
Filter by specific trader wallet address.
isBuy
boolean
Filter by trade type (true = buys only, false = sells only).
programId
string
Filter by Pump Fun program ID.
All trade filter parameters are optional. Omit all to receive every Pump Fun trade event.

Subscription Confirmation

{
  "status": "Subscribed to pumpFunTrades",
  "subscription_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "stream": "pumpFunTradesSubscribe",
  "reference_id": "PUMP_TRADES"
}

Trade Event Response

{
  "method": "pumpFunTradesSubscribe",
  "subscription_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "result": {
    "signature": "2xBSNuTJkk5YYSK...",
    "mint": "2M4QNeba4PAorsCmi6gkg3Gn7NvBqnL9A6BTj9zApump",
    "traderPublicKey": "GPSwijrmxy7ChMHB1P8YSp5sa5Rsj4bYnrTZYF4Ydbow",
    "txType": "buy",
    "tokenAmount": 1000000,
    "marketCapSol": 250.5,
    "vTokensInBondingCurve": 800000000,
    "vSolInBondingCurve": 120.3,
    "solAmount": 0.5,
    "blockUnixTime": 1735683247,
    "slot": 123456789
  }
}

Trade Response Fields

result
object

Token Creation Events

Subscribe to Token Creations

{
  "method": "dataSubscribe",
  "params": {
    "referenceId": "PUMPFUN_CREATE_TOKENS",
    "streams": [
      {
        "stream": "pumpFunCreateTokensSubscribe",
        "params": {
          "event_type": "create_coin",
          "creator": "DYw9vHXgH7cJhQPfNfhGqBwHGcKG8H4bXgqPfVdVow"
        }
      }
    ]
  },
  "id": 1
}

Creation Filter Parameters

name
string
Filter by token name.
symbol
string
Filter by token symbol.
mint
string
Filter by token mint address.
user
string
Filter by user/creator wallet address.
creator
string
Filter by creator wallet address.
All creation filter parameters are optional. Omit all to receive every token creation event.

Subscription Confirmation

{
  "status": "Subscribed to pumpFunCreateTokens",
  "subscription_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "stream": "pumpFunCreateTokensSubscribe",
  "reference_id": "PUMPFUN_CREATE_TOKENS"
}

Token Creation Response

{
  "method": "pumpFunCreateTokensSubscribe",
  "subscription_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "result": {
    "signature": "3xvKdnJkX8ZYSK...",
    "mint": "HcLKQJvJnfbGo4vhxBnL3bK9cGJGX7FBwdZapump",
    "name": "My Token",
    "symbol": "MTK",
    "uri": "https://ipfs.io/ipfs/...",
    "creator": "DYw9vHXgH7cJhQPfNfhGqBwHGcKG8H4bXgqPfVdVow",
    "description": "A new token on Pump Fun",
    "imageUri": "https://ipfs.io/ipfs/...",
    "metadataUri": "https://ipfs.io/ipfs/...",
    "twitter": "@mytoken",
    "telegram": "@mytokengroup",
    "website": "https://mytoken.com",
    "showName": true,
    "createdTimestamp": 1735683247,
    "raydiumPool": null,
    "complete": false,
    "totalSupply": 1000000000,
    "blockUnixTime": 1735683247,
    "slot": 123456789
  }
}

Creation Response Fields

result
object

Unsubscribe

Request

{
  "method": "dataUnsubscribe",
  "params": {
    "subscriptionIds": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
    "referenceId": "UNSUB_REF"
  }
}

Response

{
  "status": "Unsubscribed",
  "unsubscribed_ids": ["a1b2c3d4-e5f6-7890-abcd-ef1234567890"],
  "reference_id": "UNSUB_REF"
}

Code Examples

const WebSocket = require("ws");

class PumpFunMonitor {
  constructor(apiKey) {
    this.apiKey = apiKey;
    this.ws = null;
    this.tokenStats = {};
    this.newTokens = [];
  }

  connect() {
    this.ws = new WebSocket(
      `wss://api.nolimitnodes.com/socket?apikey=${this.apiKey}`
    );
    this.setupHandlers();
  }

  setupHandlers() {
    this.ws.on("open", () => {
      console.log("Connected to Pump Fun streams");
      this.subscribeToAll();
    });

    this.ws.on("message", (data) => {
      const message = JSON.parse(data);

      if (message.method === "pumpFunTradesSubscribe") {
        this.processTrade(message.result);
      } else if (message.method === "pumpFunCreateTokensSubscribe") {
        this.processTokenCreation(message.result);
      } else {
        console.log("Info:", JSON.stringify(message));
      }
    });

    this.ws.on("error", (error) => {
      console.error("WebSocket error:", error.message);
    });

    this.ws.on("close", () => {
      console.log("Connection closed. Reconnecting...");
      this.reconnect();
    });
  }

  subscribeToAll() {
    // Subscribe to all trades
    this.ws.send(
      JSON.stringify({
        method: "dataSubscribe",
        params: {
          referenceId: "PUMP_TRADES",
          streams: [
            { stream: "pumpFunTradesSubscribe", params: {} },
          ],
        },
        id: 1,
      })
    );

    // Subscribe to token creations
    this.ws.send(
      JSON.stringify({
        method: "dataSubscribe",
        params: {
          referenceId: "PUMP_CREATES",
          streams: [
            { stream: "pumpFunCreateTokensSubscribe", params: {} },
          ],
        },
        id: 2,
      })
    );
  }

  processTrade(trade) {
    const mint = trade.mint;

    // Initialize token stats if not tracked
    if (!this.tokenStats[mint]) {
      this.tokenStats[mint] = {
        buys: 0,
        sells: 0,
        totalVolumeSol: 0,
        lastMarketCap: 0,
      };
    }

    const stats = this.tokenStats[mint];
    if (trade.txType === "buy") {
      stats.buys++;
    } else {
      stats.sells++;
    }
    stats.totalVolumeSol += trade.solAmount;
    stats.lastMarketCap = trade.marketCapSol;

    console.log(
      `${trade.txType.toUpperCase()} ${mint.slice(0, 8)}... | ` +
      `${trade.solAmount} SOL | MCap: ${trade.marketCapSol.toFixed(2)} SOL | ` +
      `B/S: ${stats.buys}/${stats.sells}`
    );
  }

  processTokenCreation(token) {
    this.newTokens.push({
      mint: token.mint,
      name: token.name,
      symbol: token.symbol,
      creator: token.creator,
      timestamp: token.createdTimestamp,
    });

    console.log(
      `\nNEW TOKEN: ${token.name} (${token.symbol})`
    );
    console.log(`  Mint: ${token.mint}`);
    console.log(`  Creator: ${token.creator.slice(0, 12)}...`);
    console.log(`  Twitter: ${token.twitter || "N/A"}`);
    console.log(`  Website: ${token.website || "N/A"}`);
    console.log(`  Total Supply: ${token.totalSupply}`);
  }

  reconnect() {
    setTimeout(() => this.connect(), 5000);
  }

  getTopTokens(limit = 10) {
    return Object.entries(this.tokenStats)
      .sort((a, b) => b[1].totalVolumeSol - a[1].totalVolumeSol)
      .slice(0, limit)
      .map(([mint, stats]) => ({ mint, ...stats }));
  }
}

// Usage
const monitor = new PumpFunMonitor("YOUR_API_KEY");
monitor.connect();

Trading Strategies

New Token Sniping

  • Monitor pumpFunCreateTokensSubscribe for newly created tokens and evaluate metadata quality.
  • Check if the creator has social links (Twitter, Telegram, website) as signals of legitimacy.
  • Track initial buy volume immediately after creation to gauge early interest.
  • Filter for tokens with complete: false to find tokens still on the bonding curve.

Volume Detection

  • Track totalVolumeSol per token to identify tokens gaining traction.
  • Monitor the buy/sell ratio to detect sustained buying pressure.
  • Set thresholds for volume alerts (e.g., tokens exceeding 50 SOL in 5 minutes).
  • Compare volume across multiple tokens to find relative outperformers.

Bonding Curve Analysis

  • Monitor vTokensInBondingCurve and vSolInBondingCurve to track curve progression.
  • Calculate the percentage of the curve completed to estimate proximity to graduation.
  • Track the rate of curve progression to predict graduation timing.
  • Watch for the complete: true flag and raydiumPool value for graduation events.

Best Practices

Rate Limiting

  • Use filter parameters to reduce the volume of incoming messages in production.
  • Implement client-side throttling for analytics processing to avoid CPU spikes.
  • Batch database writes rather than writing on every event.
  • Consider subscribing to specific tokens rather than the full firehose when possible.

Data Management

  • Store trade history efficiently with proper indexing on mint address and timestamp.
  • Implement data retention policies to manage memory usage for long-running monitors.
  • Use in-memory aggregations for real-time stats and persist summaries periodically.
  • Clean up tokenStats for tokens that have been inactive for extended periods.

Risk Management

  • Never make trading decisions based solely on a single data point or metric.
  • Validate token metadata and social links independently before acting on creation events.
  • Be cautious of tokens with extremely rapid buy patterns, which may indicate coordinated activity.
  • Monitor for rug pull signals: sudden large sells, creator wallet dumping, or authority changes.