TradingCalc
FROM THE BLOG · ON-CHAIN · SOLANA

How pump.fun's bonding curve prices a buy

When a token launches on pump.fun, there is no pool of money behind it and nobody quoting a price. There is just a formula. Once you see how it works, you can tell what a buy will cost before you press the button, and roughly how much your own order will move the price. Here is the whole thing with real numbers, plus a few lines of code so you can check them yourself.

01THE RULE

It is the Uniswap formula with a head start

Pump.fun uses the same x × y = k rule as Uniswap V2. The twist is that the two numbers it works with are partly invented. The “virtual” reserves start at 30 SOL and 1,073,000,000 tokens, but nobody actually put 30 SOL in. That starting amount just decides what the very first token costs. And the virtual token count is bigger than what is really for sale.

the whole model
k = virtualSol x virtualTokens
netSolIn = solSpent x (1 - 0.0125)
tokensOut = k / virtualSol - k / (virtualSol + netSolIn)
spot price = virtualSol / virtualTokens (SOL per token)
 
start: virtualSol = 30, virtualTokens = 1,073,000,000
k = 32,190,000,000
sold on the curve: 793,100,000 of 1,000,000,000 tokens

Two small details do most of the work. The 1.25% fee is taken from the SOL you send, so only 98.75% of it actually moves the curve. And only 793,100,000 of the 1,000,000,000 tokens are sold along the way, which is why the curve can only ever take in a limited amount of SOL. The constants come from pump.fun's public program docs and fee schedule. They belong to pump.fun and could change, so the calculator works out the graduation point from them instead of storing it as a fixed number.

02A WORKED BUY

Start with one SOL on a brand new curve

Say you put in 1 SOL right at the start. The fee comes off first. What is left goes onto the virtual SOL side, and k tells you how many virtual tokens must remain. The tokens that disappear from that side are the ones you get.

step by step
buy 1 SOL on a fresh curve (nothing raised yet)
 
netSolIn = 1 x 0.9875 = 0.9875 SOL (fee 0.0125 SOL)
virtualSol = 30 + 0.9875 = 30.9875
virtualTokens = 32,190,000,000 / 30.9875 = 1,038,805,970
tokensOut = 1,073,000,000 - 1,038,805,970
= 34,194,030 tokens
average price = 1 / 34,194,030 = 2.92e-8 SOL per token
spot before = 30 / 1,073,000,000 = 2.80e-8 SOL per token
spot after = 30.9875 / 1,038,805,970 = 2.98e-8 SOL per token (+6.69%)

On average you paid 2.92e-8 SOL per token, a bit more than the 2.80e-8 quoted before your order. Part of that gap is the fee. The rest is your own buy pushing the price up as it fills, which is what people mean by price impact. The fee stays the same percentage, but the price impact gets bigger the more you buy.

03HOW THE PRICE MOVES

Why the last token costs 14.7 times the first

The price at any moment is virtual SOL divided by virtual tokens. Every buy makes the top of that fraction bigger and the bottom smaller, so on the way up the price can only rise. Over the whole curve it goes from 2.80e-8 to 4.11e-7 SOL per token, which is 14.7 times higher. The table below shows six points along the way, and what 1 SOL gets you at each of them.

SOL RAISEDPROGRESSSPOT (SOL/TOKEN)MARKET CAP (SOL)TOKENS FOR 1 SOLIMPACT OF 1 SOL
00%2.80e-827.9634,194,0306.69%
2023.5%7.77e-877.6612,468,7913.99%
42.550%1.63e-7163.295,966,3212.74%
6070.6%2.52e-7251.633,881,8062.21%
8094.1%3.76e-7375.892,603,7021.80%
85.01100%4.11e-7410.88graduatesn/a

Two things are worth noticing. The first is that 1 SOL buys 13 times fewer tokens at 80 SOL raised than at the start, even though its percentage impact drops from 6.7% to 1.8%. A deeper curve is harder to move, but each token on it also costs far more. The second is that the first half of the SOL (42.5 of 85.01) pays for about 79% of the 793.1 million curve tokens. The second half pays for the remaining 21%.

Market cap in the table is just the spot price times the 1,000,000,000 total supply, counted in SOL. It climbs from 27.96 SOL at the start to 410.88 SOL at graduation, the same 14.7 times. Turning that into dollars needs a live SOL price, so the table stays in SOL.

04SIZE AND GRADUATION

What happens at the end, and what a big order does

The curve stops selling once its 793,100,000 tokens are gone. At that moment 279,900,000 virtual tokens are left, and the same formula tells you how much SOL has come in: 32,190,000,000 / 279,900,000 − 30 = 85.005 SOL. With the fee on top, buying the entire curve in a single order would cost 86.08 SOL, and 1.076 SOL of that is fee. The other 206,900,000 tokens of the supply are never sold on the curve.

Big orders make the shape easy to see. Put 10 SOL into a fresh curve and you get 265,727,273 tokens, which is 26.6% of the entire supply, at an average of 3.76e-8 SOL per token. By the time the order is done, the price is 76.7% higher than when you started. Splitting it into ten 1 SOL buys would not change that, because the fee is a flat percentage and the curve only cares about the total SOL that went in.

If your order is larger than what the curve has room for, you do not get extra. It fills up to graduation and the rest of your SOL is simply not spent.

05LIMITS OF THIS MODEL

What this does not tell you

06CHECK IT YOURSELF

Check it yourself in a few lines

Every figure in this guide came from the same function the calculator and the MCP tool use, and each one was then reproduced with the snippet below, which needs nothing installed beyond Node. If your numbers come out different, look at the constants first.

node · independent check
const K = 30 * 1_073_000_000;
 
// tokens received for `sol` SOL, when `raised` SOL (net of fees) is already on the curve
const buy = (raised, sol) => {
const v = 30 + raised;
return K / v - K / (v + sol * 0.9875);
};
 
console.log(buy(0, 1)); // 34194029.85
console.log(buy(80, 1)); // 2603702.30
console.log(buy(0, 10)); // 265727272.73

If you work with an agent, the same calculation is a single call to workflow.run_bonding_curve on the MCP server, with solRaisedSoFar and solToSpend as inputs. The response is signed, and the daily public record shows how the engine's own tests did that day.