---
id: BI0135
title: "Bonding curve progress meter"
url: https://carbium.sh/library/blockchainideas/bonding-curve-progress-meter
collection: Blockchain ideas
category: Token tools
revision: 1
updated: 2026-11-23
author: Carbium
code: MIT (LICENSE in the zip); text: all rights reserved, Carbium Corporation
---

# Bonding curve progress meter

A progress meter for Pump.fun launches. It derives a token's bonding curve account, reads the reserves with one getAccountInfo call, and prints percent complete, SOL raised and the completed flag. With no argument it finds live curves itself.

## Who uses it

A token launched on Pump.fun trades against a bonding curve until enough of its supply has been bought. At that point the curve closes and the liquidity moves to a DEX pool. Anyone watching a launch asks the same question: how close is it to that line?

A community team wants a bar on the token page that fills as buyers arrive. A dashboard author wants a column of percent-complete figures for the newest tokens. A hackathon team wants a small, read-only starting point that shows how a program's own account layout turns into a number on screen. All three need the same thing, which is one account read and a little arithmetic.

## How the curve reads

Every Pump.fun token has one bonding curve account owned by the Pump program, `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`. Its address is a program derived address from two seeds: the text `bonding-curve` and the token's mint. So the mint is the only input, and no search is needed to find the account.

The account data starts with an 8 byte discriminator, followed by five little-endian u64 values and one flag byte. The meter needs three of them.

| Offset | Field | Use in the meter |
|---|---|---|
| 24 | real token reserves | tokens still held by the curve for sale |
| 32 | real SOL reserves | lamports paid into the curve so far |
| 48 | complete flag | 1 once the curve has closed |

A new curve holds 793,100,000,000,000 base units of real token reserves, which is 793.1 million tokens at 6 decimals. Each buy takes tokens out of that pool, so progress is the share already sold: `(793.1M - real reserves) / 793.1M`. When the pool is empty the flag turns to 1 and the number is 100%. The code treats a set flag as 100% whatever the reserves say, and a curve still holding its full starting reserve as 0%.

The same arithmetic works on the program's virtual reserves, but those carry the constant-product curve's starting offset and do not run from 0 to 100. The real reserves are the ones that count down to the migration.

## The build

The meter is one file on Node 24 and @solana/kit. It is read-only: no private key, nothing sent.

1. With a mint as the first argument, derive its curve address and read it.
2. With no argument, list the newest signatures that mention the Pump program, fetch each with getTransaction, and collect the token mints in their post-transaction token balances.
3. Read each curve with `getAccountInfo` in base64, check that the owner is the Pump program and that the data holds at least 49 bytes, then decode the three fields.
4. Print one line per token with percent complete, SOL raised and the flag. A call that fails prints its reason and the others still print.

`main.ts` (run: `CARBIUM_KEY=<YOUR_KEY> node main.ts [mint]`)

```ts
// BI0135 · Bonding curve progress meter
// https://carbium.sh/library/blockchainideas/bonding-curve-progress-meter
// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.
// SPDX-License-Identifier: MIT

import { address, createDefaultRpcTransport, createSolanaRpcFromTransport, getAddressEncoder, getProgramDerivedAddress, type Address } from "@solana/kit";

const key = process.env.CARBIUM_KEY;
if (!key) {
  console.error("Set CARBIUM_KEY to your Carbium API key.");
  process.exit(1);
}
const rpc = createSolanaRpcFromTransport(createDefaultRpcTransport({
  url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",
  headers: { "x-api-key": key },
}));

const PUMP = address("6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P");
const START_REAL = 793_100_000_000_000n; // real token reserves of a new curve, 6 decimals

// Layout: 8 byte discriminator, then u64 LE virtualToken, virtualSol, realToken, realSol, supply, then the complete flag.
async function meter(mint: Address): Promise<string> {
  const [curve] = await getProgramDerivedAddress({
    programAddress: PUMP,
    seeds: ["bonding-curve", getAddressEncoder().encode(mint)],
  });
  const { value } = await rpc.getAccountInfo(curve, { encoding: "base64" }).send(); // confirmed by default in kit
  if (!value || value.owner !== PUMP) return `${mint} not a Pump.fun curve`;
  const buf = Buffer.from(value.data[0], "base64");
  if (buf.length < 49) return `${mint} curve account too short (${buf.length} bytes)`;
  const real = buf.readBigUInt64LE(24);
  const lamports = buf.readBigUInt64LE(32);
  const complete = buf[48] === 1;
  const sold = complete ? START_REAL : real >= START_REAL ? 0n : START_REAL - real;
  const pct = Number((sold * 10_000n) / START_REAL) / 100;
  return `${mint} ${pct.toFixed(2)}% sold, ${(Number(lamports) / 1e9).toFixed(3)} SOL raised, complete ${complete}`;
}

async function findMints(): Promise<Address[]> {
  const sigs = await rpc.getSignaturesForAddress(PUMP, { limit: 12 }).send();
  const txs = await Promise.allSettled(sigs.filter((s) => s.err === null).map((s) =>
    rpc.getTransaction(s.signature, { encoding: "jsonParsed", maxSupportedTransactionVersion: 1 }).send()));
  const mints = new Set<Address>();
  for (const t of txs) {
    if (t.status === "rejected") console.log(`getTransaction failed: ${String(t.reason)}`);
    else for (const b of t.value?.meta?.postTokenBalances ?? []) mints.add(b.mint);
  }
  return [...mints].slice(0, 8);
}

const arg = process.argv[2];
const mints = arg ? [address(arg)] : await findMints();
if (mints.length === 0) console.log("no token mints found in the newest Pump transactions");
for (const r of await Promise.allSettled(mints.map(meter))) {
  console.log(r.status === "fulfilled" ? r.value : `read failed: ${String(r.reason)}`);
}
```

A call that leaves commitment out runs at confirmed under @solana/kit 8.6.0, so the figure is a confirmed read. getTransaction takes `maxSupportedTransactionVersion: 1` with the encoding, because mainnet carries v1 transactions and a lower value answers -32015 for one of them. A getTransaction that answers null, for an old signature the index still lists, is skipped.

## What it costs

The curve read is a getAccountInfo, an account read at 10 cells. With a mint given, the whole run is that one call, so a page that polls a single token every few seconds fits every plan's account-read rate, Free included at one read every two seconds. Account reads run at 0.5 req/s on Free, 15 on Dev, 50 on Business and 400 on Pro.

The discovery path is heavier. One getSignaturesForAddress call costs 50 cells and so does each getTransaction. The code asks for 12 signatures, so a default run is 50 cells of signatures, up to 600 cells of transactions and up to 80 cells of curve reads, 730 in all. Each method class absorbs its own burst of up to 1,024 cells, and the largest share, 600 cells of getTransaction, fits inside it, so a first run goes through at once. Run discovery in a loop and the 50-cell calls set the pace: getTransaction and getSignaturesForAddress each run at 0.24 req/s on Free and 1.2 on Dev.

| Call | Cells | Calls in the default run |
|---|---|---|
| getSignaturesForAddress | 50 | 1 |
| getTransaction | 50 | up to 12 |
| getAccountInfo | 10 | up to 8 |

Limits count per account, so a second tool on another key of the same account draws on the same budget.

## What to add next

- A watch list: keep the mints you care about in a file and read their curves in one getMultipleAccounts call. It costs 10 cells per pubkey, so 100 pubkeys cost 1000 cells, and 100 is the most a call should carry below Pro.
- A bar for a page: serve the percent from a small HTTP route and fill a progress element from it.
- A change threshold: remember the last percent per mint and print a line when a token crosses 50, 75 or 90.
- A migration line: when the flag turns to 1, call getSignaturesForAddress on the curve account and read the newest transaction to see the pool that took the liquidity.
- A live feed: subscribe to the curve account on the WebSocket and recompute on each notification. accountSubscribe sends account state on change for streamed accounts, so confirm the curve account notifies before you rely on it.

The [Token account layout decoder](https://carbium.sh/library/howsolana/token-account-layout-decoder) shows the same offset-based reading for the SPL token account, and the [Live mint progress counter](https://carbium.sh/library/blockchainideas/live-mint-progress-counter) is the counting version of this idea for NFT drops.

## Where it ends

- The layout is the Pump program's own. If the program changes its account, the offsets shift and the code reads wrong numbers. The length check catches a shorter account, and a changed one needs a new decode.
- The starting reserve of 793.1 million tokens is the value for curves created with the current parameters. A token launched under older parameters gives a percent that is off by the difference.
- The meter reads the curve. It does not follow the liquidity afterwards: the pool a completed curve migrates to, whether Raydium for older launches or another venue, comes from the migration transaction.
- Discovery is a sample. It reads the newest 12 signatures and keeps the first eight mints they name, so a busy minute shows a few tokens out of many. Other mints in those transactions, such as wrapped SOL and USDC, print as not a Pump.fun curve.
- A curve account that never existed, or a mint from another launchpad, answers null and prints as not a Pump.fun curve.
- The figure is as fresh as one confirmed read. Between two reads a burst of buys can move the curve several percent.

## When it goes wrong

| What goes wrong | What to do |
|---|---|
| Every line prints as not a Pump.fun curve. | The mint is from another launchpad, or it is mistyped. Check the address on an explorer and pass the token mint, not the curve address. |
| Discovery prints no tokens, only failed reads. | The newest signatures in the window were failed or empty, or getTransaction answered null for them. Run again, or pass a mint from a token page. |
| getTransaction fails with -32015. | A v1 transaction needs maxSupportedTransactionVersion set to 1 on the call. The code sets it, so check that a copy of it still carries the option. |
| Calls come back limited on a Free key. | Each discovery run sends up to 13 calls at 50 cells, and the Free rate for them refills slowly once the first burst is spent. Lower the signature limit, or give a mint and skip discovery. |
| The percent looks wrong for an older token. | It launched under older curve parameters with a different starting reserve. The meter assumes 793.1 million tokens, so set START_REAL to that token's starting real reserves. |
| The script exits asking for a key. | Export CARBIUM_KEY with the whole key before running it. |

## Questions

### Why use real reserves and not virtual reserves?

Virtual reserves include an offset that sets the curve's starting price, so they never fall to 0. Real reserves start at 793.1 million tokens and reach 0 when the curve is full.

### Does the meter work for a token that already moved to a DEX?

Yes, it reads the old curve account, which stays on chain with its flag set and its reserves at 0, so it reports 100%. It says nothing about the new pool.

### Can a page follow one token live?

Yes. Read the curve every few seconds with getAccountInfo, or subscribe to the account on the WebSocket and recompute on each message. accountSubscribe sends account state on change for streamed accounts, so confirm the curve account notifies first.

### Where does the SOL figure come from?

It is the real SOL reserves field in lamports, divided by a billion. It is the amount paid into the curve so far, and it ignores the fee the program takes.

## Related

- [Token account layout decoder](https://carbium.sh/library/howsolana/token-account-layout-decoder) (How to use Solana, HS0021)
- [Live mint progress counter](https://carbium.sh/library/blockchainideas/live-mint-progress-counter) (Blockchain ideas, BI0022)
- [carbium.sh/docs/rpc](https://carbium.sh/docs/rpc)
- [carbium.sh/docs/limits](https://carbium.sh/docs/limits)
- [carbium.sh/docs/migrate](https://carbium.sh/docs/migrate)
- [carbium.sh/docs/endpoints](https://carbium.sh/docs/endpoints)
- [carbium.sh/docs/auth](https://carbium.sh/docs/auth)
