SDK
Launch with a companion
A launch whose creator is a program, the companion: it pays the launcher their creator fee and spends the companion fee - bought back and burned, shared with holders, traded by Snowball, drawn by the Jackpot, or spent by a script you wrote. Launch with one through the API or the builders; anyone can crank one.
What a companion is
The companion creates the launch and signs as its creator, from the companion address, PDA(["creator", mint]) under the companion program, so the launch’s whole fee lands with it and only its code spends it, by a split fixed at create. Every step after that is permissionless and pays its sender a bounty: if Mintvelocity stopped cranking, any holder could. The mechanism in full: Companions.
It is the second of the two layers a builder works in. A hook runs inside the trade and writes into the holdings; a companion never does: Mintvelocity’s companion program holds the pot and either runs one of its own actions (the split, Snowball, the Jackpot) or calls a script you wrote with the launch’s accounts, which reads what it likes and answers, and the program executes the answer inside hard bounds. That program is never upgraded for a builder’s program, only for a new kind of action.
The split, and the templates
A companion splits every fee claim three ways, in whole basis points summing to 10,000: buybackBps (bought back on the token’s pool and burned), holdersBps (streamed to holders through the kit) and beneficiaryBps (paid to the launcher in SOL); a script or a game adds the pot’s part. On chain the launch has one creatorFeeBps, the whole fee; the launch page shows it as two rows, the Creator fee (the launcher’s part) and the Companion fee (the rest, which the companion spends), together at most 5% of a trade.
| Template | Each fee claim | First buy | Holder rewards |
|---|---|---|---|
| buysItself | 100% bought back and burned | None: no dev at all | Optional |
| rugProofDev | 50% to holders, 50% to the launcher | Held, vesting to the launcher | Required |
| buybackAndReward | 50% bought back and burned, 50% to holders | Held, vesting to the launcher | Required |
The splits are COMPANION_TEMPLATES in the SDK (COMPANION_SPLITS in shared). The API adds COMPANION_DEFAULTS: a 0.5% bounty, at most 1 SOL a buyback, at least 60 s apart, and a vest of vestDays (the site offers 7, 30, 90; the API takes 0 to 365, 30 by default).
Launch with one: the API
The launch page’s own path: POST /api/launch/prepare with companion: { split: { buybackBps, holdersBps, beneficiaryBps }, vestDays? } (or { template, vestDays? }). The answer has one more transaction first, “Set up the companion”, signed by the mint too, then the launch and the first buy, in stage order. Sign each with the wallet, then the mint where extraSigners names it; POST tx/submit and poll until confirmed.
The rules
- No creator lock
- creatorLockDays is 0: the companion vests the first buy instead.
- The split
- Three shares summing to 10,000 bps, each a whole number, and a creatorFeeBps above 0 for the companion to run.
- Holder rewards
- On whenever holdersBps is above 0 (rugProofDev, buybackAndReward): the holders’ share goes through the kit.
- A custom hook
- A companion of any kind may launch a token with a custom hook, from a plain config (no author share; a listed config is refused) and with no holders’ share (one token hook per mint: the kit carries holder rewards). Every step that moves the token carries the hook’s slice.
- First buy
- Within what max wallet lets one wallet hold at the opening. A split that buys back everything (buysItself) has no dev: send none.
- Beneficiary
- The launching wallet: paid its part in SOL and the first buy as it vests. With holder rewards on it must be a wallet, not a program.
Keep the mint key
Keep the mint keypair from before signing until the launch confirms. Once “Set up the companion” lands, only that key can launch it or take its SOL back. The API can’t prepare that mint again: take the SOL back, then launch with a fresh mint. GET /api/companion/:mint answers { state: 'none' | 'set-up' | 'launched', refundable }; for set-up, POST companion/refund/prepare and sign with the wallet then the mint.
Crank any companion
Permissionless; each step checks on chain that it is due and pays its sender a bounty of what it moves (0.5% for launches made through the API, at most 1%): companion.claimFees (the launch’s fees in, split), companion.buyback (buys on the pool and burns), companion.share (holders’ part into the kit), companion.withdraw (launcher’s part, in SOL), companion.release (vested first buy). One step a transaction, claimFees first.
Custom companions (scripts)
A companion program of your own is a script, a program the companion program calls to spend the pot. The script reads what it likes (its hook’s data in the holdings, the pool, its state at scriptStateAddress(mint), up to 10,240 bytes the companion makes for it) and acts as the companion address: it may trade on the launch pool, buy back, burn; the companion program refuses a step that overspends the pot (ScriptOverspent), takes the dev bag (ScriptTookDevBag), takes the companion address’s rent (ScriptTookLamports) or breaks custody (ScriptBrokeCustody), or runs code that is neither approved nor immutable (NotApproved). Builders: companion.createScript after create and before launch (the mint signs); companion.scriptStep by anyone once scriptDue; companion.createScriptV2 for a script with payout terms.