Skip to main content

Melt Pools

Contract address

Melt Pools share the one launchpad address with pools and microsales. Use the same Launchpad ABI for all three launch styles.

NetworkChain IDLaunchpad
BNB Chain (mainnet)560xD9CcE715619fA9082d21375B6B37A3a0d99138F4
BNB Chain (testnet)970x0AA21d47b600B04527c09BbD9A30aF32cb64f6cF
Robinhood Chain46630x7E0752B42f9db92F12E221E10fFfa10bfE8668C6

An individual Melt Pool is identified by its fundManager address. Pass that handle to the trade, finalize, and read functions; do not call the fund manager itself.

A Melt Pool is a continuous token sale. The launchpad mints a token and seeds a virtual constant-product curve. Buys move the price up, sells move it down, and the buyer receives tokens in the same transaction. When all curve tokens are sold, anyone can graduate the pool and list the token on its DEX.

The contract uses BondingCurve in its function, event, and struct names. Those identifiers are the code-level names for Melt Pools.

Contents​

How the curve works​

The pool tracks virtual reserveBase (the launched token) and reserveQuote (the pool's quote currency). The spot ratio is reserveQuote / reserveBase. A buy removes base and adds quote; a sell adds base and removes quote.

Only totalSellingBase tokens are available on the curve. The rest of the supply is held for the DEX listing. The pool is sold out when reserveBase reaches initialBase - totalSellingBase.

Every trade includes a 1% platform fee. A CheeseTaxTokenV2 curve also withholds its configured buy or sell tax in the quote currency, and on top of that creator tax CheesePad takes an additional 10% platform fee (see the token fee model). The quote functions include the 1% fee and the creator tax.

A pool is Active (0) or Finalized (1). Sold-out status is derived from the reserves, not stored as a separate state.

Quote currencies​

A Melt Pool can be quoted in the chain's native currency or in an ERC20 with an active curve config:

const nativeConfig = await launchpad.getBondingCurveConfig(ethers.ZeroAddress);
const quoteConfig = await launchpad.getBondingCurveConfig(QUOTE_TOKEN);

if (!quoteConfig.active) throw new Error("No active curve for this quote token");

The pool's quoteToken field is address(0) for native currency and the token address for an ERC20 curve. The same buyBondingCurve and sellBondingCurve functions serve both kinds; payment and approval differ as described below.

Melt curves and microsales share one launchpad-wide allow-list of quote tokens, and every listed ERC20 has an active curve config. See Supported currencies for the full per-chain list — native BNB plus ERC20 quote tokens on BNB Chain, native ETH only on Robinhood. Read the current set live with getAllowedQuoteTokens().

Fee-on-transfer and rebasing quote tokens are not supported. ERC20 transfers must deliver the exact requested amount.

Token types​

There are two create functions. Each one accepts every quote kind — native, a whitelisted token, or an arbitrary token — so you pick a function by whether the token is taxed, not by the currency:

Create functionTokenTaxQuote currencyVault
createNoTaxCurvePoolCheeseTokennonenative / whitelisted / arbitraryn/a
createTaxCurvePoolCheeseTaxTokenV2configurable buy/sell taxnative / whitelisted / arbitraryoptional

The launchpad reads the quote you pass and dispatches internally: a native coin or a platform-whitelisted quote seeds from its published curve config; an arbitrary token's raise is computed on-chain from a DEX venue (see Creating a Melt Pool). A createTaxCurvePool token carries a creator-configured buy/sell tax that splits among a fee receiver, holders, burn, and auto-liquidity. See Minted tokens for the token lifecycle and getters.

Deprecated create functions

The earlier per-currency create functions — createBondingCurveNoTaxToken, createBondingCurveNoTaxTokenQuote, createBondingCurveTaxTokenV2, createBondingCurveTaxTokenV2Quote, createBondingCurveTaxTokenWithVaultV2, createBondingCurveTaxTokenV2CustomQuote (and the legacy V1 createBondingCurveTaxToken / …WithVault) — are deprecated. They remain on the diamond so existing integrations keep working, but new integrations should call createNoTaxCurvePool / createTaxCurvePool, which cover every currency and vault combination in two functions.

Creating a Melt Pool​

Both functions return the pool's index and fundManager and emit BondingCurvePoolCreated(index, fundManager, owner, token, quoteToken, timestamp). Their shared shape is (params, quote, venue, raiseQuote[, vaultFactory, vaultData]):

  • params — a struct carrying name, symbol, poolDetails, salt, and initialBuyQuote (createTaxCurvePool adds the tax fields, below).
  • quote — the sale currency: address(0) for native, or the ERC20 address for a whitelisted or arbitrary quote.
  • venue and raiseQuote — the arbitrary-quote inputs, both only used for a non-whitelisted quote; pass a zeroed tuple and 0 for native/whitelisted. Get both from the eligibility check (see Supported currencies): venue names the DEX pool, and raiseQuote (the response's estimatedRaiseQuote) is the raise the pool is seeded with. The contract does not derive the raise — it re-reads the venue to enforce the anchor liquidity floor and requires raiseQuote to land within 10% of its own on-chain reference, so a stale or wrong figure reverts.

initialBuyQuote is the creator buy in the same transaction; set it to zero to skip. For a native curve, send exactly that amount as msg.value. For an ERC20 (whitelisted or arbitrary) curve, approve the launchpad first and send no native value. The initial buy pays the same platform fee and, for a tax token, creator tax as any other curve buy.

Generate the token salt​

Request a fresh salt immediately before every create call. The response also contains the token address that the launchpad will deploy. Do not reuse a salt for another launch.

type SaltTokenType = "CheeseToken" | "CheeseTaxTokenV2";

async function generateTokenSalt(
tokenType: SaltTokenType,
name: string,
symbol: string,
router: string,
): Promise<{ salt: string; address: string }> {
const { chainId } = await provider.getNetwork();
const query = new URLSearchParams({
tokenType,
launchpadContract: LAUNCHPAD,
chainId: chainId.toString(),
name,
symbol,
router,
});

const response = await fetch(
`https://api.cheesepad.ai/microsale/generate-salt?${query}`,
);
if (!response.ok) {
throw new Error(`Salt generation failed: ${response.status} ${await response.text()}`);
}
return response.json();
}

Pass one of the launchpad's supported routers; the curve token is paired on the launchpad's primary router. The API always returns a 32-byte salt and its corresponding address.

No-tax curve — createNoTaxCurvePool(params, quote, venue, raiseQuote)​

Mints a plain CheeseToken. params is:

// salt from generateTokenSalt("CheeseToken", name, symbol, router)
const ZERO_VENUE = {
version: 0,
dexKey: ethers.ZeroAddress,
pairingAsset: ethers.ZeroAddress,
v3Fee: 0,
};

const params = {
name: "My Token",
symbol: "MTK",
poolDetails: "", // free-form metadata string
salt, // CREATE2 salt (vanity address) from the salt API
initialBuyQuote: 0n, // creator buy at create, in the quote's decimals; 0 to skip
};

await launchpadRW.createNoTaxCurvePool(
params,
ethers.ZeroAddress, // quote: address(0) native · a whitelisted ERC20 · an arbitrary ERC20
ZERO_VENUE, // venue: only for an arbitrary quote; ZERO_VENUE otherwise
0n, // raiseQuote: eligibility.estimatedRaiseQuote for an arbitrary quote; 0 otherwise
{ value: params.initialBuyQuote }, // native initial buy; for an ERC20 quote approve first and drop `value`
);

Both functions return (index, fundManager) and emit BondingCurvePoolCreated.

Tax curve — createTaxCurvePool(params, quote, venue, raiseQuote, vaultFactory, vaultData)​

Mints a CheeseTaxTokenV2. Same quote / venue / raiseQuote as the no-tax function, plus the standard CheeseTaxTokenV2 tax params (identical to a microsale tax token — see microsale for the full field reference) and an optional vault. params is:

// salt from generateTokenSalt("CheeseTaxTokenV2", name, symbol, router)
const params = {
name: "Taxed Token",
symbol: "TAX",
poolDetails: "",
salt,
feeReceiver: "0xYourRevenueWallet", // tax fee-receiver wallet (a vault overrides it, below)
buyTaxBps: 300n, // 3% — each side <= 1000 (10%), at least one non-zero
sellTaxBps: 500n, // 5%
taxDuration: 365n * 24n * 60n * 60n,
antiFarmerDuration: 15n * 60n,
feeReceiverBps: 7000, // tax split — the four *Bps sum to 10000
holdersBps: 1000,
burnBps: 1000,
liquidityBps: 1000,
minHolderShare: ethers.parseEther("1000"), // min balance for dividends (needed if holdersBps > 0)
initialBuyQuote: 0n,
};

await launchpadRW.createTaxCurvePool(
params,
ethers.ZeroAddress, // quote (same options as no-tax)
ZERO_VENUE, // venue (arbitrary quote only)
0n, // raiseQuote (arbitrary quote only; from eligibility)
ethers.ZeroAddress, // vaultFactory: 0 = wallet fee receiver; else a vault factory
"0x", // vaultData: per-vault config (see Vaults); "0x" when no vault
{ value: params.initialBuyQuote },
);

With a vault. Pass a non-zero vaultFactory and its vaultData; the launchpad deploys the vault and binds it as the fee receiver (feeReceiverBps must be non-zero so it is funded). A native curve needs a native-revenue vault and an ERC20/arbitrary curve an ERC20-revenue one — a mismatch reverts. See Vaults for factory validation and vaultData encoding.

Agent ID only and max per wallet​

Two optional buyer rules are set once, at creation, with createNoTaxCurvePoolWithRules or createTaxCurvePoolWithRules (the last argument is CurveBuyerRules { bool agentIdOnly; uint16 maxWalletBps }). Neither can be changed later. The default create functions set no rules.

RuleWhat it does
Agent ID onlyOnly wallets that hold an Agent ID can buy. Selling is open to every holder. BSC only. The creator's first buy needs no Agent ID.
Max per walletmaxWalletBps from 50 to 1000 (0.5% to 10% of the 1,000,000,000 supply). A buy that would take a wallet over the limit reverts. It counts the creator's first buy. 0 means no limit.

On an Agent ID-only curve the token can't be moved wallet to wallet until it lists, so agents can't pass tokens on to normal wallets. Buys, sells and graduation work as usual.

caution

On a normal curve, max per wallet only stops one wallet sweeping the curve. Tokens can still move between wallets, and anyone can use many wallets, so it is not a limit per person.

The list API shows both rules as agentIdOnly and maxWalletBps on each curve, and GET /bonding-curve/list?agentIdOnly=true returns only Agent ID-only curves. For how AI agents buy and sell, see AI agents.

Buying​

Preview the output, apply a slippage floor, then call buyBondingCurve(fundManager, amountIn, minTokensOut).

Native-quoted pool​

const amountIn = ethers.parseEther("0.5");
const expected = await launchpad.quoteBuyBondingCurve(fundManager, amountIn);
const minTokensOut = (expected * 99n) / 100n;

await launchpadRW.buyBondingCurve(fundManager, amountIn, minTokensOut, {
value: amountIn,
});

ERC20-quoted pool​

const pool = await launchpad.getBondingCurvePoolByFundManager(fundManager);
const quote = new ethers.Contract(pool.quoteToken, ERC20_ABI, signer);
const amountIn = ethers.parseUnits("0.5", await quote.decimals());
const expected = await launchpad.quoteBuyBondingCurve(fundManager, amountIn);
const minTokensOut = (expected * 99n) / 100n;
await quote.approve(LAUNCHPAD, amountIn);

await launchpadRW.buyBondingCurve(fundManager, amountIn, minTokensOut);

The buy that reaches the end of the curve only uses the amount needed for the remaining tokens. A native pool refunds the unused amount. An ERC20 pool leaves it in the buyer's wallet by pulling only the amount used.

Each buy emits BondingCurveTraded(..., isBuy = true, ...). The crossing buy also emits BondingCurveSoldOut.

Selling​

Approve the launchpad for the base token, quote the net payout, and call sellBondingCurve(fundManager, baseIn, minQuoteOut):

const token = new ethers.Contract(tokenAddress, ERC20_ABI, signer);
await token.approve(LAUNCHPAD, baseIn);

const expected = await launchpad.quoteSellBondingCurve(fundManager, baseIn);
const minQuoteOut = (expected * 99n) / 100n;
await launchpadRW.sellBondingCurve(fundManager, baseIn, minQuoteOut);

The payout is native currency when pool.quoteToken == address(0) and otherwise the ERC20 quote token. The quote is net of the 1% platform fee and any V2 creator tax. Selling is disabled after the curve sells out.

Previewing a trade​

const tokensOut = await launchpad.quoteBuyBondingCurve(fundManager, quoteIn);
const quoteOut = await launchpad.quoteSellBondingCurve(fundManager, baseIn);
const progressBps = await launchpad.bondingCurveProgressBps(fundManager);
const soldOut = await launchpad.isBondingCurveSoldOut(fundManager);

quoteBuyBondingCurve takes a gross quote amount and returns the delivered token amount. quoteSellBondingCurve returns the net quote payout. Both mirror the platform fee and the V2 tax, and the buy quote caps its result at the remaining curve inventory.

Graduation​

Use buyBondingCurveAndGraduate when you want a buy that attempts to list the token immediately if that same buy sells out the curve:

const pool = await launchpad.getBondingCurvePoolByFundManager(fundManager);
await launchpadRW.buyBondingCurveAndGraduate(
fundManager,
amountIn,
minTokensOut,
pool.quoteToken === ethers.ZeroAddress ? { value: amountIn } : {},
);

If the buy does not sell out the curve, it behaves like buyBondingCurve. If it sells out, the launchpad attempts graduation in the same transaction. Watch BondingCurveFinalized for success. A recoverable listing failure emits BondingCurveAutoFinalizeFailed, leaving the sold-out pool ready for a later permissionless finalize.

Anyone can finalize a sold-out pool directly:

if (await launchpad.isBondingCurveSoldOut(fundManager)) {
await launchpadRW.finalizeBondingCurve(fundManager);
}

Finalization adds the collected quote currency and listing allocation to the configured DEX and burns the LP. It sets the pool to Finalized, records listedAt, and emits BondingCurveFinalized(index, fundManager, pair, timestamp).

Reading pool state​

FunctionReturns
getBondingCurvePoolByFundManager(fundManager)full pool by sale handle
getBondingCurvePoolByToken(token)full pool by launched token
getBondingCurvePool(index)full pool by creation index
getBondingCurvePoolsCount()total pools ever created
quoteBuyBondingCurve(fundManager, quoteIn)tokens out for a gross quote spend
quoteSellBondingCurve(fundManager, baseIn)net quote out for a token sell
bondingCurveProgressBps(fundManager)fill progress, 0 to 10000
bondingCurveGraduationQuote(fundManager)curve quote reserve at sellout
isBondingCurveSoldOut(fundManager)whether all curve inventory is sold
getBondingCurveConfig(quoteToken)curve template for a quote currency

The full BondingCurvePool field list is in Events and data. Both reverse lookups revert with Pool not found for an unknown address.

Editing pool details​

The pool owner can update free-form metadata while the pool is active:

await launchpadRW.updateBondingCurvePoolDetails(fundManager, poolDetails);

A platform operator can also update it and can do so after finalization.

Error reference​

MessageCause
Config not activeno active curve config for a native/whitelisted quote
Dex not enabledthe launchpad's primary router is not enabled
Invalid fee receivertax launch used the zero address for feeReceiver
Not a contractan arbitrary quote address has no code
Quote decimals too highan arbitrary quote has more than 18 decimals
UnsupportedAnchor / InsufficientQuoteLiquiditythe arbitrary quote's venue failed the on-chain eligibility check
Vault revenue mode mismatchthe vault's revenue mode does not match the quote (native vs ERC20)
Tax duration required / Tax duration too shortduration is zero or shorter than antiFarmerDuration
Invalid allocationthe tax allocation does not sum to 10000 BPS
No value / Value mismatchnative buy amount is zero or differs from msg.value
Native not acceptednative value was sent to an ERC20-quoted pool
Non-exact quote transferan ERC20 quote transfer did not deliver the exact amount
Sold outa buy or sell was attempted after the curve sold out
Slippagetrade output was below the supplied minimum
AgentIdRequiredbuying on an Agent ID-only curve without an Agent ID
MaxWalletExceededa buy would take the wallet over the curve's max per wallet
InvalidMaxWalletBpscreating a curve with maxWalletBps other than 0 or 50 to 1000
AgentIdRegistryUnsetthe Agent ID check is not set up on this chain (creating an Agent ID-only curve, or buying on one)
Not sold outfinalize was called before the curve sold out
Pool not foundthe fund manager or token does not resolve to a Melt Pool
Unauthorizedpool metadata was edited by an unauthorized caller