Developers
Integrate cook4.fun in one fetch.
Every cook4.fun coin is a standard token live on Uniswap V4 from second zero. Read prices, route trades, index coins, or launch programmatically. Non-custodial โ signers always use their own wallet.
Chain, all contract addresses, and the full ABIs in one JSON, open CORS. Everything on this page, for your code.
curl -s https://cook4.fun/api/abi | jq .contractsRobinhood Chain ยท id 4663
Contracts
Create, buy, sell and read coins here.
The singleton every coin's pool lives in.
Guards pool creation only โ never runs on swaps.
Every coin is an EIP-1167 clone of this.
No wallet needed
Reading coins
getTokens(offset, limit) lists coins; getToken(address) returns one (name, symbol, socials, poolId, creator, โฆ). getPrice and getMCAP are live from the pool.
import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("https://rpc.mainnet.chain.robinhood.com"),
});
// price is ETH (wei) per whole token; mcap is fully-diluted, in ETH (wei)
const price = await client.readContract({
address: "0xcdC8D6C3DdA334730262Fd7D7f0Ee5E86bA4Ff47",
abi: launchpadAbi, // from /api/abi
functionName: "getPrice",
args: [tokenAddress],
});Slippage-protected
Trading
Buy sends ETH and returns tokens to the sender. Selling is two steps โ approve the launchpad (never anything else), then sell. Both take a slippage floor.
// Buy: send ETH, receive tokens. minOut is your slippage floor.
const hash = await wallet.writeContract({
address: "0xcdC8D6C3DdA334730262Fd7D7f0Ee5E86bA4Ff47",
abi: launchpadAbi,
functionName: "buy",
args: [tokenAddress, minOut],
value: parseEther("0.05"),
});// Sell is two steps: approve the LAUNCHPAD, then sell.
await wallet.writeContract({
address: tokenAddress, abi: erc20Abi, functionName: "approve",
args: ["0xcdC8D6C3DdA334730262Fd7D7f0Ee5E86bA4Ff47", amount],
});
await wallet.writeContract({
address: "0xcdC8D6C3DdA334730262Fd7D7f0Ee5E86bA4Ff47", abi: launchpadAbi, functionName: "sell",
args: [tokenAddress, amount, minEth], // minEth = slippage floor
});Optional
Launching a coin
createToken(name, symbol, description, image, twitter, telegram, website, distribute, firstBuy, metadataURI, salt, splits), payable with the 0.001 ETH fee (+ any first buy). The whole 1B supply is deployed as a single-sided Uniswap V4 position at launch.
salt is any bytes32 โ it fixes the coin's CREATE2 address, which you can grind for a c00c vanity suffix (the sender is mixed in, so nobody can front-run a ground one). splits optionally divides your creator fee among wallets. The exact derivation and field limits are in the agent guide.
Advanced
Trade directly on Uniswap V4
Prefer to route through Uniswap yourself? Every pool lives in the V4 singleton โ there is no per-pool address. Build the PoolKey and swap against the PoolManager. The hook only guards beforeInitialize, so it never interferes with swaps.
// Every coin trades in the V4 singleton. ETH is address(0), which
// sorts first, so ETH is always currency0 and the token currency1.
const poolKey = {
currency0: "0x0000000000000000000000000000000000000000", // ETH
currency1: tokenAddress,
fee: 10000, // 1%
tickSpacing: 200,
hooks: "0x4245822772d196A046Ac69Ed307551b3Bfb52000",
};
// getToken(token).poolId === keccak256(abi.encode(poolKey))
// The singleton emits Swap(bytes32 indexed id, ...) per trade.Open source
Ready-made tooling
Drop cook4.fun into any MCP-compatible agent: list, buy, sell, launch.
Give an ElizaOS agent the ability to trade and launch coins from chat.
Addresses + full ABIs, one fetch, open CORS. /api/abi
The full on-chain interface as plain text. /llms.txt
Building something on cook4.fun? Coins are permissionless and the interface is stable โ no keys, no allowlist, no approval needed.
How cook4.fun works โ