DEV Community

CoolBB
CoolBB

Posted on

StonkFun Bonding Curve Math (LaunchLab, Not a Custom AMM)

StonkFun is a Solana launchpad that pairs a new mint with any quote the UI allows: SOL, tokenized stocks (SPYx, NVDAx), pre-IPO tokens, or other crypto. Since early September 2026 new launches do not open a one-sided CLMM first. They run on Raydium LaunchLab (LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj), then migrate_to_cpswap into a Raydium CPMM at the 0.25% fee tier.

The curve math is LaunchLab’s constant-product engine. StonkFun’s product surface is the quote asset and two platform configs.

What gets minted

  • Supply: 1,000,000,000 tokens, 6 decimals, Token-2022.
  • Sold on the curve: 793,100,000 (79.31%).
  • Held for the pool: 206,900,000.

Those 206.9M plus the raised quote seed the CPMM. That is why you can read progress from the base reserve alone:

progress% = 100 - ((baseReserve - 206_900_000) * 100 / 793_100_000)
Enter fullscreen mode Exit fullscreen mode

Do not hard-code “85 SOL” as the only finish line.

Graduation is a quote amount, not a ticker

total_quote_fund_raising is set at initialize_with_token_2022 from a fixed dollar target, converted into the chosen quote at launch time.

UI copy for SOL pairs: raise 85 SOL, then graduate. Same dollar size in another asset is a different number — roughly 0.112 WBTC or ~11.5 SPYx in published examples, and it moves with the quote’s price. Always read the launch args.

Configs:

Mode Platform config Extra
Standard 4E876qZTE9FJMrBzgVtBrSrzz2TLivB5Y5QXPjB4gZL7 no transfer tax
Reward 6BwHHDg3u1854jC8PDLXvR4spTcLNaoBxLJNGC4nTESt Token-2022 transfer fee 1% or 3%

Reward tax is on transfers, not a second AMM fee. It is a separate haircut after the curve.

Price = constant product in the quote

$$x \cdot y = k$$

x = quote reserve (SOL, SPYx, …). y = tokens still on the curve.

Curve fee is 1% of the quote leg (fee_rate = 10_000 / 1_000_000 on the platform config):

  • Buy: fee comes off quote before the product.
  • Sell: fee comes off quote after the product.

Raydium’s 0.25% (RAY buyback) is taken from that 1%, not stacked on top. Creator curve-fee rate on LaunchLab is 0 in the documented StonkFun configs; the site’s “~0.5% to creator, auto-forwarded” is the platform payout path after the split, including post-graduation pool fees — confirm live config per launch.

Net buy sketch:

netQuote   = quoteIn * (1 - 0.01)
tokensOut  = y * netQuote / (x + netQuote)
Enter fullscreen mode Exit fullscreen mode

A buy that would pass the reserved 206.9M is the graduation trade; after migrate_to_cpswap the curve stops.

What bots get wrong

  • Treating every pair as SOL. You pay in the quote mint.
  • Using 85 SOL on a SPYx curve.
  • Ignoring Token-2022 transfer fee on reward mints when simulating a sell.
  • Routing to CPMM while the pool account is still the LaunchLab curve.
  • Assuming first-slot snipes work like the old one-sided CLMM path. The curve is the sniper tax.

Detect: initialize_with_token_2022 whose accounts include a StonkFun platform config. Sixth account = pool state, seventh = base mint, eighth = quote. Graduate: migrate_to_cpswap on the same program.

Same (k) as every other LaunchLab pad. The StonkFun-specific math is which reserve is (x), and that 793.1 / 206.9 split.


Telegram: https://t.me/C00LBB

Site: https://coolbb.site


Enter fullscreen mode Exit fullscreen mode

Top comments (0)