Set up a launchpad
A launchpad is an entry in Bankr's contracts that you operate. It holds the rules every coin launched on it must follow, and it pays the wallets you name a share of every trade. You write no contracts and run no indexer.
This page shows how to register one and set it up. If you have not registered a launchpad before, Getting started walks through it step by step.
What you decide
- Your payees. Up to 4 wallets that share your launchpad's cut of every trading fee, on every coin launched on it.
- A range and a default for each setting. The trading fee, snipe protection, the supply, the wallet cap, vesting and more. A launch names a value inside your range, or takes your default.
- Which features a launch may use. Each optional feature has a switch.
- Who may launch. Anyone, or only the launches your server approves.
Your changes take effect in one transaction and reach later launches only. A coin that is already live keeps the terms it launched with.
A complete example
This script registers a launchpad with two payees, configures it and reads it back. It sends two transactions from the operator wallet.
// setup-launchpad.ts: registers a launchpad and sets it up. Run it once: `bun setup-launchpad.ts`.
import {
createPublicClient,
createWalletClient,
formatEther,
http,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import {
createLaunchClient,
percentToBps,
percentToPips,
pipsToPercent,
type UnsignedTx,
} from "@bankr/launch-sdk";
const transport = http(process.env.BASE_RPC_URL);
const publicClient = createPublicClient({ chain: base, transport });
const operator = privateKeyToAccount(process.env.OPERATOR_KEY as `0x${string}`);
const walletClient = createWalletClient({
account: operator,
chain: base,
transport,
});
const client = createLaunchClient({
chain: "base",
publicClient,
walletClient,
});
// settings reads the contracts. launchpads builds your launchpad's transactions.
const { settings, launchpads } = client.contracts();
/** Sends one unsigned transaction from the operator wallet and waits for it. */
async function send(tx: UnsignedTx) {
const hash = await walletClient.sendTransaction({
to: tx.to,
data: tx.data,
value: tx.value,
gas: tx.gas,
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });
if (receipt.status !== "success")
throw new Error(`Transaction ${hash} reverted`);
return receipt;
}
// A launchpad launches where the chain reports paused: false and gated: false. Registration goes through either way.
const { paused, gated } = await client.status();
if (paused || gated)
throw new Error("A launchpad cannot launch on this chain.");
// 1. Register. Two payees share your launchpad's cut of every fee: 15% to you, 5% to a partner.
const registration = await launchpads.register({
operator: operator.address,
payees: [
{ address: operator.address, shareBps: percentToBps("15") },
{
address: "0x1111111111111111111111111111111111111111",
shareBps: percentToBps("5"),
},
],
metadataUri: "https://your-site.example/launchpad.json",
});
console.log(`bond: ${formatEther(registration.value)} ETH`);
const launchpadId = launchpads.launchpadIdFromReceipt(await send(registration));
console.log(`launchpad ${launchpadId} registered`);
// 2. Configure. One transaction sets any number of settings.
await send(
await launchpads.configure(launchpadId, {
knobs: {
// The trading fee: a launch picks 1% to 2%, and gets 1% when it names none.
steadyPips: {
min: percentToPips("1"),
max: percentToPips("2"),
default: percentToPips("1"),
},
// Snipe protection by default: every coin opens at a 50% fee that falls to its trading fee in 20 seconds.
startPips: { default: percentToPips("50") },
decaySecs: { default: 20 },
// Every coin has a supply of one billion, in whole tokens.
supply: {
min: 1_000_000_000,
max: 1_000_000_000,
default: 1_000_000_000,
},
// The wallet cap stays 2% for 24 hours by default. A launch may now shorten it, or have none.
capSecs: { min: 0 },
},
// No extra allocations of supply on this launchpad.
switches: { allocations: false },
}),
);
// 3. Read it back.
const pad = await settings.pad(launchpadId);
const { steadyPips, startPips, decaySecs } = pad.atLaunch.knobs;
console.log(`operator ${pad.operator}, open to anyone: ${pad.signer === null}`);
console.log(
`trading fee ${pipsToPercent(steadyPips.min)}% to ${pipsToPercent(steadyPips.max)}%`,
);
console.log(
`opens at ${pipsToPercent(startPips.default)}% for ${decaySecs.default} seconds`,
);
console.log(`${pad.payees.length} payees`);
It prints:
bond: 0.01 ETH
launchpad 7 registered
operator 0x…, open to anyone: true
trading fee 1% to 2%
opens at 50% for 20 seconds
2 payees
Your id will differ. Keep it: every launch on your launchpad names it as launchpadId.
The samples below continue this file. They use client, settings, launchpads, send, operator and launchpadId from it.
Register
launchpads.register builds the registration. The wallet or Safe that sends it becomes the launchpad's operator.
| Field | Meaning |
|---|---|
operator | The account that sends the registration. It operates the launchpad. A wallet or a Safe. |
payees | Who takes your launchpad's cut of every fee. From none to 4. See Payees. |
metadataUri | A link to your launchpad's name and logo. Optional, at most 2,048 bytes. |
signer | The key that approves each launch. Leave it out for an open launchpad. See Who may launch. |
- The bond. Registration pays a one-time bond, 0.01 ETH on Base. It is not refunded. The transaction's
valueis the exact amount, read from the chain when you build it. - From a Safe. Pass the Safe's address as
operator, send the transaction through the Safe, and read the id from the executed transaction's receipt withlaunchpads.launchpadIdFromReceipt(receipt). - Check the chain first. A launchpad launches where
client.status()reportspaused: falseandgated: false. Registration goes through either way, and the bond is not refunded. - Ready to configure. Configuration lists what a new launchpad starts with.
Payees
Your payees take your launchpad's cut of every fee, on every coin launched on it. setPayees replaces the whole list:
await send(
await launchpads.setPayees(launchpadId, [
{ address: operator.address, shareBps: percentToBps("15") },
{
address: "0x1111111111111111111111111111111111111111",
shareBps: percentToBps("5"),
},
]),
);
| Rule | Detail |
|---|---|
| How many | From none to 4. A launchpad with no payee takes no cut. |
| What a share is | shareBps is that payee's part of what is left of each fee after Bankr's cut and any referrer. shareWad names a finer share. |
| Together | At most 100% together. What your payees leave goes to the coin's creator side. |
| Paid in | The coin's quote token, such as WETH, on buys and on sells. |
| A contract payee | A wallet, a Safe or an EIP-7702 wallet needs nothing. Any other contract must first restrict who may claim for it on the fee ledger. |
| Live coins | A coin keeps the payees it launched with. A change reaches later launches. |
Each payee claims its own share. Fees shows the call.
A launch is planned against your payees as they stand. If you change them before a planned launch lands, that launch reverts with LAUNCHPAD_TERMS_CHANGED. Launch again to plan against the new payees. A launch never pays you more than its launcher was shown.
A separate split for snipe fees
A coin can open at a high fee that falls to its trading fee within seconds. That is snipe protection: bots that buy in the first seconds pay the high fee.
The part of a fee above the trading fee is the surplus. The SDK's options call it decay. decayShareBps is a payee's share of the surplus. decayAutoLpBps is the share of the remainder that goes into locked liquidity. The creator takes what is left.
await send(
await launchpads.setPayees(
launchpadId,
[
{
address: operator.address,
shareBps: percentToBps("20"), // of every fee at the trading rate
decayShareBps: percentToBps("50"), // of the surplus while the fee is above the trading rate
},
],
{ decayAutoLpBps: 0 }, // none of the rest of the surplus is locked: the creator takes it
),
);
Without a decayShareBps, the surplus splits like the rest of the fee.
If your split sends any of the surplus into locked liquidity (decayAutoLpBps above 0), every launch whose fee decays must also carry an auto-LP share. Give the autoLpBps setting a min above 0, or a launch that sets autoLpBps: 0 is refused.
Configure: ranges, defaults and switches
A setting with a range is a knob: { min, max, default }. A feature that is on or off is a switch. configure changes any number of both in one transaction, as the complete example does.
How to say what you mean:
| You want | Set |
|---|---|
| One value for every coin | min and max to the same value. |
| Launchers choose | A min and a max apart, and the default a launch gets. |
| A feature off for every coin | Its switch off, or the max of the knob that sizes it to 0. |
| A feature required on every coin | The knob's min above 0. |
| A ceiling, such as the first buy's size | The knob's max. A ceiling has no default. |
Rules to know:
- Leave out what you do not change. Any of
min,maxanddefaultmay be left out, and so may any knob or switch. What you leave out stays as your launchpad holds it. The three numbers must still fit together:minat mostdefaultat mostmax. setKnobs(id, knobs)andsetSwitches(id, switches)change knobs or switches alone.- A change is checked before you sign. A value outside the contracts' limits throws
INVALID_LAUNCHPAD_CONFIG, anderr.detailsays which. - Build one change at a time. Each builder reads your launchpad as it stands. Build the second transaction after the first lands. In one Safe batch, make one call per knob or per switch group, and name every field in it.
Configuration lists every knob and every switch, with the range the contracts allow and what a new launchpad starts with.
Who may launch
- An open launchpad takes any launcher, inside your rules. It needs no server.
- A launchpad with a signer takes only the launches that key approves. An approval covers every term of one launch, works once and expires.
await send(
await launchpads.setSigner(
launchpadId,
"0x2222222222222222222222222222222222222222", // the address of your signing key
),
);
await send(await launchpads.setSigner(launchpadId, null)); // open again
Launch for your users builds the server route that signs.
Quote tokens
A quote token is the token a coin trades against, such as WETH. A new launchpad takes WETH, USDC and any other ERC-20.
const weth = client.provider.addresses.weth;
// List WETH. From now on your launchpad takes only the quote tokens it lists.
await send(
await launchpads.setQuoteTerms(launchpadId, weth, { allowed: true }),
);
| You want | Set |
|---|---|
| Any ERC-20 | Nothing. A new launchpad starts this way. |
| Only tokens Bankr lists and prices | The unlistedQuotes switch off. |
| Only the tokens you name | setQuoteTerms(id, token, { allowed: true }) for each. Your launchpad then takes no other. |
| Your own auto-LP amounts for a token | setQuoteTerms(id, token, { allowed: true, ownAmounts: true, compoundFloor, compoundCap }). |
Quote tokens says what changes on a token Bankr does not list.
Curves, extension limits and the wallet cap's controller
| Setting | A new launchpad | Builder |
|---|---|---|
| Curves | The three built-in curves. No custom bands. | setCurveAllowed(id, curve, allowed), with "any" for any bands that pass the rules. |
| Extension limits | Each built-in extension allowed. | setPresetLimits(id, preset, { allowed, maxWindowSecs, minBrakeTicks }). |
| Cap controller | Bankr. | setCapController(id, account): who may end a wallet cap early on your coins. null means nobody. |
// Let launches define their own liquidity bands.
await send(await launchpads.setCurveAllowed(launchpadId, "any", true));
// Sniper Tax may run for at most 10 minutes on this launchpad. Decay Tax is off.
await send(
await launchpads.setPresetLimits(launchpadId, "sniperTax", {
maxWindowSecs: 600,
}),
);
await send(
await launchpads.setPresetLimits(launchpadId, "decayTax", { allowed: false }),
);
// Nobody can end a wallet cap early on this launchpad's coins.
await send(await launchpads.setCapController(launchpadId, null));
The launchpad's settings name the built-in extensions "sniperTax", "decayTax", "pumpBrake" and "raffleRun". A launch names them "sniper_tax", "decay_tax" and "pump_brake". Extensions covers them.
Address suffix
Every token on your launchpad can end in the same hex digits.
await send(
await launchpads.setVanity(launchpadId, { suffix: 0xc0ffee, nibbles: 6 }),
);
- 4 to 6 hex digits. Only
0-9anda-f.{ suffix: 0, nibbles: 0 }removes it. - First come, first served. Bankr can take a suffix back.
- The SDK finds the address.
client.plansearches for a salt whose token ends in your suffix. A long suffix can needmineVanitySaltwith a largermaxTries.
Pause, branding and handover
| Builder | What it does |
|---|---|
setPaused(id, true) | Stops new launches on your launchpad. Live coins are untouched. |
setMetadataUri(id, uri) | Replaces your launchpad's branding link. |
transferOperator(id, next) | Offers the launchpad to another account. |
acceptOperator(id), sent by next | Completes the handover. Until it is sent, you remain the operator. |
Read your launchpad
const mine = await settings.pad(launchpadId);
console.log(mine.operator, mine.signer, mine.paused);
console.log(mine.atLaunch.knobs.capSecs, mine.atLaunch.switches.takeover);
console.log(mine.payees, mine.decay);
const limits = await settings.limits(); // the widest range you can set for each knob
const fresh = await settings.template(); // what a new launchpad starts with
pad.atLaunch is what a launch on your launchpad meets right now. Read your ranges and defaults from it.
Bankr's launch index counts your launches and their volume:
const stats = await client.index.launchpadStats(launchpadId);
console.log(stats.stats.launches, stats.stats.volume24hUsd);
Reading launches lists and searches them.
What you cannot change
- A live coin. Its terms are frozen at launch. No change of yours reaches it.
- Bankr's cut of each fee, and the share of it that goes to the coin's holders. Fees explains both.
- The contracts' limits. Your ranges sit inside them. Configuration lists each limit.