How to get a pump.fun token's market cap and bonding curve progress without an API

pump.fun has no public price API, and you do not need one. Every coin's price lives in one small account on Solana. This guide shows where it is, how to decode it, and how to turn it into a market cap, a progress percentage and a migration signal.

Where the price lives

While a pump.fun coin is new it trades against a bonding curve: an account owned by the pump.fun program (6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P) that holds the coin's reserves. Its address is a program-derived address made from the text bonding-curve and the mint, so you can work it out offline from the mint alone.

What is in the account

BytesFieldUnit
8–15virtual token reservestokens × 106
16–23virtual SOL reserveslamports
24–31real token reservestokens × 106
32–39real SOL reserveslamports
40–47token total supplytokens × 106
48complete1 once the curve has finished
49–80creator (newer accounts)address

The maths

A fresh curve has 30 virtual SOL and 1,073,000,000 virtual tokens, which is a market cap of about 28 SOL before anyone has bought.

Doing it by hand

const res = await fetch("https://api.mainnet-beta.solana.com", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "getAccountInfo",
    params: [curveAddress, { encoding: "base64" }] }),
});
const data = Buffer.from((await res.json()).result.value.data[0], "base64");
const virtualTokens = Number(data.readBigUInt64LE(8)) / 1e6;
const virtualSol = Number(data.readBigUInt64LE(16)) / 1e9;
const complete = data[48] !== 0;
const marketCapSol = (virtualSol / virtualTokens) * 1e9;

The fiddly part is curveAddress: deriving a program-derived address needs a SHA-256 and an ed25519 on-curve check.

Doing it in one line

pump-curve does the derivation, the decoding and the maths, with no dependencies:

npx github:blixvip/pump-curve <mint>
import { readCurve, readCurves, watchCurve } from "pump-curve";

const coin = await readCurve("<mint>");
// { status: "curve", marketCapSol: 285.36, progressPct: 92.94, migrationMarketCapSol: 410.88, creator, ... }

const many = await readCurves([mintA, mintB, mintC]);   // up to 100 coins in one RPC call

watchCurve("<mint>", (now) => {
  if (now.status === "migrated") console.log("migrated");
});

Things that will trip you up

Want it done for you?

This is the small, open version. Blix is the AI-powered Solana memecoin terminal it comes from: every pump.fun launch live, AI coin ratings, narratives, wallet and X tracking, and one-click trading with 0% fees. There is a public API and an MCP server too.

Start trading on BlixJoin the Discord

Help build it

pump-curve is open source and takes pull requests. There are good first issues with step-by-step instructions, and setup is git clone and npm test.

More guides

How to detect new pump.fun tokens in real time (and stream every trade)pump-streamHow to calculate a Solana token's top 10 holders percentage (and why explorers overstate it)sol-holdersHow to parse a Solana swap transaction for any DEXsolana-swap-parserHow to stop Solana RPC 429 errors (Too Many Requests)solana-rpc-poolWhy your Solana WebSocket stops receiving messages, and how to keep it alivesolana-ws-keepalive