PoffertSwapDocs
Open app

How it works

How the bonding curve works

The simple idea behind a token's price, the real numbers it starts with, and worked examples you can check yourself.

On this page

A bonding curve is a rule that turns "how much has been bought" into "what the next token costs". It replaces the usual order book. You do not need a seller to meet you, because the curve itself is always the other side of your trade.

The idea in plain words#

Picture a machine with two piles inside: a pile of tokens and a pile of SOL. The price of one token is simply the size of the SOL pile divided by the size of the token pile.

  • When you buy, you drop SOL into the SOL pile and take tokens out of the token pile. The SOL pile grows and the token pile shrinks, so the price goes up.
  • When you sell, you drop tokens back and take SOL out. The price goes down again.
  • The machine follows one fixed rule: the two piles multiplied together stay the same (apart from tiny rounding in the curve's favor). This is called a constant product, and it is the same idea that most swap pools use.

Because of that rule, the more of the token has been sold, the more each additional token costs. The first buyers get the lowest prices, and the price rises faster and faster as the token pile runs low.

The numbers every token starts with#

Every token launched on PoffertSwap starts from the same place:

Amount
Total supply 1,000,000,000 tokens
Tokens that can be bought on the curve 793,100,000 (79.31%)
Tokens kept back for the pool after graduation 206,900,000 (20.69%)
Starting SOL pile (virtual) 30 SOL
Starting token pile (virtual) 1,073,000,000 tokens
SOL actually paid in at the start 0
Note

Why "virtual"? Nobody pays 30 SOL when a token is launched. The 30 SOL and the 1.073 billion tokens are starting values built into the formula. They decide the first price and the shape of the curve. Only the SOL that buyers really pay in is real, and that is the SOL that later moves to the pool.

These values are stored in the platform's configuration and copied into each curve when the token is created, so a later change can never alter a token that is already trading.

What the price does#

Market cap along the bonding curve The market cap of a token rises slowly at first and then steeply as more of the curve is sold: about 28 SOL at launch, 70 SOL when half is sold and 411 SOL when the curve is full. 0100200300400 0%50%100% Launch: 28Half sold: 70Full: 411 Market cap in SOL Share of the curve that has been sold
The market cap of a token (its price times 1 billion tokens) along the bonding curve, drawn from the real formula. The more is sold, the faster it rises.

Here are the numbers behind the picture, computed with the program's own formula:

Moment Tokens sold SOL raised Price of 1 token Market cap
Launch 0.0M 0 SOL 0.00000002796 SOL 28.0 SOL
25% of the curve sold 198.3M 6.8 SOL 0.00000004207 SOL 42.1 SOL
50% of the curve sold 396.6M 17.58 SOL 0.00000007035 SOL 70.3 SOL
75% of the curve sold 594.8M 37.31 SOL 0.00000014078 SOL 140.8 SOL
Graduation (100% sold) 793.1M 85 SOL 0.00000041088 SOL 410.9 SOL

Two things to notice:

  • The market cap grows about fifteen times between launch and graduation (from roughly 28 SOL to roughly 411 SOL). The curve is steep, so the earliest buyers see the biggest swings.
  • The second half is far more expensive than the first. Buying the first half of the curve's tokens takes roughly 18 SOL in total. Buying the second half takes roughly 67 SOL.

A buy, step by step#

Say you are the very first buyer of a new token and you spend 1 SOL.

Step Amount
You send 1 SOL
Fee (1.25%) 0.012345 SOL
Goes into the curve 0.987654 SOL
You receive 34,199,203 tokens (34.2M)
Of the fee: creator / platform 0.002962 / 0.009382 SOL

How the program gets there:

  1. The 1.25% fee is taken first, so the curve only receives the rest.
  2. The rest is added to the SOL pile.
  3. The token pile shrinks by exactly as much as keeps "SOL pile × token pile" the same, and that is what you receive.

The same 1 SOL buys far fewer tokens later, when the pile is smaller. That is the curve at work.

A sell, in the other direction#

A sell reverses the steps. The program works out how much SOL the tokens you give back would release from the SOL pile, then takes the 1.25% fee from that SOL, and pays you the rest. Selling everything you just bought gets you back slightly less than you paid, because the fee applies in both directions. The Buy and sell page shows the real figures.

When the curve is almost sold out#

If your purchase would use up more tokens than are left, the program caps it at what is left. You are charged only for the tokens you actually receive, and the unused SOL is never taken from you. On screen this shows as a Refund line.

When the last token is gone, the curve is complete. See Graduation for what happens next.

Rounding always favors the curve#

Amounts on Solana are whole numbers, so every calculation has to round somewhere. The program always rounds in the curve's favor: you get your tokens or SOL rounded down, and what you pay is rounded up. The differences are fractions of a cent. The effect is that the curve can never be drained a little at a time by repeating tiny trades.

The formulas, for the curious#

These are the exact rules the program follows. All values are whole numbers in the smallest units (lamports for SOL, base units for tokens).

Buying with an exact amount of SOL

text
net      = floor( SOL_spent × 10,000 / (10,000 + fee_bps) )     fee_bps = 125
fee      = SOL_spent − net
tokens   = floor( token_pile × net / (sol_pile + net) )

Selling an exact number of tokens

text
gross    = floor( sol_pile × tokens / (token_pile + tokens) )
fee      = ceil( gross × fee_bps / 10,000 )
you get  = gross − fee

State after a buy (a sell mirrors it): sol_pile += net, token_pile −= tokens.

Price and progress

text
price    = sol_pile / token_pile            (SOL per token)
progress = 1 − tokens_left_on_curve / 793,100,000

Can I trust these numbers?#

Yes, and you can check them. The same formulas exist in two places: the on-chain program (written in Rust) and the app (written in TypeScript). They are tested against more than 500 shared test cases, including extreme values, and the numbers on this page are produced by a copy of the same formulas that this site's own tests check against those test cases.