The pre-buy check for a pump.fun trading agent
· · Calls, limits and prices as of 2026-10-24.
What should a pump.fun trading agent check before it buys?
Three things, in three calls to pumpdata.fun, free under /free/ with no key: who launched the coin and how their earlier launches went (GET /launch/{mint}), who is buying it and what those wallets have done before (POST /wallets), and the odds a coin in that market-cap band had of running (GET /baserate). The answers come from every pump.fun trade since pump.fun's first day, so a deployer's record and a buyer's history are whole, not the last week's. The code below is the whole check; paste it into the agent.
The check in Python
Standard library only. python3 prebuy.py <mint> [buyer wallets...] prints the result as JSON.
# The pre-buy check: three calls to pumpdata.fun before a pump.fun buy. Free under /free/ (30 calls
# every five minutes and 300 a day per IP, no key, no signup). Paid path: drop "/free" and pay per call over x402, or send x-api-key.
import json, urllib.request
from datetime import datetime, timedelta, timezone
BASE = "https://pumpdata.fun/free"
def get(path):
with urllib.request.urlopen(BASE + path, timeout=10) as r:
return json.load(r)
def post(path, body):
req = urllib.request.Request(BASE + path, json.dumps(body).encode(), {"content-type": "application/json"})
with urllib.request.urlopen(req, timeout=10) as r:
return json.load(r)
def prebuy_check(mint, buyers=(), band="15k-28k"):
"""mint: the coin. buyers: up to 50 wallet addresses that bought it (from your feed). band: the market-cap
band you buy in. Returns the dev's record, the bundle, how similar launches went, who the buyers are, and the
base rate for the band, plus plain flags. It is numbers from every pump.fun trade, ever; it is not advice."""
launch = get(f"/launch/{mint}")
wallets = post("/wallets", {"addresses": list(buyers)[:50], "mint": mint}) if buyers else {}
to = datetime.now(timezone.utc).replace(hour=0, minute=0, second=0, microsecond=0)
frm = to - timedelta(days=1)
base = get(f"/baserate?band={band}&from={frm:%Y-%m-%dT%H:%M:%SZ}&to={to:%Y-%m-%dT%H:%M:%SZ}")
dev, bundle, matches = launch["deployer"], launch["bundle_at_creation"], launch["matches"]
classes = {a: w["class"] for a, w in wallets.items() if isinstance(w, dict) and "class" in w}
flags = []
if dev["launches"] >= 20 and dev["graduations"] == 0:
flags.append(f"dev has {dev['launches']} launches and no graduation")
if bundle["supply_share"] >= 0.5:
flags.append(f"{bundle['supply_share']:.0%} of the supply was bought in the first 10 s")
if (launch.get("insider_supply_share") or 0) >= 0.5:
flags.append(f"insiders hold {launch['insider_supply_share']:.0%} of the supply")
cc = launch.get("curve_bought_at_launch") or {}
if cc.get("yes") and (cc.get("launching_wallets_hold_now") or 0) > 0.5:
flags.append("the launcher bought the whole curve as it launched and still holds it")
if matches["n"] >= 20 and matches["peak_day1"]["dead"] / matches["n"] >= 0.9:
flags.append(f"{matches['peak_day1']['dead']} of {matches['n']} launches like it were dead by day one")
sellers = sum(1 for c in classes.values() if c == "supply_seller")
if sellers:
flags.append(f"{sellers} of {len(classes)} buyers are supply sellers")
return {"flags": flags, "dev": dev, "bundle": bundle, "similar_launches": matches,
"buyers": classes, "base_rate": base["reached"], "median_peak": base["median_peak"]}
if __name__ == "__main__":
import sys
print(json.dumps(prebuy_check(sys.argv[1], sys.argv[2:]), indent=1))
The same in TypeScript
// The pre-buy check in TypeScript (Node 18+ or any runtime with fetch). Free under /free/, 30 calls every five minutes and 300 a day per IP.
const BASE = "https://pumpdata.fun/free"; // paid path: drop "/free" (x402 per call, or x-api-key)
const get = (p: string) => fetch(BASE + p).then((r) => r.json());
const post = (p: string, body: unknown) =>
fetch(BASE + p, { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(body) }).then((r) => r.json());
export async function prebuyCheck(mint: string, buyers: string[] = [], band = "15k-28k") {
const launch = await get(`/launch/${mint}`);
const wallets = buyers.length ? await post("/wallets", { addresses: buyers.slice(0, 50), mint }) : {};
const to = new Date(); to.setUTCHours(0, 0, 0, 0);
const from = new Date(to.getTime() - 86400e3);
const iso = (d: Date) => d.toISOString().replace(/\.\d{3}Z$/, "Z");
const base = await get(`/baserate?band=${band}&from=${iso(from)}&to=${iso(to)}`);
const { deployer: dev, bundle_at_creation: bundle, matches } = launch;
const classes: Record<string, string> = {};
for (const [a, w] of Object.entries<any>(wallets)) if (w && typeof w === "object" && "class" in w) classes[a] = w.class;
const flags: string[] = [];
if (dev.launches >= 20 && dev.graduations === 0) flags.push(`dev has ${dev.launches} launches and no graduation`);
if (bundle.supply_share >= 0.5) flags.push(`${Math.round(bundle.supply_share * 100)}% of the supply was bought in the first 10 s`);
if ((launch.insider_supply_share ?? 0) >= 0.5) flags.push(`insiders hold ${Math.round(launch.insider_supply_share * 100)}% of the supply`);
const cc = launch.curve_bought_at_launch ?? {};
if (cc.yes && (cc.launching_wallets_hold_now ?? 0) > 0.5) flags.push("the launcher bought the whole curve as it launched and still holds it");
if (matches.n >= 20 && matches.peak_day1.dead / matches.n >= 0.9) flags.push(`${matches.peak_day1.dead} of ${matches.n} launches like it were dead by day one`);
const sellers = Object.values(classes).filter((c) => c === "supply_seller").length;
if (sellers) flags.push(`${sellers} of ${Object.keys(classes).length} buyers are supply sellers`);
return { flags, dev, bundle, similar_launches: matches, buyers: classes, base_rate: base.reached, median_peak: base.median_peak };
}
What comes back
| Field | What it says |
|---|---|
flags | Plain sentences for the things the check found: a dev with many launches and none graduated, a bundle over half the supply, a high insider share, a launcher that bought the whole curve as it launched and still holds it, launches like it that died, buyers who are supply sellers. An empty list means the check found none of these, not that the coin is safe. |
dev | The deployer's record over the whole history: launches, graduations, best_peak (USD), launches_last_day, the gap since its last launch. |
bundle | buyers_first_10s and the supply_share they took at creation. |
similar_launches | How launches with the same shape (dev record, bundle, insider share, curve progress at the same age) went in their first day: n, graduated_share, the peak multiple's percentiles and how many were dead. |
buyers | Each buyer wallet's class: winner, net_loser, bot, supply_seller, new (first seen on this coin), or none, each with why. |
base_rate, median_peak | Of every coin that first traded in the band yesterday, the share that reached 2x, 5x, 10x and 20x within three hours, and the median peak. |
Where it goes in the agent
Take new coins from GET /launches/since.json?t= (free): one call every 30 seconds returns every launch since the last poll, each with its deployer's launches, graduations and the gap since its last launch, so the agent can filter on the deployer without a call per coin. Do not call /deployer or /launch for every new launch: about 30 a minute would spend a free key's day in an hour. The check runs once per candidate, after that filter and before the buy, so the free allowance covers about ten candidates every five minutes, fewer if the agent sends 50 buyers to /wallets every time (a 50-wallet call counts as five). An agent that runs all day uses a free key: no daily cap. Past that, it pays per call.
The flags are reasons to skip, not a score. The one number worth sizing on is the base rate: a rule whose picks do not beat base_rate is picking no better than chance, and a replay of its picks will say so with fees and the dead coins counted.
When the free calls run out: paying per call
Past the day's free calls or wallet lookups, the same request answers 402 instead of 429: the x402 offer. The body's accepts[0] names the price in USDC (amount, in millionths: 10000 is $0.01), the network and the address to pay; its free_tier says what was used and when it resets. The agent pays the offer from its own Solana wallet, sends the same request again with the PAYMENT-SIGNATURE header, and gets the answer; no account, no card. In TypeScript the x402 client does the round trip:
// npm i @x402/core @x402/svm @solana/kit
import { createKeyPairSignerFromBytes } from "@solana/kit";
import { x402Client, x402HTTPClient } from "@x402/core/client";
import { decodePaymentRequiredHeader } from "@x402/core/http";
import { ExactSvmScheme } from "@x402/svm/exact/client";
import { readFileSync } from "node:fs";
const SOLANA = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
const signer = await createKeyPairSignerFromBytes(Uint8Array.from(JSON.parse(readFileSync(process.env.KEYPAIR!, "utf8"))));
const x402 = new x402Client();
x402.register(SOLANA, new ExactSvmScheme(signer));
x402.setSpendControls({ maxAmountPerPayment: "$0.01" }); // refuse any offer above a wallets call's price
const http = new x402HTTPClient(x402);
// the same call as the free one, without /free: free_tier in a 402's body says what ran out
const post = (headers = {}) => fetch("https://pumpdata.fun/wallets", {
method: "POST", headers: { "content-type": "application/json", ...headers }, body: JSON.stringify({ addresses, mint }) });
let res = await post();
if (res.status === 402) {
const offer = decodePaymentRequiredHeader(res.headers.get("payment-required")!);
res = await post(http.encodePaymentSignatureHeader(await http.createPaymentPayload(offer)));
}
const { wallets } = await res.json(); // the receipt is the PAYMENT-RESPONSE header
A copy-trading agent already holds a funded wallet, so this is the whole step. For a one-off list of thousands of wallets, the arithmetic is $0.01 per 50. For an agent that runs every day, a free key is simpler still: no daily cap and no payments. For the whole wallet table, bulk data is cheaper.
A prompt for agents
Give this to the agent, or put it in its system prompt, so the check runs before every buy and the answers are read for what they are.
Before any pump.fun buy, run the pre-buy check against pumpdata.fun (https://pumpdata.fun/llms.txt):
0. In one call: GET https://pumpdata.fun/check/{mint}.json gives the findings below as sentences, flags and rules_say
(skip, or no flags); the steps are what it is made of, for an agent that wants the raw records.
1. GET /free/launch/{mint}: the deployer's record (launches, graduations, best peak on record), the bundle in the
first 10 seconds, the insider share, whether the launcher bought the whole curve as it launched
(curve_bought_at_launch, with the share it still holds), and how launches that looked like this one went (matches).
2. POST /free/wallets with up to 50 buyer addresses and the mint: each wallet's class (winner, net_loser, bot, supply_seller,
new, none) and why, its SOL in and out over its whole history.
3. GET /free/baserate?band=<the market-cap band you buy in>&from=<yesterday 00:00Z>&to=<today 00:00Z>: how often
coins in that band reached 2x, 5x, 10x and 20x within three hours. That is the odds of a random pick; your
rule has to beat it.
Rules: treat the base rate as the prior, not a prediction. Never call a coin safe; the check finds what the chain
shows, not what will happen. A dev with many launches and no graduation, a bundle over half the supply, or buyers
who are supply sellers are reasons to skip, not to size down. Free: 30 calls every five minutes and 300 a day, and 2,000 wallet
lookups a day; a free API key (x-api-key) has no daily cap. Past those, the
same call answers 402 with the price: pay it over x402 ($0.005 a lookup, $0.01 for 50 wallets, USDC on Solana) and
send the request again.
Do not call pumpdata.fun for the feed of new coins; take that from pump.fun's own stream and use these calls to
decide.
Questions
Does pumpdata.fun give a feed of new pump.fun coins?
Yes, since Oct 27, 2026: GET https://pumpdata.fun/launches/since.json?t=<unix seconds> lists every launch after a moment in the last 24 hours, the newest within the minute, each with its deployer's record before it (launches, graduations, the gap since its last launch) and the first-10-second bundle once the hourly fill has read it. Poll it every 30 seconds with t = next_since; it is free and one call covers every launch since the last poll. For seconds instead of 30-second polls, pumpdata.fun's WebSocket stream (wss://pumpdata.fun/stream, https://pumpdata.fun/pump-fun-stream; 7-day free trial on a key) sends every create, trade, completion and migration about 1.5 seconds after its block, with each new coin's deployer record a few seconds later.
How many free calls does a trading agent get?
30 calls every five minutes and 300 a day per IP under /free/, with no key and no signup, and 2,000 wallet lookups a day (a /wallets call counts one per ten addresses). A free API key (https://pumpdata.fun/keys?utm_source=guide, x-api-key) has no daily cap, which is the one for an agent that runs all day. Past those, the same call answers 402 with a price ($0.005 a lookup, $0.01 for up to 50 wallets), paid per call in USDC over x402 with no account; the 402's body says what was used and how to pay. A whole pre-buy check (the three calls) is $0.02 paid.
Which call says whether a coin is a rug?
None of them says rug or safe. GET /launch/{mint} shows what the chain shows: the deployer's launches and graduations, how much of the supply the first buyers took, the insider share, and how launches with the same shape went in their first day. The agent decides; the page never calls a coin safe.
What does the base rate add?
The odds a random pick in the agent's market-cap band had of doubling, 5x-ing, 10x-ing or 20x-ing within three hours, from every coin that first traded in that band on the day. A rule that cannot beat the base rate is choosing coins no better than chance; GET /baserate is how the agent knows.
Can an MCP agent run the check?
Yes. The MCP server at https://pumpdata.fun/mcp has the same calls as tools (launch_history, wallets, baserate and the rest) and uses /free/ by itself when a tool call carries no payment and no key.
No code: the same check as a Grok bot template, pasted once into Grok, ChatGPT or Claude. Every call with a real answer: the pump.fun API. The shapes, for a model: llms.txt and openapi.json. The MCP server: https://pumpdata.fun/mcp. The skill and a command-line tool for Claude Code, Cursor and OpenClaw (npx github:pumpdatafun/pumpdata-skills check <mint>): pumpdata-skills on GitHub.