Where a coin's fees go
and why they stay.
This is the reference for what happens to a coin launched on maltfund: how it is created on Raydium LaunchLab in the shape StonkFun adopts, how the creator share of its trading fees is turned into equal parts coin and pair token, and how both are added to the coin's Raydium pool with the LP burned.
Overview#
A maltfund coin is an ordinary Raydium LaunchLab launch. The mint is Token-2022, created by initialize_with_token2022 with a supply of one billion and six decimals, sold along a constant-product curve that migrates into a Raydium CPMM pool once it fills. It is attributed to StonkFun's platform config and carries StonkFun's allow-config and curve-rule accounts, so StonkFun lists it like one of its own: token page, chart, and fee forwarding.
One field is different. The pool's creator — the address StonkFun pays the creator share to — is not the person who launched it. It is an engine wallet that exists for that coin only. A keeper turns everything that wallet receives into liquidity: half becomes the coin, half stays in the pair token, and both go into the coin's pool. The LP tokens are burned in the same transaction.
The upshot: volume is the only input. It doesn't matter which front end a trade comes through — StonkFun, Raydium, Jupiter, a bot — its fee ends up as pool depth, and depth added this way has no owner who could take it back out.
Any pair#
The pair is whatever StonkFun lists as launchable at the time: SOL, stablecoins, xStocks, PreStocks, Backpack and Tessera assets, community coins. The pair is what the curve raises and the other side of the pool after graduation — a coin paired with NVDAX is priced in NVDAX, and its liquidity is NVDAX.
The raise is read from StonkFun's /launchlab/pricing for that pair at launch time. Its totalFundRaisingB is a raw amount in the pair's own decimals, sized so every pair starts and graduates at the same dollar market cap. Fees, inventory and deposits are all held in the pair token; the engine's thresholds are in dollars so they mean the same thing on every pair. A dev buy is paid in the pair token too.
Lifecycle of a coin#
| Phase | Fees | Engine |
|---|---|---|
| Launch | — | Mint created with its engine wallet as LaunchLab creator. The launcher pays, signs, and may add a dev buy in the same transaction. |
| On the curve | StonkFun forwards the creator share to the engine wallet | Buys the coin on the curve until half the inventory's value is coin; the rest waits in the pair token. |
| Graduation | — | LaunchLab migrates the curve into a Raydium CPMM pool. The engine finds it from the platform's cp config and starts depositing. |
| In the pool | Forwarding continues | Rebalances at the pool's price, deposits both sides, burns the LP. Every cycle. |
The engine#
Each keeper pass runs four steps for every live coin. Every on-chain step is its own transaction and is simulated before it is sent.
1 · Collect#
StonkFun keeps the 1% platform fee and forwards the creator's share to the pool creator — the engine wallet — in the pair token. Nothing needs signing: the engine compares the wallet's spendable balance with its snapshot from the previous pass and books the difference as fees. If anything has collected in the LaunchLab creator vault instead, it is claimed with claim_creator_fee once it is worth $1.
2 · Split#
The target is an inventory worth 50% coin and 50% pair. On the curve the engine buys with buy_exact_in; after graduation it buys in the pool with swap_base_input. Buy sizes come from the split math, so coin left over from earlier passes is counted before anything new is bought.
3 · Deposit#
Deposits start after graduation, whenever the pair side of the inventory is worth $2 or more. The engine sizes the LP from whichever side is scarcer, trims it by 2%, and passes its full balances as the per-side maximums, so the pool never asks for more than the wallet has. Whatever is left over rolls into the next pass.
4 · Burn#
The LP minted by the deposit is destroyed with an SPL Burn in the same transaction. The reserves stay in the pool and nobody holds a claim on them. Each coin page shows how much LP the engine has burned against the pool's LP supply.
Split math#
Q is spendable pair token (on SOL pairs: lamports above the 0.01 SOL reserve plus wrapped SOL), T is the engine's coin balance, and p is the price in pair token per coin.
curve p = (virtualB + realB) / (virtualA − realA)
buy = min(Q, (Q + T·p) · 0.5 − T·p) // bring coin to half the value
if usd(buy) ≥ $0.25: buy_exact_in(buy)
pool p = quoteReserve / coinReserve
buy = (Q − T·p) / 2 // equal value at the pool's price
if usd(buy) ≥ $0.25: swap_base_input(buy)
deposit lp = min(T · lpSupply / coinReserve,
Q · lpSupply / quoteReserve) · (1 − 0.02)
deposit(lp, maxCoin = T, maxQuote = Q) ; burn(lp)Because the engine's own swap moves the pool a little before it deposits, the ratio it deposits at is slightly off p. That is what the headroom is for; the mismatch it leaves behind is tiny and gets used up later.
Engine wallets#
Each coin's engine wallet is derived from a server-side master seed and the coin's mint (HMAC-SHA256(seed, mint) as the ed25519 seed). It is fixed as the pool creator at launch, so one coin's fees, inventory and deposits never mix with another's. No private key is stored anywhere; the keeper re-derives it each pass. The wallet keeps a 0.01 SOL reserve that is never deployed, and a separate keeper wallet pays every network fee and every token account rent.
Transactions#
| Step | Instructions | Signers |
|---|---|---|
| Launch | ComputeBudget · initialize_with_token2022 (+ allow-config, curve-rule) · optional wrap · buy_exact_in · unwrap | launcher, mint |
| Claim (only if the vault holds fees) | ComputeBudget · create ATAs · claim_creator_fee | keeper, engine |
| Curve buy | ComputeBudget · create ATAs · wrap · buy_exact_in | keeper, engine |
| Pool buy | ComputeBudget · create ATAs · wrap · swap_base_input | keeper, engine |
| Deposit + burn | ComputeBudget · create ATAs + LP ATA · wrap · deposit · Burn(LP) | keeper, engine |
Wrapping only happens on SOL pairs, and the engine keeps its wrapped-SOL account open between passes. Engine transactions are v0 with a 600k compute limit.
Why the graduated pool#
After migration, routers send a coin's flow to the CPMM pool LaunchLab created for it — it is the coin's market. A second pool somewhere else would compete with it for depth and leave a price gap for arbitrage to collect. Putting everything into the one pool people already trade against means every buyer and seller gets the lower slippage, and the fees they pay come straight back to the engine for the next deposit.
The keeper#
An off-chain keeper runs the engine around the clock. Every 15 seconds it:
- reads each live coin's LaunchLab state, which decides whether it trades on the curve or in its pool;
- runs collect → split → deposit → burn for each coin, a few coins at a time;
- indexes new trades and refreshes holder lists for the site.
Trade indexing#
Trades are read from chain, so trades placed through StonkFun, Raydium or any aggregator appear too. The keeper pages getSignaturesForAddress on the LaunchLab pool and, after graduation, on the CPMM pool, then reads each transaction as jsonParsed. The venue's coin vault gives the side and size, its pair vault gives the amount, and the trader is whoever's coin balance moved the most outside the venue. When both vaults move the same way it's a deposit or withdrawal, not a trade, and it is skipped.
When things fail#
| Failure | What happens |
|---|---|
| Simulation rejects a step | No transaction goes out. One log line per 10 minutes on the Engine page; the step reruns on the following pass. |
| A transaction doesn't confirm | The same signed bytes are re-broadcast until the blockhash dies. It's never re-signed, so it can't execute twice. Balances are re-read next pass. |
| Keeper is down | Fees pile up in the engine wallet untouched and get deployed in one go when it comes back. |
| Pair has no dollar price | That coin sits out until StonkFun prices the pair again, so the $ thresholds can't misfire. |
| Coin stays on the curve | Its coin and pair inventory stay in the engine wallet. The curve buys it made still count as buy pressure. |
Parameters#
| Key | Value | Note |
|---|---|---|
| fees.source | Forwarded creator share | StonkFun keeps the 1% pool fee and forwards the creator's cut to the engine wallet in the pair token. |
| claim.minUsd | $1 | Anything sitting in the LaunchLab creator vault is claimed above this. |
| split.coinShare | 50% | Share of inventory value held as the coin. |
| split.minUsd | $0.25 | Smaller buys wait for more fees. |
| swap.curve.slippage | 3% | buy_exact_in on the curve. |
| swap.pool.slippage | 3% | swap_base_input in the pool. |
| deposit.minUsd | $2 | Pair-side inventory below this keeps accumulating. |
| deposit.headroom | 2% | Gap between the LP asked for and the inventory backing it. |
| lp.mode | Burn | Burned inside the deposit transaction. |
| reserve.sol | 0.01 SOL | Never deployed. Topped up by the keeper. |
| keeper.cycle | 15 s | Refresh → collect, split, deposit, burn → index. |
| launch.creator | Engine wallet | Fixed at mint; StonkFun forwards to it. |
| launch.supply | 1,000,000,000 | Token-2022, 6 decimals, no transfer fee. |
Trust model#
- Trading, curve math, graduation and pool accounting are Raydium's LaunchLab and CPMM programs. maltfund only builds transactions.
- Fee forwarding is StonkFun's: it pays the creator share to each coin's engine wallet.
- Forwarded fees and inventory sit in that engine wallet until the keeper deploys them — that wallet is the one thing you trust maltfund with.
- Burned LP is out of everyone's reach, the operator included.
- Every engine action is a public transaction, linked from the Engine page.
- On launch the server only relays the exact transaction it prepared for that mint and launcher; a wallet that changes it is refused.
FAQ#
Do I get the creator fees?+
No — that's the point. What you get instead is a coin whose pool deepens as it trades. If you want a position, put a dev buy in the launch transaction.
Which pairs can I pick?+
The live StonkFun launch list, loaded when you open the form: SOL, USDC, xStocks such as NVDAX or SPYX, PreStocks, community coins and more.
Where do fees go while the coin is still on the curve?+
Into the engine wallet's inventory: about half becomes the coin through curve buys, the rest waits in the pair token for graduation day.
Could anyone remove the liquidity later?+
There is nothing to remove it with. The LP tokens are burned inside the deposit transaction itself.
Will StonkFun list my coin?+
It should: launches use StonkFun's platform config, pricing and required accounts, which is how StonkFun recognises launches built outside its own site.