LabKit
LabKit is a launchpad on Raydium LaunchLab. Tokens trade on a LaunchLab bonding curve and move to a Raydium pool when it fills. Every launch picks a kit, which spends part of the trading fees on the token itself, and its creator fees are held by an on-chain program and paid out automatically.
The program never holds a private key and has no withdraw function. Every lamport it touches sits in a program-derived account (PDA), and the only instructions that move funds out of one send them to a destination fixed by the launch: the recipient, the kit, LabKit's treasury, the keeper's share, or a staker's claim. All amounts are kept in wrapped SOL (WSOL) token accounts.
Launching
Pick a name, ticker and image, who receives creator fees, and a kit. Vesting, links and a dev buy are optional. Launching takes two transactions, signed together: the first registers the launch with LabKit and gives it its own LaunchLab platform, the second opens the pool and makes the dev buy. If the second one fails, pressing Launch again finishes it.
The curve sells 79.3% of the 1B supply and fills at 85 SOL. The rest seeds the Raydium pool.
On chain
The first transaction is create_launch, signed by the new mint's keypair. It fixes the kit, Floor's drawdown and the fee splits, and creates a LaunchLab platform for this launch alone from LabKit's template. The platform's fee wallet is the launch's kit PDA and its admin is the launch's platform admin PDA. That admin signs once, here, and LabKit has no instruction that signs for it again, so nobody can change the platform's fees or wallets later.
The second transaction is LaunchLab initialize_v2 on that platform, with the launch's creator PDA as the pool's creator, followed by register_launch. Anyone can send register_launch: it records the pool only if it is for the launch's mint, quoted in SOL, on the launch's platform and created by its creator PDA. The mint must be a plain SPL Token mint, because a Token-2022 transfer fee would leave staked tokens short, and the pool must take its Raydium creator fee in SOL only, because only SOL ever leaves the creator PDA. Kit buys, creator payouts and staking only run on registered launches.
When the curve fills, LaunchLab moves the liquidity to a Raydium CPMM pool on the AMM config the template names. The program recognises the launch's Raydium pool later by two things: its creator is the launch's creator PDA, which only LaunchLab migration or a pool Raydium permits can set, and it uses the AMM config the launch's platform names. The template's lp_lock_scale sets how much of the new pool's LP is locked with Raydium's LP lock; the rest is burned.
Fees
Every buy and sell on the curve pays:
- Raydium protocol
- 0.25%
- Kit
- 0.7%
- LabKit
- 0.3%
- Creator
- 0.5%
The 1% platform fee is split 70% to the launch's kit and 30% to LabKit. The creator fee goes 95% to the recipient and 5% to the keeper that pays it out.
Once the token moves to Raydium, every trade in its pool pays:
- Raydium pool
- 0.25%
- Creator fee
- 1%
The pool keeps 5% of that creator fee. LabKit splits the rest in half: one half like a creator fee, the other like the platform fee. That comes to 47.5% for the recipient, 35% for the kit, 15% for LabKit and 2.5% for the keeper.
Trades made on this site also pay LabKit a 0.25% referral fee, on the curve and on Raydium. All of it goes to LabKit.
How a payout is split
LaunchLab's fee rates are parts per million: the platform fee is 10,000 and the creator fee 5,000. LabKit's own splits are in basis points and copied into the launch when it is created, so a later config change never reprices an existing launch. Each payout splits the amount it just claimed:
creator_side = on Raydium ? amount × amm_creator_bps / 10,000 : amount platform_side = amount − creator_side keeper = creator_side × crank_bps / 10,000 recipient = creator_side − keeper kit = platform_side × kit_bps / 10,000 labkit = platform_side − kit
Here crank_bps is 500, kit_bps 7,000 and amm_creator_bps 5,000. Shares round down and the remainder goes to the recipient or LabKit, so a payout leaves nothing behind. The keeper share can never be set above 5%.
The platform fee builds up in LaunchLab's fee vault for the launch's platform. claim_kit_fees claims it into the kit's WSOL account and sends LabKit's share to the treasury in the same instruction. Referral fees land in the fee wallet PDA, and split_fees sends them to the treasury.
Kits
A kit is a wallet owned by the program that collects the kit's share of fees and spends it by the launch's rule. The kit is chosen at launch and can't change. The keeper runs the kits that buy: each buy spends at least 0.01 SOL and at most 1% of the pool's SOL, and every token a kit buys is burned.
How a kit buys
Burn, Floor and Graduate buy with execute_curve on the curve and execute_swap on Raydium. Each instruction reads the pool's reserves and sizes the buy from them, so the caller can't choose the amount:
spend = min(kit balance, 1% of the pool's SOL, SOL left to fill the curve) net = spend − pool fees min_out = base × net / (quote + net) × 99%
The 1% slippage only absorbs rounding, because the expected output comes from the same reserves the swap uses. A buy under 0.01 SOL is refused, except the one that fills the curve. A kit buys at most once per slot, so a transaction or bundle can't stack several buys. Keeping that one buy to 1% of the pool's SOL moves the price by about 2%, less than a sandwich pays in fees buying in front of it and selling after, so front-running a kit loses money. After the swap, the kit burns every token in its token account and adds to the launch's spent, burned and executions counters.
On Raydium, the reserves are the pool's vault balances less the fees it has booked but not paid out, and execute_swap only accepts a CPMM pool whose creator is the launch's creator PDA and whose AMM config is the one the launch's platform graduates into.
Burn
Buys the token and burns it, on the curve and then on Raydium.
Floor
Tracks the token's highest price and draws a line under it, at the drawdown chosen at launch: with 20%, the line sits at 80% of the high. When the price falls under the line, it buys and burns until the price is back at the line, and holds its SOL otherwise.
Prices are lamports per raw token as Q64.64 fixed point. The high starts at the curve's opening price when the launch registers, and only goes up: every Floor buy and every checkpoint raises high_q64 toward the current price, by at most 10% per hour since it last rose. A longer wait earns no bigger step, so a price pumped for one transaction can't set the high, while a real rally catches up over hours. The keeper checkpoints whenever that raises the high by at least 1%.
price = (quote << 64) / base high = max(high, min(price, high × (1 + 10% × min(elapsed, 1h) / 1h))) line = high × (10,000 − drawdown_bps) / 10,000 target = ceil(sqrt(line × quote × base)) spend = min(cap, (target − quote) plus the pool's fee)
The drawdown can be 1% to 90%. Because the pool keeps quote × base constant, target is the SOL reserve at which the price equals the line. A Floor buy above the line fails with AboveFloor, and one under it never spends more than lifts the price back to the line.
Graduate
Buys and burns on the curve to help it fill. Once the token moves to Raydium it stops buying, and what it collects there is paid to the creator fee recipient.
Only execute_curve runs it. Once the LaunchLab pool has left the trading state, release sends the kit's whole WSOL balance to the recipient and adds it to the launch's released counter. The kit keeps receiving its share of the Raydium creator fee, and each release pays that on too.
Stake
Never buys. Holders stake the token on its page and the kit pays them its SOL, in proportion to how much they stake and for how long. Each time fees arrive, everything not yet paid streams out evenly over the next 3 days, so a stake placed just before a deposit can't take it all. Rewards build up per wallet and can be claimed at any time. Staked tokens can be withdrawn at any time, with no lock and no fee.
The pool keeps one accumulator, reward_per_token_q64: the lamports streamed per staked raw token since it opened. Every stake, unstake and claim first brings the pool up to date, then the position:
released = streaming × (now − last_update) / (stream_end − last_update) reward_per_token += (released << 64) / total_staked income = kit balance − streaming − (distributed − claimed) if income > 0: streaming += income, stream_end = now + 3 days earned += amount × (reward_per_token − position.reward_per_token) >> 64
Once stream_end passes, everything still streaming is released. New fees join whatever is still streaming and restart the 3-day window for all of it. While nobody stakes nothing streams, and the first staker restarts the window rather than collecting everything that built up before them. Staked tokens sit in the stake pool PDA's token account and rewards stay in the kit's WSOL account until claim_stake_rewards pays them out.
Draw
Never buys. Holders stake the token on its page, and once a day one staker wins everything the kit holds. The winner is picked with randomness from ORAO's verifiable random function, and each staker's odds are their share of the stake. A stake can win once it is a day old, and adding to it restarts that wait, so buying in just before a draw doesn't pay. A draw waits until the pot holds at least 0.05 SOL.
The keeper asks ORAO for the randomness, and the pot refunds it ORAO's fee and the rent of the request, about 0.0023 SOL. Stakes are locked from the request until the winner is paid, usually a few seconds. If ORAO doesn't answer within an hour, the draw is cancelled and tried again. If the first eight picks all land on stakes too new to win, nobody wins and the pot carries over. Prizes are claimed on the token's page, and staked tokens can be withdrawn at any time outside a draw, with no fee.
Draw uses the same stake pool and positions as Stake, plus a Draw account for the schedule and a DrawTree: a Fenwick tree with one u64 entry per staker, so a random point in the total stake finds its owner in O(log n). A wallet's first stake appends its entry and pays the rent for 8 more bytes; later stakes and unstakes update the entry in place.
request_draw needs no draw pending, 24 hours since the last draw or since the pool opened, at least one staker, and a pot of 0.05 SOL, where the pot is the kit's WSOL less prizes won and not yet claimed. It calls ORAO request_v2 with a 32-byte seed the keeper picks, refunds the keeper from the pot (refusing anything over 0.01 SOL), and sets the tree's frozen flag, so stakes and unstakes fail with DrawInProgress until it is settled. Once ORAO writes its 64 bytes of randomness, settle_draw tries up to eight picks:
point_n = u128_le(sha256(randomness ‖ n)[0..16]) mod total_stake slot_n = the first tree entry whose running sum exceeds point_n winner = the first pick with staked_at ≤ requested_at − 24h
The caller passes the positions at those slots and the program checks each one against the tree, so anyone can settle but nobody can choose the winner. The prize is credited to the winner's earned, and the next draw is due 24 hours after settling. The keeper can't steer the result with its seed: it can't compute ORAO's output without ORAO's keys, and ORAO refuses a seed it has already seen. cancel_draw only works an hour after the request and only if ORAO hasn't answered, so an answered draw can never be thrown away and retried.
Creator fees
The creator fee builds up in a LaunchLab vault owned by the launch's creator PDA. Each payout sends 95% to the recipient and 5% to whoever ran it. The split is fixed when the token launches.
On Raydium, the pool keeps paying creator fees to the same PDA, and payouts split them as described under Fees. The recipient can hand the fees to another wallet at any time from the Earnings page.
On the curve, claim_creator_fees claims LaunchLab's creator fee vault as the creator PDA and splits it in the same instruction. On Raydium, CPMM's collect_creator_fee pays the creator PDA's WSOL account and split_creator_fees splits whatever is there; the keeper sends both in one transaction. The recipient is changed with set_launch_recipient, which only the current recipient can sign.
Vesting
A launch can hold part of its supply back from the curve. The recipient splits it between wallets before the curve fills. The cliff starts with the move to Raydium, and each wallet's share then unlocks linearly over the unlock period chosen at launch. Wallets claim what has unlocked on the Earnings page, as often as they like.
The locked amount, cliff and unlock period are LaunchLab's vesting parameters, set in initialize_v2. Only the pool's creator can allot them, so the recipient does it through create_creator_vesting, which signs LaunchLab create_vesting_account as the creator PDA, once per wallet. The recipient fronts the vesting record's rent and gets back what LaunchLab doesn't use. Claims go straight to LaunchLab's claim_vested_token, signed by the wallet itself.
Keeper
Anyone can run the keeper. It pays out creator fees and earns 5% of each, claims kit and LabKit fees, and runs every launch's kit. It can't send funds anywhere except the recipient, the kit, LabKit, and itself.
cd cranker npm run crank -- run --keypair ~/.config/solana/keeper.json
Each pass finds every registered launch, reads its fee vaults, kit balance and market, and sends only the work the program would accept: fee claims and splits first, then the kit buys and draws they fund. Fee balances under --min (0.001 SOL by default) wait to build up. Two keepers racing for the same work is harmless; the loser's transaction fails a program check and moves no funds.
- run
- Work every launch on a loop, every --interval ms (default 20,000).
- once
- Do one pass and exit.
- status
- Print the config, every launch and its pending work.
- --cluster
- mainnet, devnet or localnet. Default mainnet.
- --url
- An RPC endpoint, instead of the cluster's default.
- --keypair
- The keeper's wallet. It pays transaction fees and receives the keeper share.
Draws need a little SOL in the keeper's wallet: ORAO takes its fee and the request's rent up front. The pot pays back the fee and the rent the answered request keeps, in WSOL in the same instruction, and ORAO returns the rest of the rent when it answers.
Accounts
Every LabKit account is a PDA of the program, derived from a fixed seed and, for launch accounts, the token's mint. Anyone can derive them; nobody holds their keys.
- ["config"]
- Treasury, authority, fee splits and the platform template for new launches.
- ["fee_wallet"]
- The site's referral fee wallet. Only split_fees moves its funds, to the treasury.
- ["launch", mint]
- The launch: kit, drawdown, fee splits, recipient, pool and kit counters.
- ["creator", mint]
- The pool's creator in LaunchLab and on Raydium. Collects creator fees.
- ["platform_admin", mint]
- Admin of the launch's LaunchLab platform. Signs once, at creation.
- ["kit", mint]
- The platform's fee wallet. Holds the kit's SOL as WSOL and signs its buys.
- ["stake_pool", mint]
- Stake and Draw: owns staked tokens and tracks rewards.
- ["stake", mint, owner]
- One wallet's stake: amount, earned, claimed, and when it last grew.
- ["draw", mint]
- Draw: the schedule, the pending request and the last winner.
- ["draw_tree", mint]
- Draw: every stake in a Fenwick tree, frozen during a draw.
Instructions
Most instructions can be sent by anyone, because each one only moves funds to the destinations the launch already fixes. The keeper is just the usual sender.
Anyone
register_launch, claim_kit_fees, claim_creator_fees, split_creator_fees, split_fees, execute_curve, execute_swap, checkpoint, release, open_stake_pool, open_draw, request_draw, settle_draw and cancel_draw. create_launch is signed by the new token's mint keypair, so anyone launching a token can send it, once per mint.
Holders
stake, unstake and claim_stake_rewards, signed by the position's owner. Claims pay the owner's WSOL account.
The recipient
set_launch_recipient and create_creator_vesting, signed by the launch's current recipient.
LabKit
initialize, signed by the program's upgrade authority, and update_config, which changes the treasury, the fee splits and the template for future launches only. Authority moves in two steps, transfer_authority then accept_authority signed by the new wallet, so it can't be sent to a mistyped address.
Every payout, buy, stake and draw emits an Anchor event, such as KitExecuted, CreatorFeesSplit, Staked and DrawSettled, with the amounts and the slot. The site's activity feeds are built from them.
Guarantees
A launch's kit, drawdown and fee splits are written once by create_launch and no instruction changes them. Its LaunchLab platform can't be changed either, because its admin PDA never signs again. A config update only applies to launches created after it, and the keeper share is capped at 5% in the program.
Funds leave a LabKit PDA only through the instructions above, and only to the launch's recipient, its kit, the treasury, the keeper's share of a payout, a staker's own claim, or a pool the kit buys from. Kit buys are sized by the program from live reserves and every token bought is burned in the same instruction. Only the recipient can change the recipient. Staked tokens can always be withdrawn by their owner, except while a draw waits for ORAO: usually seconds, and at most an hour before anyone can cancel the request.
These rules hold for the program as deployed. The program is upgradeable, and its upgrade authority can replace it, so check who holds that authority on the program account.
Program
Program id 133fUn4mjvLVKoe6oR7BWwAiF4qtFgmkg35BdegqgMG3
Fee wallet 63YVkdvubREFGAuc8HkW8p2i8uqp62TV1jTDd9GXcEoh
Built with Anchor 0.30.1. It calls Raydium LaunchLab, Raydium CPMM and ORAO VRF, each pinned to its program id.
The source is on GitHub, and the deployed program is a verified build of it: anyone can rebuild it and get the same hash as the code on chain. Report security issues by DM to @labkittrade.