Find Pump.fun First Buyers Before You Trade
List early Pump.fun buyers, inspect wallet PnL and monitor sniper percentage before trading a fresh token.
First buyers define the early market
The first wallets into a Pump.fun launch often define whether you're early or exit liquidity, call GET /first-buyers/{mint} to list the earliest buyers with PnL, or subscribe to snipers on the Datastream for live sniper-percentage updates.
What you need
- A Solana Tracker API key (free) and Datastream key (Premium+, same dashboard)
- Node.js 18+
- Optional: Pump.fun mint (
TOKEN_MINT); the example auto-picks a high-volume Pump token if unset - Optional: Datastream key +
STREAM_SNIPERS=1for live sniper-% updates (Premium+)
Step 1: First buyers (REST)
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: process.env.ST_API_KEY, baseUrl: 'https://data.solanatracker.io' });
const buyers = await client.getFirstBuyers(MINT);
for (const row of buyers.slice(0, 20)) {
console.log(row.wallet, row.total, row.first_buy_time);
}
Each row includes wallet, buy timing, and PnL where indexed.
Step 2: PnL v2 first buyers (richer analytics)
For identity tags and nested wallet PnL:
const enriched = await client.getPnlV2TokenFirstBuyers(MINT, {
sort: 'first_trade',
direction: 'asc',
limit: 50,
});
Step 3: Live sniper percentage (WebSocket)
import WebSocket from 'ws';
(globalThis as any).WebSocket = WebSocket;
const { Datastream } = await import('@solana-tracker/data-api');
const ds = new Datastream({ wsUrl: `wss://datastream.solanatracker.io/${process.env.ST_DATASTREAM_KEY}` });
await ds.connect();
// Set STREAM_SNIPERS=1 in .env when running the GitHub example
ds.subscribe.snipers(MINT).on((update) => {
console.log('Sniper %:', update.totalPercentage);
});
Pair this with the launch stream, detect the mint, then immediately inspect first buyers.
FAQ
How many first buyers do I get?
Up to 100 via getFirstBuyers(); use PnL v2 endpoints for pagination and sorting.
What's a "sniper" here?
Wallets that bought within the first few blocks of launch, high sniper % often means heavy bot competition.
Do I need gRPC for this?
No. REST + Datastream covers analytics for most dashboards. gRPC is for raw program-level detection (Pump.fun gRPC guide).
Related: Stream Pump.fun launches -> · Pump.fun API
Download the example
Clone the full runnable project on GitHub, npm install && npm start with your keys in .env. Or open it in StackBlitz to run in your browser (free). See the tutorial for step-by-step context.
Runnable Node.js project — clone from GitHub, add keys to .env, then npm start. StackBlitz runs REST and Datastream examples in your browser for free.