Integrate
Everything a trading bot, aggregator or data site needs to support launchtokens tokens, without asking us. On every EVM chain, every launch goes through one contract, the DexCurveFactory:
- Before graduation, a token trades only on its bonding curve, through
buyandsellon the DexCurveFactory. - After graduation, it trades only on its Uniswap v4 pool: the chain's native coin (ETH, or BNB on BNB Smart Chain) against the token, 1% fee, tick spacing 200, with the chain's UniswapV4Locker as its hook.
Every function and event signature on this page is generated from the contracts' ABIs at build time.
Rather not read chain data? The public API and MCP server serve every token, quote and trade on every chain, and build unsigned launch, buy and sell transactions for your own wallet to sign. No key needed.
On Solana, one program does the same job: see Solana.
Contracts
| Chain | Chain ID | DexCurveFactory | UniswapV4Locker | Graduates at | From block |
|---|---|---|---|---|---|
| Robinhood Chain | 4663 | 0xc093…d49C | 0xfd7a…A000 | 3.5 ETH | 92946078 |
| Ethereum | 1 | 0x3980…a412 | 0x7341…e000 | 3.5 ETH | 26314623 |
| Base | 8453 | 0x3980…a412 | 0x4654…2000 | 3.5 ETH | 53282322 |
| BNB Smart Chain | 56 | 0x3980…a412 | 0x7b7F…6000 | 12 BNB | 130884231 |
| Arbitrum | 42161 | 0x3980…a412 | 0x3f76…2000 | 3.5 ETH | 520122243 |
| Robinhood Chain Testnet | 46630 | 0x9aee…f0dD | 0xc7b7…2000 | 0.035 ETH | 138974226 |
| Base Sepolia | 84532 | 0x1898…7840 | 0x0bbb…A000 | 0.035 ETH | 48399525 |
| Arbitrum Sepolia | 421614 | 0x1898…7840 | 0x17EA…a000 | 0.035 ETH | 324807170 |
Index each chain from its From block (the DexCurveFactory's deploy block). Every address with its explorer links is on Contracts & security. Testnet curves graduate at 1/100 of the mainnet target.
| Chain | Chain ID | Native coin | Public RPC |
|---|---|---|---|
| Robinhood Chain | 4663 | ETH | https://rpc.mainnet.chain.robinhood.com |
| Ethereum | 1 | ETH | https://ethereum-rpc.publicnode.com |
| Base | 8453 | ETH | https://mainnet.base.org |
| BNB Smart Chain | 56 | BNB | https://bsc-dataseed.bnbchain.org |
| Arbitrum | 42161 | ETH | https://arb1.arbitrum.io/rpc |
| Robinhood Chain Testnet | 46630 | ETH | https://rpc.testnet.chain.robinhood.com |
| Base Sepolia | 84532 | ETH | https://sepolia.base.org |
| Arbitrum Sepolia | 421614 | ETH | https://sepolia-rollup.arbitrum.io/rpc |
Robinhood Chain also has earlier curve sets whose tokens still trade: see Earlier curve sets.
ABIs and machine-readable addresses
- DexCurveFactory.json: the launch contract on every EVM chain
- UniswapV4Locker.json: graduation, the pool key and the locked positions
- CurveToken.json: the token ABI (ERC-20 plus the launch views)
- CurveFactory.json: Robinhood Chain's earlier Uniswap v3 curve set
- contracts.json: addresses, start blocks and pool settings for every chain
All of them can be fetched from any origin.
Is this a launchtokens token?
Call curve(token) on the chain's DexCurveFactory. It reverts with UnknownToken(token) for anything that factory didn't launch. Our tokens also return their factory from factory(), but any contract can claim that; only curve(token) proves it. On Robinhood Chain, also ask the earlier factories.
Read a curve
function curve(address token) external view returns (CurveView v);
struct CurveView {
address creator;
uint256 raised;
uint256 target;
uint256 sold;
uint256 curveTokens;
bool graduated;
address pool;
uint256 positionId;
uint256 launchedAt;
uint256 price;
uint256 marketCap;
}| Field | Meaning |
|---|---|
creator | The wallet that launched the token |
raised | Native coin in the curve, in wei |
target | What the curve must raise to graduate (3.5 ETH; 12 BNB on BNB Smart Chain) |
sold | Tokens sold from the curve, in token units (18 decimals) |
curveTokens | Tokens for sale on the curve: 800,000,000 × 10¹⁸ |
graduated | true once the token has moved to its Uniswap pool |
pool | The address the token is closed to until graduation: the chain's Uniswap v4 PoolManager. The pool itself is identified by its pool id: poolIdFor(token) on the UniswapV4Locker |
positionId | The locked position's ID in the UniswapV4Locker; 0 until graduation |
launchedAt | Launch time, unix seconds |
price | Spot price, wei per whole token |
marketCap | Fully diluted market cap, wei (price × 1,000,000,000) |
Progress to graduation is raised / target.
Quotes
function getBuyQuote(address token, uint256 ethIn) external view returns (uint256 tokensOut, uint256 fee, uint256 ethUsed, uint256 refund, bool graduates);
function getSellQuote(address token, uint256 tokensIn) external view returns (uint256 ethOut, uint256 fee);getBuyQuote:ethInis everything you send, fee included.feeis the 1% fee. If the buy would graduate the token,graduatesistrue,tokensOutis the rest of the curve,ethUsedis what that costs, andrefundcomes back to the buyer in the same transaction.getSellQuote:ethOutis what the seller receives, after the 1% fee.- Both revert with
AlreadyGraduated(token)after graduation.getBuyQuoteignores the pause and the launch protection cap.
Amounts named eth are in the chain's native coin: BNB on BNB Smart Chain. The fee is 1% of the trade, rounded up to the wei.
Buy
function buy(address token, uint256 minTokensOut, uint256 deadline) external payable returns (uint256 tokensOut);- Pay in the native coin (
msg.value). All of it is spent, except in the buy that graduates the token: that buy fills up to the curve's last token and refunds the excess in the same transaction. minTokensOutis your slippage guard;deadlineis a unix timestamp in seconds.- The buy that graduates the token also creates the pool and locks the liquidity. It needs up to
GRADUATION_EXTRA_GAS()(900,000) more gas than a normal buy. Estimate gas per transaction; don't hard-code a limit. buyreverts withLaunchesPaused()while the factory is paused.
Sell
function sell(address token, uint256 amountIn, uint256 minEthOut, uint256 deadline) external returns (uint256 ethOut);- First approve the DexCurveFactory to spend
amountInof the token (approve(factory, amountIn)on the token). minEthOutis your slippage guard (after the fee);deadlineis a unix timestamp in seconds.- Selling is never paused. The pause has no effect on
sell. - After graduation
sellreverts withAlreadyGraduated(token): sell on the pool instead.
Launch protection
For the first 60 seconds after launch no wallet may hold more than 2% of supply (20,000,000 tokens). A buy or transfer that would leave the receiver above the cap reverts inside the token with:
error HoldingCapExceeded(address account, uint256 balance);This error comes from the CurveToken, so decode reverts with both ABIs. To stay under it, read these on the token (or from the CurveLaunched event):
function protectionEndsAt() external view returns (uint256);
function maxWalletDuringProtection() external view returns (uint256);
function protectionActive() external view returns (bool);Sales are never capped. In the launch transaction itself, only the creator's own buy can take tokens off the curve.
Graduation and switching to Uniswap v4
When raised reaches target, the buy that reaches it graduates the token in the same transaction. The UniswapV4Locker creates the token's pool, puts the raised coins and the 200M reserved tokens in it at the curve's last price, and keeps the position in the PoolManager forever.
Detect it with any of:
- the
Graduatedevent on the DexCurveFactory, V4PositionLockedon the UniswapV4Locker (it carries the pool id),curve(token).graduated,graduated()on the token.
Then route trades to the token's Uniswap v4 pool. Its pool key:
struct PoolKey {
address currency0;
address currency1;
uint24 fee;
int24 tickSpacing;
address hooks;
}| Field | Value |
|---|---|
currency0 | address(0): the native coin (ETH, or BNB on BNB Smart Chain) |
currency1 | The token |
fee | 10000 (1%, static) |
tickSpacing | 200 |
hooks | The chain's UniswapV4Locker |
The locker answers it for you:
function poolKeyFor(address token) external view returns (PoolKey key);
function poolIdFor(address token) external view returns (bytes32);
function positionOf(address token) external view returns (uint256 positionId);- The pool id is the
idin the PoolManager'sInitializeandSwapevents and the key for Uniswap's StateView:getSlot0(poolId)returnssqrtPriceX96, which is √(tokens per ETH) × 2⁹⁶. The price in wei per whole token is 2¹⁹² × 10¹⁸ / sqrtPriceX96², rounded as you like. - Any Uniswap v4 router works. The hook has one permission,
beforeInitialize, and never runs on swaps or liquidity changes, so there is nothing launchtokens-specific after graduation. With the chain's Universal Router, swap with aV4_SWAPcommand on this pool key; quote with the V4 Quoter. Both addresses are on Contracts & security and in contracts.json.
Before graduation the pool can't exist and can't be fed: the token can't be sent to the PoolManager (it reverts with PoolClosedUntilGraduation()), and anyone else's attempt to create a pool with this hook reverts. Don't route pre-graduation trades to Uniswap.
Adding liquidity
Anyone can add liquidity to a graduated token's position. It is locked forever like the rest.
function addLiquidity(address token, uint256 tokenAmount, uint256 tokenMin, uint256 wethMin, uint256 deadline) external payable returns (uint128 liquidity, uint256 tokenUsed, uint256 wethUsed);Send the native coin as msg.value and approve tokenAmount of the token to the locker first (wethMin is the native-coin minimum). Whatever the pool doesn't take is refunded in the same call.
Events
The launch and trade events are on the DexCurveFactory. They are the same events, with the same topics, as on Robinhood Chain's earlier v3 CurveFactory, so one indexer handles both.
event CurveLaunched(address indexed token, address indexed creator, address indexed pool, LaunchInfo info);
struct LaunchInfo {
uint256 supply;
uint256 curveTokens;
uint256 poolTokens;
uint256 targetEth;
uint256 protectionEndsAt;
uint256 maxWalletDuringProtection;
uint256 devBuyEth;
uint256 devBuyTokens;
uint256 launchIndex;
}
event CurveMetadata(address indexed token, string name, string symbol, string metadataURI, bytes32 metadataHash, bytes32 salt);
event Trade(address indexed token, address indexed trader, bool indexed isBuy, uint256 ethAmount, uint256 tokenAmount, uint256 fee, uint256 raised, uint256 sold);
event Graduated(address indexed token, address indexed pool, uint256 indexed positionId, uint256 ethToPool, uint256 tokensToPool, uint128 liquidity, uint160 sqrtPriceX96, bool corrected, uint256 leftoverEth, uint256 leftoverTokens);On the UniswapV4Locker:
event V4PositionLocked(uint256 indexed positionId, address indexed token, bytes32 indexed poolId, int24 tickLower, int24 tickUpper, bytes32 salt);
event LiquidityAdded(uint256 indexed positionId, address indexed token, address indexed provider, uint128 liquidity, uint256 tokenAmount, uint256 wethAmount);| Event | Contract | topic0 |
|---|---|---|
CurveLaunched | DexCurveFactory | 0xdf1f4344a333daca2878035534a5faeb2e2a26c2257e590aab8f4e8bd984afd1 |
CurveMetadata | DexCurveFactory | 0x4ae8c32686d7d3a4ab7221910bc092d614741c0cd5192ce94c6bce78c51f23c2 |
Trade | DexCurveFactory | 0x2c76e7a47fd53e2854856ac3f0a5f3ee40d15cfaa82266357ea9779c486ab9c3 |
Graduated | DexCurveFactory | 0x94349f59d0fb50785232955ac77cd1f37fd5b243a8be8c2171c1cbde8a52d587 |
V4PositionLocked | UniswapV4Locker | 0xf2030ce6f8eb82b6084a7c83717d573e6d82a31890fc63b99a108dd7c742df46 |
LiquidityAdded | UniswapV4Locker | 0xe2ef86d93efd8a8bb6e817b3d2c79425f9d17a259a6a971c7671dc225ff414bb |
CurveLaunched is the new-token signal: the token, its creator, the address it is closed to until graduation (the PoolManager) and the launch numbers. targetEth is in the native coin. devBuyEth and devBuyTokens are the creator's launch buy (its Trade event comes first in the same transaction). launchIndex counts launches on this factory from 1.
CurveMetadata comes in the same transaction. For launches made on launchtokens.io, metadataURI is an https URL of a JSON document { "description", "image", "links": { "website", "x", "telegram" } } (any link may be missing), and metadataHash is the keccak256 of its exact bytes, so you can check you got the right file. Anyone can call the contract directly, so treat the URI and its contents as untrusted input.
Trade is every curve buy and sell.
isBuyistruefor buys.- Buy:
ethAmountis what the buyer paid, fee included, refund excluded. Sell:ethAmountis what the seller received, after the fee. feeis the 1% fee in wei.raisedandsoldare the curve's state after the trade.- The spot price after the trade, in wei per whole token, follows from
raisedalone (T= target in wei):price = 5e18 × (T + 3 × raised)² / (T × 16e27), rounded down. It equalscurve(token).price.
Graduated marks the move to Uniswap v4: pool is the PoolManager, positionId the locked position in the UniswapV4Locker, and ethToPool and tokensToPool what went into the pool. leftoverEth and leftoverTokens are rounding dust the position didn't take, with the coins sent to the treasury and the tokens burnt (sent to 0x…dEaD). corrected is for a pool that already existed at another price, which the hook rules out: expect false.
V4PositionLocked comes in the graduating transaction: the position ID, the token, its poolId and the range's ticks. A position with a second, one-sided range emits a second one with the same ID.
Errors
The ones a trader can hit:
error LaunchesPaused();
error Expired();
error UnknownToken(address token);
error AlreadyGraduated(address token);
error ZeroAmount();
error NothingBought();
error SlippageExceeded(uint256 amountOut, uint256 minAmountOut);
error ExceedsSold(uint256 amountIn, uint256 sold);
error HoldingCapExceeded(address account, uint256 balance);
error PoolClosedUntilGraduation();Example: quote and buy with viem
On Base; for another chain, swap the chain and the factory address from the table above.
import { createPublicClient, createWalletClient, http, parseAbi, parseEther } from 'viem';
import { base } from 'viem/chains';
import { privateKeyToAccount } from 'viem/accounts';
const FACTORY = '0x3980bEe77d4b0b70605E4Bf11027901cD9d7a412'; // DexCurveFactory on Base
const abi = parseAbi([
'function curve(address token) view returns ((address creator, uint256 raised, uint256 target, uint256 sold, uint256 curveTokens, bool graduated, address pool, uint256 positionId, uint256 launchedAt, uint256 price, uint256 marketCap) v)',
'function getBuyQuote(address token, uint256 ethIn) view returns (uint256 tokensOut, uint256 fee, uint256 ethUsed, uint256 refund, bool graduates)',
'function buy(address token, uint256 minTokensOut, uint256 deadline) payable returns (uint256 tokensOut)',
'event Trade(address indexed token, address indexed trader, bool indexed isBuy, uint256 ethAmount, uint256 tokenAmount, uint256 fee, uint256 raised, uint256 sold)',
]);
const client = createPublicClient({ chain: base, transport: http('https://mainnet.base.org') });
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const wallet = createWalletClient({ account, chain: base, transport: http('https://mainnet.base.org') });
const token = '0x…'; // the token to buy
// still on the curve?
const c = await client.readContract({ address: FACTORY, abi, functionName: 'curve', args: [token] });
if (c.graduated) throw new Error('graduated: trade on its Uniswap v4 pool (poolKeyFor on the UniswapV4Locker)');
// quote 0.01 ETH and accept up to 2% slippage
const ethIn = parseEther('0.01');
const [tokensOut, , , refund, graduates] = await client.readContract({
address: FACTORY, abi, functionName: 'getBuyQuote', args: [token, ethIn],
});
const minTokensOut = (tokensOut * 98n) / 100n;
const deadline = BigInt(Math.floor(Date.now() / 1000) + 60);
// simulate first: it surfaces HoldingCapExceeded, LaunchesPaused, SlippageExceeded… before you pay gas
const { request } = await client.simulateContract({
account, address: FACTORY, abi, functionName: 'buy', args: [token, minTokensOut, deadline], value: ethIn,
});
const hash = await wallet.writeContract(request);
await client.waitForTransactionReceipt({ hash });Example: read trades with viem
// past trades of one token (public RPCs limit block ranges: page through in chunks, e.g. 2,000 blocks)
const logs = await client.getContractEvents({
address: FACTORY, abi, eventName: 'Trade', args: { token },
fromBlock: 53282322n, toBlock: 53282322n + 2_000n,
});
for (const { args } of logs) {
console.log(args.isBuy ? 'buy' : 'sell', args.trader, args.ethAmount, args.tokenAmount, args.raised);
}
// live: every trade on every curve
const stop = client.watchContractEvent({
address: FACTORY, abi, eventName: 'Trade',
onLogs: (logs) => logs.forEach(({ args }) => console.log(args.token, args.isBuy, args.ethAmount)),
});Launch from code
function createToken(CreateParams p) external payable returns (address token, uint256 devBuyTokens);
struct CreateParams {
string name;
string symbol;
string metadataURI;
bytes32 metadataHash;
bytes32 salt;
uint256 minTokensOut;
}- Send the launch fee (
launchFee()) plus your launch buy asmsg.value. Below the fee it reverts withFeeTooLow; a launch buy that would graduate the token reverts withDevBuyWouldGraduate. minTokensOutis the launch buy's slippage guard.predictTokenAddress(creator, salt, name, symbol)gives the token's address before you send.- Or let
POST /api/v1/tx/launchbuild the transaction: see launchtokens.io/developers.
Other useful reads
function paused() external view returns (bool);
function launchCount() external view returns (uint256);
function target() external view returns (uint256);
function launchFee() external view returns (uint256);
function FEE_BPS() external view returns (uint256);
function GRADUATION_EXTRA_GAS() external view returns (uint256);
function locker() external view returns (address);
function creator() external view returns (address);
function pool() external view returns (address);
function graduated() external view returns (bool);
function launchedAt() external view returns (uint256);Every token has 18 decimals and a fixed supply of 1,000,000,000. It has no owner, no mint, no pause, no blacklist and no transfer tax.
Earlier curve sets
Robinhood Chain's tokens from before the current DexCurveFactory still trade on their own contracts. Same functions and events; index every factory if you want every token (contracts.json lists them under earlierCurveSets and uniswapV3Curve).
- The Uniswap v3 set (CurveFactory
0x51A8A9e0889dD7C2Dc5118828f2741F7F74FF843, from block 87628359, 5 ETH target). It takes no new launches or curve buys; its curves can still be sold into. Graduated tokens trade on their Uniswap v3 pool atcurve(token).pool: fee tier10000(1%), paired with WETH (0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73), the position locked forever in its LiquidityLocker. Its graduating buy needs up to 5,500,000 extra gas. - An earlier Uniswap v4 set (DexCurveFactory
0xf441853d4B849Fd7c112FA40561d70aE8906Fa7F, from block 89579410, 5 ETH target) works like the current one, with its own UniswapV4Locker as its pools' hook.
The addresses are on Contracts & security. Robinhood Chain Testnet has a few more earlier sets, listed there too.
Solana
Solana launches run on one program, launch_curve (mainnet-beta), built with Anchor's account and event layout:
| Address | |
|---|---|
| Program | 7AxEAL5aCUMiPN12Q7qx2ZLS7QWuVG8pqWNyKXj7qJAv |
Config (PDA ["config"]) | 7QvoBjcSsSdEUd2siGWxZtAHyB34q7e1znS9fxkw64D1 |
| Address lookup table (graduation) | EW2MJB9PqGB3GEr17PXVozJeHUJk96B38WWqoJeaBvaP |
- IDL: launch_curve.json (the Anchor IDL), readable from any origin. It lists every instruction, account, event and error, with their discriminators. Source: github.com/Launchtokens-io/launch-curve.
- Before graduation a token trades only on its curve, through
buyandsell. A curve completes at 85 SOL;graduatethen opens its Raydium CPMM pool (token/WSOL, 1% fee) andlock_liquidityputs the LP tokens in Raydium's lock forever. After graduation it trades only on that Raydium pool. - Is this a launchtokens token? It has a
Curveaccount at PDA["curve", mint]owned by the program. Its pool address is fixed from launch: PDA["pool", mint]of the program. - Quotes:
quote_buy(lamports_in)andquote_sell(tokens_in)are read-only instructions; run them withsimulateTransaction. They returnBuyQuote { tokens_out, fee, lamports_used, refund, completes }andSellQuote { lamports_out, fee }. The fee is 1% of every curve trade, included in the quote. - Amounts: SOL in lamports (9 decimals), tokens in base units (6 decimals). Every token has a fixed supply of 1,000,000,000 and no mint or freeze authority.
- Compute: add a ComputeBudget instruction.
buyuses about 90k compute units,sellabout 60k,launchabout 235k,graduateup to about 325k.
Solana events
Events are Anchor emit_cpi! events: self-CPI inner instructions to the program (not logs), so they survive log truncation. An event's instruction data is Anchor's event tag e4 45 a5 2e 51 cb 9a 1d, then the event's 8-byte discriminator (sha256("event:<Name>")[0..8], also in the IDL), then its Borsh fields. Accept one only when its first account is the event authority, PDA ["__event_authority"] of the program.
| Event | When |
|---|---|
CurveLaunched | A new token: mint, creator, curve, pool, supply, curve_tokens, pool_tokens, target, the protection window and the creator's launch buy |
CurveMetadata | Same transaction: name, symbol, uri and the metadata_hash of the JSON at uri (untrusted input) |
Trade | Every curve buy and sell: trader, is_buy, sol_amount (buy: charged, fee included; sell: received), token_amount, fee, and the curve's raised and sold after the trade |
Graduated | The Raydium pool opened: pool, lp_mint, sol_to_pool, tokens_to_pool, tokens_burned, lp_amount |
LiquidityLocked | The LP tokens are in Raydium's lock: fee_nft_mint, lp_amount |
PoolFeesCollected, CreatorFeesClaimed, TreasuryFeesClaimed | Fee collection and claims |
FeeRecipientProposed, FeeRecipientChanged | A creator moves where their fees go (two steps) |
Paused, PauserProposed, PauserTransferred, ConfigInitialized | The program's settings |
A token is "locked" once LiquidityLocked is seen. The site sends the completing buy, graduate and lock_liquidity in one transaction, but anyone can send the last two on their own.