For apps, bots, wallets and AI agents

Build on wdyt

Put wdyt's launch markets in your app. Keep 0.25% of every trade you route, paid in SOL on the spot. No keys, no approval, one program.

Program
EPMG5kYwLHbearntvnARik8TR3dB9RNPakPuBmcBiV4a
One program for every launch.
For your AI
https://wdyt.fun/llms.txt

wdyt.fun is a permissionless Solana launchpad that replaces the bonding curve with a self-resolving prediction market. Every launch opens a market on one question (will this coin launch?) and both answers trade:

  • Yes (buy_yes) buys YES along a buy-only curve. It buys the coin before it exists: 1 YES becomes 1 coin if the launch succeeds.
  • No (buy_no) buys NO shares of a fund that is paid from both pots if the launch fails, priced at the fund's current value so buying late gives no edge.

The market resolves itself on-chain, with no oracle. If the YES pot reaches the threshold before the deadline, it resolves Yes: the coin graduates into a Meteora pool seeded by both sides, with the liquidity locked forever, and YES turns into the coin one for one; NO pays nothing. If time runs out first, it resolves No: NO holders get their SOL back plus a share of every YES buy after theirs, and YES holders get back the rest.

Any app, bot or wallet can list launches and route trades through one program. Name your own fee account on each trade and you keep 0.25% of every trade you route, paid in SOL in the same transaction. There is nothing to apply for and no API key.

At a glance

ProgramEPMG5kYwLHbearntvnARik8TR3dB9RNPakPuBmcBiV4a (mainnet)
SidesYes: YES tokens (buy_yes). No: NO shares (buy_no)
IDLhttps://wdyt.fun/idl/wdyt.json, Anchor spec 0.1.0
Read APIhttps://api.wdyt.fun/api/launches, JSON, CORS open
Your cut0.25% of every YES buy, NO buy and order-book fill that names your frontend account
TokensSPL Token (not Token-2022). YES and the coin have 6 decimals, NO shares 9
Coin metadataMetaplex Token Metadata on every coin, immutable, image and socials in the JSON
For AI agentshttps://wdyt.fun/llms.txt and https://wdyt.fun/llms-full.txt

How a launch works

  1. OPEN for the launch's window (params.window: 30 minutes in the option enabled today). buy_yes takes SOL and adds YES along a rising curve to the buyer's holding. buy_no takes SOL and adds NO shares priced at the fund's current value to it, once the YES pot holds no_unlock_bps of the threshold (30% by default); before that it fails with NoSideClosed. Nobody can sell back to the curve; early exits go through the order book. A private launch (launch.approver set) takes buys only from the wallets it approved, so the public buy instructions fail on it with PrivateLaunch; its order book is open to everyone.
  2. RESOLVED_YES the moment the YES pot reaches the threshold (75 SOL in the option enabled today). The buy that crosses it is filled up to the threshold and the rest of its SOL is refunded in the same transaction.
  3. LIVE once the graduation crank has created the Meteora DAMM v2 pool from the YES pot and the NO fund, less the No refund (no_refund_bps, 25% of the NO fund, kept for NO holders and paid by share), the migration fee and the launch fee (grad_fee_bps, 1% of the pool's SOL, to the treasury; the pool gets proportionally fewer coins, so the opening price is unchanged), with its liquidity locked forever. Every YES holder is paid the coin one for one, automatically: the keeper settles every holding and position right away, aiming to finish before pool trading opens claim_delay seconds later (default 60). From then on the coin trades wherever Meteora is routed: Jupiter, wallets, terminals.
  4. RESOLVED_NO if the deadline passes first. The resolve_no crank closes it, and every YES and NO holder is paid SOL automatically.

Holdings and positions: users never claim. A buy adds YES or NO to the buyer's holding, an account of this program at PDA ["holding", launch, owner] that records what they bought without minting it, so a buy writes no token account. Fills and bids put YES and NO in the user's position, a token account at PDA ["position", mint, owner] that the launch PDA controls, and realize mints one side of the holding into it. Once the launch resolves, the permissionless settle_position pays the owner for both (coins in LIVE, SOL in RESOLVED_NO) and closes them, returning their rent. Only the owner's own instructions can move tokens out of a position or realize a holding. Read balances with positionBalances in the SDK (totals, the part still held, and which accounts exist) or GET /api/positions/{wallet}. Aggregators that need the output in the user's own token account (Jupiter's AMM interface does) use buy_yes_to_wallet / buy_no_to_wallet; those wallet tokens settle by the holder's claim_tokens / claim_sol.

A creator opens a launch with create_launch, whose preset argument picks one of the config's launch options: 0 is 15 minutes and 10 SOL, 1 (recommended) 30 minutes and 75 SOL, 2 60 minutes and 40 SOL. Only option 1 is enabled today; picking a disabled option fails with PresetUnavailable. The launch copies that option's terms into its params, so always read a launch's own params rather than assuming one. /api/config lists the options with the ones currently enabled.

The cranks (resolve No, graduate, settle positions and open orders, pay creators, claim pool fees) are permissionless and our keeper runs all of them, so an integration only has to send user trades.

Earn fees

buy_yes, buy_no and fill_order take an optional frontend account. Put your fee wallet there.

  • The trade fee is fee_bps (default 1.25%): 0.70% protocol, 0.25% frontend, 0.30% creator. The creator's part is escrowed and paid only if the launch graduates.
  • Your share moves to your account in the same transaction, in SOL.
  • Leave frontend out and the protocol keeps that 0.25%.
  • The account must already exist with at least 0.00089088 SOL (rent-exempt). A funded wallet works. A brand-new empty address makes the trade fail.

Read launches

The read API mirrors the chain and adds images, socials and history. Amounts are strings in lamports or token base units.

endpointreturns
GET https://api.wdyt.fun/api/launchesevery launch, newest first: state, progress, YES and NO prices, deadline, image, mint addresses
GET https://api.wdyt.fun/api/launches/{address or id}one launch with its open orders
GET https://api.wdyt.fun/api/launches/{address or id}/serieschart points: progress, YES price and NO price after each trade
GET https://api.wdyt.fun/api/launches/{address or id}/activitythe latest 100 trades, fills and payouts
GET https://api.wdyt.fun/api/positions/{wallet}a wallet's YES and NO (in its positions and in the wallet), coins, what is being paid automatically and what the wallet itself must claim
GET https://api.wdyt.fun/api/configtreasury, rewards wallet, pause flag and the launch options for new launches (presets, presetsEnabled bitmask, recommended index)
GET https://api.wdyt.fun/api/rewards/summaryholder rewards: the rules, totals paid, the rewards wallet and the biggest vaults
GET https://api.wdyt.fun/api/rewards/coins/{address or id}a coin's holder vault: balance, next milestone, weekly release time, unlocks and accruals
GET https://api.wdyt.fun/api/rewards/wallets/{wallet}a wallet's rewards: streak and multiplier on each coin, earned, paid and owed, payouts
GET https://api.wdyt.fun/api/rewards/unlocks/{id}one unlock with every recipient's balance, streak, multipliers, weight and amount
GET https://api.wdyt.fun/api/rewards/coins/{address or id}/unlocks, .../accruals, GET https://api.wdyt.fun/api/rewards/wallets/{wallet}/payoutsthe full histories, newest first, up to 100 a page (limit); pass a page's next as before for the one after

Or read the chain directly. Launches are Launch accounts at PDA ["launch", id as u64 little-endian]; decode them with the IDL. For live updates, subscribe to the program's logs for new signatures and read each transaction: its Anchor events (YesBought, NoBought, OrderFilled, Migrated, LaunchResolvedNo and the rest below) are not in the logs but in its inner instructions (see Events below); WdytClient.eventsFromTransaction decodes them.

Set up a client

import { AnchorProvider, Program } from "@anchor-lang/core"; // or @coral-xyz/anchor 0.30+
import BN from "bn.js";
import { Connection, PublicKey, Transaction } from "@solana/web3.js";

const idl = await (await fetch("https://wdyt.fun/idl/wdyt.json")).json();
const connection = new Connection(RPC_URL, "confirmed");
const provider = new AnchorProvider(connection, wallet, { commitment: "confirmed" });
const program = new Program(idl, provider);

const [configPda] = PublicKey.findProgramAddressSync([Buffer.from("config")], program.programId);
const { treasury } = await program.account.config.fetch(configPda);

Quote

Quotes are integer math on the Launch account and match the program to the lamport. All amounts are lamports or base units, and division rounds down unless it says ceil.

const BPS = 10_000n;
const SHARE_UNIT = 1_000_000_000n;
const ceilDiv = (a: bigint, b: bigint) => (a === 0n ? 0n : (a - 1n) / b + 1n);
const big = (x: { toString(): string }) => BigInt(x.toString()); // Anchor returns BN

/** YES out for `spend` lamports. `charged` is what the buyer pays; the rest is refunded. */
function quoteYes(l: any, spend: bigint) {
  const p = l.params;
  let fee = ceilDiv(spend * big(p.feeBps), BPS);
  let net = spend - fee;
  const room = big(p.threshold) - big(l.rYes);
  if (net > room) {
    // this buy completes the launch
    net = room;
    fee = ceilDiv(net * big(p.feeBps), BPS - big(p.feeBps));
  }
  const newVt = ceilDiv(big(l.k), big(l.vs) + net);
  return { yesOut: big(l.vt) - newVt, charged: net + fee, fee, graduates: net === room };
}

/** NO shares for `spend` lamports at unix time `now`. */
function quoteNo(l: any, spend: bigint, now: bigint) {
  const p = l.params;
  const fee = ceilDiv(spend * big(p.feeBps), BPS);
  const net = spend - fee;
  if (big(l.rYes) * BPS < big(p.threshold) * big(p.noUnlockBps)) throw new Error("NoSideClosed: the No side is not open yet");
  let t = now - big(l.openTs);
  if (t < 0n) t = 0n;
  if (t > big(p.window)) t = big(p.window);
  const bondAccrued = (big(p.bond) * t) / big(p.window);
  const v0 = (big(p.s0) * big(p.pMin)) / SHARE_UNIT;
  const value = big(l.rYes) + big(l.rNo) + bondAccrued + v0;
  return { shares: (net * (big(p.s0) + big(l.sNo))) / value, fee };
}

/** SOL paid by claim_sol for `f` NO shares and `a` YES once a launch has RESOLVED_NO. */
function payoutIfNo(l: any, f: bigint, a: bigint) {
  const p = l.params;
  const v0 = (big(p.s0) * big(p.pMin)) / SHARE_UNIT;
  let out = (f * (big(l.rYes) + big(l.rNo) + big(p.bond) + v0)) / (big(p.s0) + big(l.sNo));
  if (a > 0n && big(l.sold) > 0n) out += (big(l.s0YesGain) * a) / big(l.sold);
  return out;
}

A NO buy fails with NoSideClosed until rYes * 10000 >= threshold * noUnlockBps (the quote throws; show when No opens instead). If params.kNoBps is above zero, a NO buy fails when rNo + net would exceed (threshold - rYes) * kNoBps / 10000. Protect users with min_out / min_shares: the program rejects a trade that would deliver less with Slippage.

Trade

const launch = new PublicKey(address); // from /api/launches
const l = await program.account.launch.fetch(launch);
const spend = 500_000_000n; // 0.5 SOL
const { yesOut } = quoteYes(l, spend);
const minOut = (yesOut * 99n) / 100n; // 1% slippage

const ix = await program.methods
  .buyYes(new BN(spend.toString()), new BN(minOut.toString()))
  .accountsPartial({ buyer: wallet.publicKey, launch, frontend: YOUR_FEE_WALLET })
  .instruction();
await provider.sendAndConfirm(new Transaction().add(ix));

Anchor derives the other accounts (the vault, and the buyer's holding, which the first buy creates) from the IDL. A NO buy is the same call with buyNo(spend, minShares). Pass frontend: null to route without a fee account.

Exit early: the order book

While a market is open, holders can trade YES (Yes) and NO (No) with each other. The book trades between positions: an ask comes out of the maker's position, a bid's tokens land in it, and a taker buys into or sells from their own. What a user bought waits in their holding until realize mints it into their position, so an ask or a sale into a bid of bought shares sends realize first, in the same transaction.

  • place_order(token, side, price, size): token 0 = YES, 1 = NO; side 0 = ask (sell), 1 = bid (buy); price in lamports per whole token (10^6 base units of YES, 10^9 of NO); size in base units. Asks escrow the tokens, bids escrow ceil(size * price / unit) lamports. The notional must be at least params.min_order (default 0.01 SOL).
  • fill_order(qty): any qty from 1 base unit up to the order's left. The taker pays the maker ceil(qty * price / unit) for an ask, or receives floor(qty * price / unit) from a bid, plus or minus the trade fee (rounded up), split the same way as buys (including your frontend cut). A fill whose SOL rounds to zero, or a bid fill worth no more than its fee, is rejected. Makers pay no fee. Filling your own order is rejected.
  • cancel_order(): maker only, while the market is open. Once it resolves, the keeper settles every open order with close_expired: a bid gets its SOL back, an ask's tokens are paid out like a position.
  • realize(token): while the market is open, mints all of the signer's held YES (token 0) or NO (1) into their position, creating it if needed (the owner pays its rent, returned when it settles). Fails with NothingHeld when that side of the holding is empty.
  • deposit(token, amount) / withdraw(token, amount): while the market is open, move YES or NO between the user's own token account and their position. Wallet tokens must be deposited to trade on the book, and held shares realized to trade or withdraw them.

Orders live at PDA ["order", launch, id as u64 little-endian]. List them from GET /api/launches/{address} or with getProgramAccounts on the Order account filtered by the launch at offset 8.

Settlement

Every payout below is pushed by our keeper; each instruction is permissionless, so anyone can send it sooner. Only wallet tokens need their holder.

stateinstructioncallerpays
LIVEsettle_positionanyonethe owner's YES, in their positions and holding, in coins, one for one; their NO its share of the No refund (no_refund * shares / s_no); rent back
RESOLVED_NOsettle_positionanyoneSOL for the owner's YES and NO, in their positions and holding (payoutIfNo above); rent back
after resolutionclose_expiredanyonean order's escrow to its maker: SOL back for a bid; for an ask, coins (YES) or the No refund (NO) once LIVE, SOL in RESOLVED_NO. Asks wait for LIVE after a Yes resolution
RESOLVED_YES or LIVEclaim_creatoranyoneescrowed creator fees plus the full bond, to the creator; with a fee split the fees go to the split and only the bond to the creator
RESOLVED_NOclaim_creatoranyonethe part of the bond that accrued to the starting share, to the creator
LIVEclaim_tokensthe holderwallet YES (from a _to_wallet buy or a withdrawal) for the coin
RESOLVED_NOclaim_solthe holderwallet YES and NO for SOL
LIVEclaim_solthe holderwallet NO for its share of the No refund (wallet YES is left for claim_tokens)

After graduation

The coin is a normal SPL token with Metaplex metadata, trading in a Meteora DAMM v2 pool whose position is locked forever and whose fees are paid in SOL (split by claim_pool_fees between the creator, or the creator's fee split, the coin's holders through the rewards wallet, and the protocol). Its total supply is sold + pool_tok: graduation mints coins to match No-side SOL, or burns unsold reserve when the launch fee is larger than the matched share, and then revokes the mint authority. The Migrated event reports minted, burned and launch_fee. Jupiter routes Meteora DAMM v2 automatically, so any app that swaps through Jupiter can trade graduated coins with no extra work.

Cranks

instructionwheneffect
resolve_noOPEN and past the deadlinemarks the launch RESOLVED_NO and moves the creator's escrowed fees to the treasury
prepare_migration then migrateRESOLVED_YEScreates and locks the Meteora pool; send both in one transaction with a fresh keypair signing as position_nft_mint and a compute limit near 1,000,000 units
settle_positionLIVE or RESOLVED_NOpays one owner for their positions and holding and closes them; it reads every account it is given, so pass each position and the holding only if it exists (null otherwise)
close_expiredany state after OPEN (YES asks wait for LIVE)settles one order for its maker
claim_creatorany state after OPENpays the creator what they are owed
claim_pool_feesLIVEpays accrued pool fees to the creator (or the creator's fee split), the rewards wallet for the coin's holders, and the treasury
distribute_creator_feesa fee split holds feespays the split's recipients; pass them in order as remaining accounts

All are permissionless and idempotent. Our keeper runs them within seconds; you never need to.

Creator fee splits and community takeovers

A coin's metadata never changes. Its creator fees can: the creator may split them across up to 10 wallets, once (create_fee_shares, then update_fee_shares), and in a community takeover approved by the team, config.takeover_authority hands a live coin's creator fees to a new lead with set_fee_admin, after which the lead may split them once. Coins without a split pay their creator exactly as above. Instructions that pay a split (update_fee_shares, set_fee_admin, distribute_creator_fees) take its current recipients, in order and writable, as remaining accounts. FeeSharesChanged reports every change (takeover is set for takeovers) and CreatorFeesDistributed every payout.

Full reference: every instruction, account, event and error

Reference

Generated from the program's IDL. Anchor clients take instruction and field names in camelCase.

Instructions for integrations

buy_yes(spend: u64, min_out: u64)

Anchor client: program.methods.buyYes(spend, minOut)

accountaccessaddress
buyermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
holdingmutPDA ["holding", launch, buyer]
frontendmut, optionalyour fee wallet, or null
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

buy_no(spend: u64, min_shares: u64)

Anchor client: program.methods.buyNo(spend, minShares)

accountaccessaddress
buyermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
holdingmutPDA ["holding", launch, buyer]
frontendmut, optionalyour fee wallet, or null
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

buy_yes_to_wallet(spend: u64, min_out: u64)

Anchor client: program.methods.buyYesToWallet(spend, minOut)

accountaccessaddress
buyermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
yes_mintmutPDA ["yes", launch]
buyer_yesmutassociated token account of [buyer, SPL Token program id, yes_mint]
frontendmut, optionalyour fee wallet, or null
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

buy_no_to_wallet(spend: u64, min_shares: u64)

Anchor client: program.methods.buyNoToWallet(spend, minShares)

accountaccessaddress
buyermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
no_mintmutPDA ["no", launch]
buyer_nomutassociated token account of [buyer, SPL Token program id, no_mint]
frontendmut, optionalyour fee wallet, or null
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

place_order(token: u8, side: u8, price: u64, size: u64, nonce: u64)

Anchor client: program.methods.placeOrder(token, side, price, size, nonce)

accountaccessaddress
makermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
ordermutPDA ["order", launch, maker, arg nonce]
mintreadthe launch's YES mint (token 0) or NO mint (token 1)
maker_tokenmutPDA ["position", mint, maker]
book_vaultmutPDA ["book", launch, mint]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

fill_order(qty: u64, side: u8, price: u64)

Anchor client: program.methods.fillOrder(qty, side, price)

accountaccessaddress
takermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
ordermutPDA ["order", launch, order.maker, order.nonce]
makermutorder.maker
maker_tokenmutorder.maker_token
mintreadthe order's mint (maker_token.mint)
taker_tokenmutPDA ["position", mint, taker]
book_vaultmutPDA ["book", launch, mint]
frontendmut, optionalyour fee wallet, or null
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

cancel_order(side: u8, price: u64, size: u64)

Anchor client: program.methods.cancelOrder(side, price, size)

accountaccessaddress
makermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
ordermutPDA ["order", launch, maker, order.nonce]
maker_tokenmutorder.maker_token
book_vaultmutPDA ["book", launch, maker_token.mint]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

realize(token: u8)

Anchor client: program.methods.realize(token)

accountaccessaddress
ownermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
holdingmutPDA ["holding", launch, owner]
mintmutthe launch's YES mint (token 0) or NO mint (token 1)
positionmutPDA ["position", mint, owner]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

deposit(token: u8, amount: u64)

Anchor client: program.methods.deposit(token, amount)

accountaccessaddress
ownermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
mintreadcaller supplies
frommutthe owner's own token account for the mint
positionmutPDA ["position", mint, owner]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

withdraw(token: u8, amount: u64)

Anchor client: program.methods.withdraw(token, amount)

accountaccessaddress
ownermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
mintreadcaller supplies
positionmutPDA ["position", mint, owner]
tomutassociated token account of [owner, SPL Token program id, mint]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

claim_tokens()

Anchor client: program.methods.claimTokens()

accountaccessaddress
usermut, signerthe signing wallet
launchreadPDA ["launch", launch.meme_mint]
yes_mintmutPDA ["yes", launch]
meme_mintreadlaunch.meme_mint, the coin mint the launch recorded at creation
user_yesmutthe caller's own YES token account (wallet tokens, not a position)
user_mememutassociated token account of [user, SPL Token program id, meme_mint]
meme_escrowmutPDA ["meme_escrow", launch]
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

claim_sol()

Anchor client: program.methods.claimSol()

accountaccessaddress
usermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
yes_mintmutPDA ["yes", launch]
no_mintmutPDA ["no", launch]
user_yesmut, optionalthe caller's own YES token account, or null
user_nomut, optionalthe caller's own NO token account, or null
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

create_launch(name: string, ticker: string, uri: string, preset: u8)

Anchor client: program.methods.createLaunch(name, ticker, uri, preset)

accountaccessaddress
creatormut, signerthe signing wallet
configreadPDA ["config"]
meme_mintmut, signerlaunch.meme_mint, the coin mint the launch recorded at creation
launchmutPDA ["launch", meme_mint]
vaultmutPDA ["vault", launch]
yes_mintmutPDA ["yes", launch]
no_mintmutPDA ["no", launch]
meme_escrowmutPDA ["meme_escrow", launch]
meme_metadatamutPDA ["metadata", Token Metadata program id, meme_mint] under the Metaplex Token Metadata program
token_metadata_programreadfixed: metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s (Metaplex Token Metadata program)
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

Cranks

resolve_no()

Anchor client: program.methods.resolveNo()

accountaccessaddress
configreadPDA ["config"]
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
treasurymutconfig.treasury (from the Config account or /api/config)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

prepare_migration()

Anchor client: program.methods.prepareMigration()

accountaccessaddress
payermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
migratormutPDA ["migrator", launch]
meme_mintreadlaunch.meme_mint, the coin mint the launch recorded at creation
wsol_mintreadfixed: So11111111111111111111111111111111111111112 (wrapped SOL mint)
migrator_mememutassociated token account of migrator for the coin mint
migrator_wsolmutassociated token account of migrator for wrapped SOL
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

migrate()

Anchor client: program.methods.migrate()

accountaccessaddress
payermut, signerthe signing wallet
configreadPDA ["config"]
launchmutPDA ["launch", launch.meme_mint]
migratormutPDA ["migrator", launch]
meme_mintmutlaunch.meme_mint, the coin mint the launch recorded at creation
wsol_mintreadfixed: So11111111111111111111111111111111111111112 (wrapped SOL mint)
meme_escrowmutPDA ["meme_escrow", launch]
migrator_mememutassociated token account of migrator for the coin mint
migrator_wsolmutassociated token account of migrator for wrapped SOL
treasurymutconfig.treasury (from the Config account or /api/config)
position_nft_mintmut, signera fresh keypair, signing
position_nft_accountmutPDA ["position_nft_account", position_nft_mint] under the Meteora DAMM v2 program
poolmutPDA ["cpool", larger of (coin mint, wrapped SOL mint), smaller of the two] under the Meteora DAMM v2 program
positionmutPDA ["position", position_nft_mint] under the Meteora DAMM v2 program
token_a_vaultmutPDA ["token_vault", coin mint, pool] under the Meteora DAMM v2 program
token_b_vaultmutPDA ["token_vault", wrapped SOL mint, pool] under the Meteora DAMM v2 program
damm_pool_authorityreadfixed: HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC (Meteora DAMM v2 pool authority)
damm_event_authorityreadPDA ["__event_authority"] under the Meteora DAMM v2 program
amm_programreadfixed: cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG (Meteora DAMM v2 program)
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
token_2022_programreadfixed: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb (Token-2022 program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

settle_position()

Anchor client: program.methods.settlePosition()

accountaccessaddress
payermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
ownermutthe owner (any wallet with a position or a holding in this launch)
yes_mintmutPDA ["yes", launch]
no_mintmutPDA ["no", launch]
yes_positionmut, optionalPDA ["position", yes_mint, owner]
no_positionmut, optionalPDA ["position", no_mint, owner]
holdingmut, optionalPDA ["holding", launch, owner]
meme_mintreadlaunch.meme_mint, the coin mint the launch recorded at creation
meme_escrowmutPDA ["meme_escrow", launch]
owner_mememutassociated token account of owner for the coin mint (created by the call if needed)
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

close_expired()

Anchor client: program.methods.closeExpired()

accountaccessaddress
payermut, signerthe signing wallet
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
ordermutPDA ["order", launch, maker, order.nonce]
makermutorder.maker
mintmutthe order's mint
book_vaultmutPDA ["book", launch, mint]
meme_mintreadlaunch.meme_mint, the coin mint the launch recorded at creation
meme_escrowmutPDA ["meme_escrow", launch]
maker_mememutassociated token account of order.maker for the coin mint (created by the call if needed)
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
associated_token_programreadfixed: ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL (Associated Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

claim_creator()

Anchor client: program.methods.claimCreator()

accountaccessaddress
creatormutlaunch.creator (paid; not a signer)
launchmutPDA ["launch", launch.meme_mint]
vaultmutPDA ["vault", launch]
fee_sharesmutPDA ["fee_shares", launch]
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

claim_pool_fees()

Anchor client: program.methods.claimPoolFees()

accountaccessaddress
payermut, signerthe signing wallet
configreadPDA ["config"]
launchreadPDA ["launch", launch.meme_mint]
migratormutPDA ["migrator", launch]
meme_mintreadlaunch.meme_mint, the coin mint the launch recorded at creation
wsol_mintreadfixed: So11111111111111111111111111111111111111112 (wrapped SOL mint)
migrator_mememutassociated token account of migrator for the coin mint
migrator_wsolmutassociated token account of migrator for wrapped SOL
creatormutlaunch.creator
fee_sharesmutPDA ["fee_shares", launch]
treasurymutconfig.treasury (from the Config account or /api/config)
rewards_walletmutconfig.rewards_wallet (from the Config account or /api/config, rewardsWallet)
poolreadlaunch.pool
positionmutPDA ["position", launch.position_nft] under the Meteora DAMM v2 program
position_nft_accountreadPDA ["position_nft_account", launch.position_nft] under the Meteora DAMM v2 program
token_a_vaultmutPDA ["token_vault", coin mint, pool] under the Meteora DAMM v2 program
token_b_vaultmutPDA ["token_vault", wrapped SOL mint, pool] under the Meteora DAMM v2 program
damm_pool_authorityreadfixed: HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC (Meteora DAMM v2 pool authority)
damm_event_authorityreadPDA ["__event_authority"] under the Meteora DAMM v2 program
amm_programreadfixed: cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG (Meteora DAMM v2 program)
token_programreadfixed: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (SPL Token program)
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

distribute_creator_fees()

Anchor client: program.methods.distributeCreatorFees()

accountaccessaddress
fee_sharesmutPDA ["fee_shares", fee_shares.launch]
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

Creator fee splits

create_fee_shares()

Anchor client: program.methods.createFeeShares()

accountaccessaddress
payermut, signerthe launch's creator, or config.takeover_authority; pays the account's rent (about 0.0044 SOL)
configreadPDA ["config"]
launchreadPDA ["launch", launch.meme_mint]
fee_sharesmutPDA ["fee_shares", launch]
system_programreadfixed: 11111111111111111111111111111111 (System program)
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

update_fee_shares(shares: Vec<ShareArg>)

Anchor client: program.methods.updateFeeShares(shares)

accountaccessaddress
adminsignerfee_shares.admin: the creator, or after a takeover the new lead
launchreadPDA ["launch", launch.meme_mint]
fee_sharesmutPDA ["fee_shares", launch]
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

set_fee_admin(new_admin: pubkey)

Anchor client: program.methods.setFeeAdmin(newAdmin)

accountaccessaddress
authoritysignerconfig.takeover_authority
configreadPDA ["config"]
launchreadPDA ["launch", launch.meme_mint]
fee_sharesmutPDA ["fee_shares", launch]
event_authorityreadPDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events
programreadthis program's id

Accounts

Launch

fieldtypemeaning
sequ64
creatorpubkey
stateu80 OPEN, 1 RESOLVED_YES, 2 LIVE, 3 RESOLVED_NO
namestring
tickerstring
uristring
paramsLaunchParamsterms copied at creation from the launch option the creator picked; later config changes never touch this launch
open_tsi64unix seconds; trading opens then (a private launch may open after it was created)
deadlinei64unix seconds; trading stops at this time
vsu64YES curve virtual SOL reserve (lamports)
vtu64YES curve virtual token reserve (base units)
ku128vs * vt at creation
soldu64YES sold so far (base units): minted, or held in buyers' holdings
r_yesu64SOL in the YES pot; the launch graduates when this reaches params.threshold
r_nou64SOL in the NO fund
s_nou64NO shares outstanding (9 decimals): minted, or held in buyers' holdings
creator_escrowu64creator's fee share, paid only if the launch graduates
protocol_escrowu64
last_bondu64
s0_yes_gainu64SOL owed to YES holders if the market resolves No
s0_bond_gainu64
paid_outu64
bond_donebool
s0_claimedbool
migration_preparedbool
resolved_yes_tsi64
live_tsi64graduation time; pool trading opens at live_ts + params.claim_delay
poolpubkeyMeteora pool address once LIVE
position_nftpubkey
pool_solu64SOL the pool opened with: both pots less params.mig_fee, launch_fee and no_refund
pool_toku64coin the pool opened with (base units); total supply after graduation is sold + pool_tok
bumpu8
vault_bumpu8
launch_feeu64SOL paid to the treasury at graduation (params.grad_fee_bps of the pool's SOL before the fee)
no_refundu64No-side SOL kept in the vault at graduation for No holders (params.no_refund_bps of r_no); each NO share gets no_refund / s_no
meme_mintpubkeythe coin mint, at PDA ["meme", creator, mint_salt as u64 little-endian]: the creator picks the address with create_launch's mint_salt (POST /api/vanity with { creator } finds one ending in "wdyt")
approverpubkeyprivate launches only (SPEC 3.2): while open, only the wallets it approved buy, each within its limit, through buy_yes_private / buy_no_private; the public buy instructions fail with PrivateLaunch. The default key for a public launch

LaunchParams

fieldtypemeaning
thresholdu64SOL the YES pot must reach to graduate (75 SOL in the option enabled today)
windowi64seconds the market stays open (1800 in the option enabled today)
bondu64creator bond in lamports (default 0.1 SOL)
s0u64YES holders' starting share of the NO fund (in shares; 2.8125 in the option enabled today)
p_minu64price used to value the starting share
mig_feeu64lamports kept from the YES pot to pay for graduation
claim_delayi64seconds between pool creation and pool trading
min_orderu64smallest order-book notional in lamports (default 0.01 SOL)
k_no_bpsu32NO fund cap as bps of the remaining YES room; 0 = no cap
fee_bpsu16trade fee (default 125 = 1.25%)
frontend_bpsu16frontend share of fee_bps (default 25 = 0.25% of the trade)
creator_bpsu16creator share of fee_bps (default 30 = 0.30% of the trade)
supplyu64coin supply before graduation (base units, 6 decimals)
curve_toku64coin sold along the YES curve
vs0u64initial virtual SOL reserve
vt0u64initial virtual token reserve
pool_fee_bpsu16the locked Meteora pool's swap fee (default 125 = 1.25%; Meteora keeps a fifth)
creator_pool_share_bpsu16creator's share of the locked position's fees (default 6400 = 64%, 0.64% of every trade)
holder_pool_share_bpsu16the coin's holders' share of the locked position's fees (default 2000 = 20%, 0.2% of every trade), paid to config.rewards_wallet, from which the keeper pays holders; coins with a share above zero are in the holder rewards program
boost_bpsu16share of the NO fund that lifts the opening price at graduation
no_unlock_bpsu16the No side opens once r_yes * 10000 >= threshold * no_unlock_bps (default 3000, 30% of the target); until then NO buys fail with NoSideClosed; 0 = open from the start
grad_fee_bpsu16launch fee: share of the pool's SOL paid to the treasury at graduation (default 100 = 1%); the pool's coins shrink in step, so the opening price is unchanged
no_refund_bpsu16share of No-side SOL returned to No holders, split by NO shares, if the coin launches (default 2500 = 25%); the pool gets the rest

Holding

fieldtypemeaning
launchpubkey
ownerpubkey
yesu64YES bought and not minted (base units); realize mints it into the owner's position
nou64NO shares bought and not minted (9 decimals); realize mints them into the owner's position
bumpu8
_reserved[u8; 76]pads the account to a token account's 165 bytes, so its rent equals a coin account's

Order

fieldtypemeaning
launchpubkey
nonceu64
makerpubkey
maker_tokenpubkey
tokenu8
sideu8
priceu64
sizeu64
leftu64
solu64
bumpu8
_reserved[u8; 18]

Config

fieldtypemeaning
adminpubkey
treasurypubkey
rewards_walletpubkeyreceives the holders' share of every claim_pool_fees; the keeper pays the coin's holders from it
takeover_authoritypubkeyexecutes approved community takeovers with set_fee_admin
presets[LaunchParams; 3]the launch options; create_launch's preset is an index into this list
presets_enabledu8bit i set: option i can be picked; others fail with PresetUnavailable
pausedboolblocks new launches only; trading, settlement and claims continue
bumpu8

FeeShares

fieldtypemeaning
launchpubkey
adminpubkeymay set the split, once: the creator, or after a community takeover the new lead
lockedboolthe split has been set and cannot change again, except by a takeover
pendingu64creator fees received and not yet paid out (lamports)
sharesVec<FeeShare>up to 10 recipients; bps sum to 10,000; owed is due to a recipient that cannot receive yet (a wallet that does not exist, below the rent minimum)
bumpu8

Events

Emitted as self-CPIs (Anchor emit_cpi!): inner instructions to this program, signed by its event authority (PDA ["__event_authority"]), whose data is Anchor's 8-byte event tag e4 45 a5 2e 51 cb 9a 1d followed by the event (its 8-byte discriminator, then Borsh). Unlike logs, which the runtime cuts at 10 KB, they cannot be lost, and nothing but the program can produce one.

ApprovalClosed

fieldtypemeaning
launchpubkey
walletpubkey
spentu64

CreatorClaimed

fieldtypemeaning
launchpubkey
amountu64
to_sharesu64
stateMarketState

CreatorFeesDistributed

fieldtypemeaning
launchpubkey
recipientsVec<pubkey>
paidVec<u64>
owedVec<u64>

Deposited

fieldtypemeaning
launchpubkey
ownerpubkey
tokenu8
amountu64

FeeSharesChanged

fieldtypemeaning
launchpubkey
bypubkey
adminpubkey
recipientsVec<pubkey>
bpsVec<u16>
lockedbool
takeoverbool

LaunchCreated

fieldtypemeaning
launchpubkey
meme_mintpubkey
creatorpubkey
namestring
tickerstring
uristring
paramsLaunchParams
presetu8
stateMarketState

LaunchMadePrivate

fieldtypemeaning
launchpubkey
approverpubkey
opens_ati64
deadlinei64
stateMarketState

LaunchResolvedNo

fieldtypemeaning
launchpubkey
r_yesu64
r_nou64
s_nou64
stateMarketState

Migrated

fieldtypemeaning
launchpubkey
poolpubkey
pool_solu64
pool_toku64
mintedu64
burnedu64
launch_feeu64
no_refundu64
liquidityu128
sqrt_priceu128
trading_opensi64
stateMarketState

MigrationPrepared

fieldtypemeaning
launchpubkey
stateMarketState

NoBought

fieldtypemeaning
launchpubkey
buyerpubkey
spendu64
feeu64
netu64
sharesu64
to_walletbool
stateMarketState

OrderClosed

fieldtypemeaning
launchpubkey
orderpubkey
nonceu64
expiredbool
burnedu64
coins_outu64
sol_outu64
stateOption<MarketState>

OrderFilled

fieldtypemeaning
launchpubkey
orderpubkey
nonceu64
takerpubkey
qtyu64
notionalu64
feeu64
leftu64
solu64
donebool
stateMarketState

OrderPlaced

fieldtypemeaning
launchpubkey
orderpubkey
nonceu64
makerpubkey
tokenu8
sideu8
priceu64
sizeu64
solu64

PoolFeesClaimed

fieldtypemeaning
launchpubkey
feesu64
creator_shareu64
holder_shareu64

PositionSettled

fieldtypemeaning
launchpubkey
ownerpubkey
accountsu8
yes_burnedu64
no_burnedu64
yes_heldu64
no_heldu64
coins_outu64
sol_outu64
rent_to_callerbool
stateMarketState

PositionsSettled

fieldtypemeaning
launchpubkey
resultsVec<OwnerSettlement>
stateMarketState

Realized

fieldtypemeaning
launchpubkey
ownerpubkey
tokenu8
amountu64

SolClaimed

fieldtypemeaning
launchpubkey
userpubkey
no_burnedu64
yes_burnedu64
sol_outu64
stateMarketState

TokensClaimed

fieldtypemeaning
launchpubkey
userpubkey
amountu64

WalletApproved

fieldtypemeaning
launchpubkey
walletpubkey
limitu64
spentu64

Withdrawn

fieldtypemeaning
launchpubkey
ownerpubkey
tokenu8
amountu64

YesBought

fieldtypemeaning
launchpubkey
buyerpubkey
chargedu64
feeu64
netu64
yes_outu64
to_walletbool
stateMarketState

Errors

codenamemessage
6000ClosedLaunch is not open for trading
6001NotExpiredLaunch deadline has not passed
6002WrongStateWrong launch state for this action
6003DustAmount too small
6004SlippageSlippage limit exceeded
6005NoSideFullThe No side is full for this launch
6006MathOverflowMath overflow
6007InvalidParamInvalid parameter
6008PausedLaunch creation is paused
6009InvalidMetadataName, ticker or URI invalid
6010BelowMinimumOrder below minimum notional
6011BadFillBad fill size
6012NotMakerNot the order maker
6013WrongMintWrong mint for this order book
6014NothingToClaimNothing to claim
6015InsolventPayouts would exceed pots plus bond
6016SelfFillMaker cannot fill their own order
6017WrongPoolPool accounts do not match this launch
6018UnauthorizedOnly the program's upgrade authority can do this
6019PresetUnavailableThat launch option isn't available
6020WrongAccountAccount does not match its derived address
6021NoSideClosedThe No side opens once Yes reaches its unlock
6022NotFeeAdminOnly the creator, the fee admin or the takeover authority can do this
6023InvalidSharesA fee split needs 1 to 10 different recipients whose shares add up to 100%
6024SharesLockedThe fee split can only be set once
6025WrongRecipientsRecipients must be the current fee shares, in order
6026CreatorUnpaidPay the creator's escrow and bond first
6027PrivateLaunchOnly wallets this launch approved can buy it
6028OverLimitThis buy would go past the wallet's limit
6029NotPrivateThis launch is public
6030NotOpenYetThis launch hasn't opened yet
6031SharedAccountWritableThe config and the event authority must be passed read-only
6032OrderChangedThe order at this address is not the one this instruction was built for
6033TooManyOwnersToo many owners for one settlement
6034AliasedAccountAn account appears twice in the settlement
6035NothingHeldNothing held on that side