# Build on wdyt 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 | | | |---|---| | Program | `EPMG5kYwLHbearntvnARik8TR3dB9RNPakPuBmcBiV4a` (mainnet) | | Sides | Yes: YES tokens (`buy_yes`). No: NO shares (`buy_no`) | | IDL | [https://wdyt.fun/idl/wdyt.json](https://wdyt.fun/idl/wdyt.json), Anchor spec 0.1.0 | | Read API | [https://api.wdyt.fun/api/launches](https://api.wdyt.fun/api/launches), JSON, CORS open | | Your cut | 0.25% of every YES buy, NO buy and order-book fill that names your `frontend` account | | Tokens | SPL Token (not Token-2022). YES and the coin have 6 decimals, NO shares 9 | | Coin metadata | Metaplex Token Metadata on every coin, immutable, image and socials in the JSON | | For AI agents | [https://wdyt.fun/llms.txt](https://wdyt.fun/llms.txt) and [https://wdyt.fun/llms-full.txt](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. | endpoint | returns | |---|---| | `GET https://api.wdyt.fun/api/launches` | every 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}/series` | chart points: progress, YES price and NO price after each trade | | `GET https://api.wdyt.fun/api/launches/{address or id}/activity` | the 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/config` | treasury, rewards wallet, pause flag and the launch options for new launches (`presets`, `presetsEnabled` bitmask, `recommended` index) | | `GET https://api.wdyt.fun/api/rewards/summary` | holder 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}/payouts` | the 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 ```ts 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. ```ts 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 ```ts 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. | state | instruction | caller | pays | |---|---|---|---| | LIVE | `settle_position` | anyone | the 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_NO | `settle_position` | anyone | SOL for the owner's YES and NO, in their positions and holding (`payoutIfNo` above); rent back | | after resolution | `close_expired` | anyone | an 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 LIVE | `claim_creator` | anyone | escrowed 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_NO | `claim_creator` | anyone | the part of the bond that accrued to the starting share, to the creator | | LIVE | `claim_tokens` | the holder | wallet YES (from a `_to_wallet` buy or a withdrawal) for the coin | | RESOLVED_NO | `claim_sol` | the holder | wallet YES and NO for SOL | | LIVE | `claim_sol` | the holder | wallet 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 | instruction | when | effect | |---|---|---| | `resolve_no` | OPEN and past the deadline | marks the launch RESOLVED_NO and moves the creator's escrowed fees to the treasury | | `prepare_migration` then `migrate` | RESOLVED_YES | creates 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_position` | LIVE or RESOLVED_NO | pays 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_expired` | any state after OPEN (YES asks wait for LIVE) | settles one order for its maker | | `claim_creator` | any state after OPEN | pays the creator what they are owed | | `claim_pool_fees` | LIVE | pays 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_fees` | a fee split holds fees | pays 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. ## 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)` | account | access | address | |---|---|---| | `buyer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `holding` | mut | PDA ["holding", launch, buyer] | | `frontend` | mut, optional | your fee wallet, or null | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `buy_no(spend: u64, min_shares: u64)` Anchor client: `program.methods.buyNo(spend, minShares)` | account | access | address | |---|---|---| | `buyer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `holding` | mut | PDA ["holding", launch, buyer] | | `frontend` | mut, optional | your fee wallet, or null | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `buy_yes_to_wallet(spend: u64, min_out: u64)` Anchor client: `program.methods.buyYesToWallet(spend, minOut)` | account | access | address | |---|---|---| | `buyer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `yes_mint` | mut | PDA ["yes", launch] | | `buyer_yes` | mut | associated token account of [buyer, SPL Token program id, yes_mint] | | `frontend` | mut, optional | your fee wallet, or null | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `buy_no_to_wallet(spend: u64, min_shares: u64)` Anchor client: `program.methods.buyNoToWallet(spend, minShares)` | account | access | address | |---|---|---| | `buyer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `no_mint` | mut | PDA ["no", launch] | | `buyer_no` | mut | associated token account of [buyer, SPL Token program id, no_mint] | | `frontend` | mut, optional | your fee wallet, or null | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this 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)` | account | access | address | |---|---|---| | `maker` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `order` | mut | PDA ["order", launch, maker, arg nonce] | | `mint` | read | the launch's YES mint (token 0) or NO mint (token 1) | | `maker_token` | mut | PDA ["position", mint, maker] | | `book_vault` | mut | PDA ["book", launch, mint] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `fill_order(qty: u64, side: u8, price: u64)` Anchor client: `program.methods.fillOrder(qty, side, price)` | account | access | address | |---|---|---| | `taker` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `order` | mut | PDA ["order", launch, order.maker, order.nonce] | | `maker` | mut | `order.maker` | | `maker_token` | mut | `order.maker_token` | | `mint` | read | the order's mint (`maker_token.mint`) | | `taker_token` | mut | PDA ["position", mint, taker] | | `book_vault` | mut | PDA ["book", launch, mint] | | `frontend` | mut, optional | your fee wallet, or null | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `cancel_order(side: u8, price: u64, size: u64)` Anchor client: `program.methods.cancelOrder(side, price, size)` | account | access | address | |---|---|---| | `maker` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `order` | mut | PDA ["order", launch, maker, order.nonce] | | `maker_token` | mut | `order.maker_token` | | `book_vault` | mut | PDA ["book", launch, maker_token.mint] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `realize(token: u8)` Anchor client: `program.methods.realize(token)` | account | access | address | |---|---|---| | `owner` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `holding` | mut | PDA ["holding", launch, owner] | | `mint` | mut | the launch's YES mint (token 0) or NO mint (token 1) | | `position` | mut | PDA ["position", mint, owner] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `deposit(token: u8, amount: u64)` Anchor client: `program.methods.deposit(token, amount)` | account | access | address | |---|---|---| | `owner` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `mint` | read | caller supplies | | `from` | mut | the owner's own token account for the mint | | `position` | mut | PDA ["position", mint, owner] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `withdraw(token: u8, amount: u64)` Anchor client: `program.methods.withdraw(token, amount)` | account | access | address | |---|---|---| | `owner` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `mint` | read | caller supplies | | `position` | mut | PDA ["position", mint, owner] | | `to` | mut | associated token account of [owner, SPL Token program id, mint] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `claim_tokens()` Anchor client: `program.methods.claimTokens()` | account | access | address | |---|---|---| | `user` | mut, signer | the signing wallet | | `launch` | read | PDA ["launch", launch.meme_mint] | | `yes_mint` | mut | PDA ["yes", launch] | | `meme_mint` | read | `launch.meme_mint`, the coin mint the launch recorded at creation | | `user_yes` | mut | the caller's own YES token account (wallet tokens, not a position) | | `user_meme` | mut | associated token account of [user, SPL Token program id, meme_mint] | | `meme_escrow` | mut | PDA ["meme_escrow", launch] | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `claim_sol()` Anchor client: `program.methods.claimSol()` | account | access | address | |---|---|---| | `user` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `yes_mint` | mut | PDA ["yes", launch] | | `no_mint` | mut | PDA ["no", launch] | | `user_yes` | mut, optional | the caller's own YES token account, or null | | `user_no` | mut, optional | the caller's own NO token account, or null | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `create_launch(name: string, ticker: string, uri: string, preset: u8)` Anchor client: `program.methods.createLaunch(name, ticker, uri, preset)` | account | access | address | |---|---|---| | `creator` | mut, signer | the signing wallet | | `config` | read | PDA ["config"] | | `meme_mint` | mut, signer | `launch.meme_mint`, the coin mint the launch recorded at creation | | `launch` | mut | PDA ["launch", meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `yes_mint` | mut | PDA ["yes", launch] | | `no_mint` | mut | PDA ["no", launch] | | `meme_escrow` | mut | PDA ["meme_escrow", launch] | | `meme_metadata` | mut | PDA ["metadata", Token Metadata program id, meme_mint] under the Metaplex Token Metadata program | | `token_metadata_program` | read | fixed: `metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s` (Metaplex Token Metadata program) | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | ### Cranks #### `resolve_no()` Anchor client: `program.methods.resolveNo()` | account | access | address | |---|---|---| | `config` | read | PDA ["config"] | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `treasury` | mut | `config.treasury` (from the Config account or `/api/config`) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `prepare_migration()` Anchor client: `program.methods.prepareMigration()` | account | access | address | |---|---|---| | `payer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `migrator` | mut | PDA ["migrator", launch] | | `meme_mint` | read | `launch.meme_mint`, the coin mint the launch recorded at creation | | `wsol_mint` | read | fixed: `So11111111111111111111111111111111111111112` (wrapped SOL mint) | | `migrator_meme` | mut | associated token account of `migrator` for the coin mint | | `migrator_wsol` | mut | associated token account of `migrator` for wrapped SOL | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `migrate()` Anchor client: `program.methods.migrate()` | account | access | address | |---|---|---| | `payer` | mut, signer | the signing wallet | | `config` | read | PDA ["config"] | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `migrator` | mut | PDA ["migrator", launch] | | `meme_mint` | mut | `launch.meme_mint`, the coin mint the launch recorded at creation | | `wsol_mint` | read | fixed: `So11111111111111111111111111111111111111112` (wrapped SOL mint) | | `meme_escrow` | mut | PDA ["meme_escrow", launch] | | `migrator_meme` | mut | associated token account of `migrator` for the coin mint | | `migrator_wsol` | mut | associated token account of `migrator` for wrapped SOL | | `treasury` | mut | `config.treasury` (from the Config account or `/api/config`) | | `position_nft_mint` | mut, signer | a fresh keypair, signing | | `position_nft_account` | mut | PDA ["position_nft_account", position_nft_mint] under the Meteora DAMM v2 program | | `pool` | mut | PDA ["cpool", larger of (coin mint, wrapped SOL mint), smaller of the two] under the Meteora DAMM v2 program | | `position` | mut | PDA ["position", position_nft_mint] under the Meteora DAMM v2 program | | `token_a_vault` | mut | PDA ["token_vault", coin mint, pool] under the Meteora DAMM v2 program | | `token_b_vault` | mut | PDA ["token_vault", wrapped SOL mint, pool] under the Meteora DAMM v2 program | | `damm_pool_authority` | read | fixed: `HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC` (Meteora DAMM v2 pool authority) | | `damm_event_authority` | read | PDA ["__event_authority"] under the Meteora DAMM v2 program | | `amm_program` | read | fixed: `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` (Meteora DAMM v2 program) | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `token_2022_program` | read | fixed: `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb` (Token-2022 program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `settle_position()` Anchor client: `program.methods.settlePosition()` | account | access | address | |---|---|---| | `payer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `owner` | mut | the owner (any wallet with a position or a holding in this launch) | | `yes_mint` | mut | PDA ["yes", launch] | | `no_mint` | mut | PDA ["no", launch] | | `yes_position` | mut, optional | PDA ["position", yes_mint, owner] | | `no_position` | mut, optional | PDA ["position", no_mint, owner] | | `holding` | mut, optional | PDA ["holding", launch, owner] | | `meme_mint` | read | `launch.meme_mint`, the coin mint the launch recorded at creation | | `meme_escrow` | mut | PDA ["meme_escrow", launch] | | `owner_meme` | mut | associated token account of `owner` for the coin mint (created by the call if needed) | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `close_expired()` Anchor client: `program.methods.closeExpired()` | account | access | address | |---|---|---| | `payer` | mut, signer | the signing wallet | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `order` | mut | PDA ["order", launch, maker, order.nonce] | | `maker` | mut | `order.maker` | | `mint` | mut | the order's mint | | `book_vault` | mut | PDA ["book", launch, mint] | | `meme_mint` | read | `launch.meme_mint`, the coin mint the launch recorded at creation | | `meme_escrow` | mut | PDA ["meme_escrow", launch] | | `maker_meme` | mut | associated token account of `order.maker` for the coin mint (created by the call if needed) | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `associated_token_program` | read | fixed: `ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL` (Associated Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `claim_creator()` Anchor client: `program.methods.claimCreator()` | account | access | address | |---|---|---| | `creator` | mut | `launch.creator` (paid; not a signer) | | `launch` | mut | PDA ["launch", launch.meme_mint] | | `vault` | mut | PDA ["vault", launch] | | `fee_shares` | mut | PDA ["fee_shares", launch] | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `claim_pool_fees()` Anchor client: `program.methods.claimPoolFees()` | account | access | address | |---|---|---| | `payer` | mut, signer | the signing wallet | | `config` | read | PDA ["config"] | | `launch` | read | PDA ["launch", launch.meme_mint] | | `migrator` | mut | PDA ["migrator", launch] | | `meme_mint` | read | `launch.meme_mint`, the coin mint the launch recorded at creation | | `wsol_mint` | read | fixed: `So11111111111111111111111111111111111111112` (wrapped SOL mint) | | `migrator_meme` | mut | associated token account of `migrator` for the coin mint | | `migrator_wsol` | mut | associated token account of `migrator` for wrapped SOL | | `creator` | mut | `launch.creator` | | `fee_shares` | mut | PDA ["fee_shares", launch] | | `treasury` | mut | `config.treasury` (from the Config account or `/api/config`) | | `rewards_wallet` | mut | `config.rewards_wallet` (from the Config account or `/api/config`, `rewardsWallet`) | | `pool` | read | `launch.pool` | | `position` | mut | PDA ["position", launch.position_nft] under the Meteora DAMM v2 program | | `position_nft_account` | read | PDA ["position_nft_account", launch.position_nft] under the Meteora DAMM v2 program | | `token_a_vault` | mut | PDA ["token_vault", coin mint, pool] under the Meteora DAMM v2 program | | `token_b_vault` | mut | PDA ["token_vault", wrapped SOL mint, pool] under the Meteora DAMM v2 program | | `damm_pool_authority` | read | fixed: `HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC` (Meteora DAMM v2 pool authority) | | `damm_event_authority` | read | PDA ["__event_authority"] under the Meteora DAMM v2 program | | `amm_program` | read | fixed: `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` (Meteora DAMM v2 program) | | `token_program` | read | fixed: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` (SPL Token program) | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `distribute_creator_fees()` Anchor client: `program.methods.distributeCreatorFees()` | account | access | address | |---|---|---| | `fee_shares` | mut | PDA ["fee_shares", fee_shares.launch] | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | ### Creator fee splits #### `create_fee_shares()` Anchor client: `program.methods.createFeeShares()` | account | access | address | |---|---|---| | `payer` | mut, signer | the launch's creator, or `config.takeover_authority`; pays the account's rent (about 0.0044 SOL) | | `config` | read | PDA ["config"] | | `launch` | read | PDA ["launch", launch.meme_mint] | | `fee_shares` | mut | PDA ["fee_shares", launch] | | `system_program` | read | fixed: `11111111111111111111111111111111` (System program) | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `update_fee_shares(shares: Vec)` Anchor client: `program.methods.updateFeeShares(shares)` | account | access | address | |---|---|---| | `admin` | signer | `fee_shares.admin`: the creator, or after a takeover the new lead | | `launch` | read | PDA ["launch", launch.meme_mint] | | `fee_shares` | mut | PDA ["fee_shares", launch] | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | #### `set_fee_admin(new_admin: pubkey)` Anchor client: `program.methods.setFeeAdmin(newAdmin)` | account | access | address | |---|---|---| | `authority` | signer | `config.takeover_authority` | | `config` | read | PDA ["config"] | | `launch` | read | PDA ["launch", launch.meme_mint] | | `fee_shares` | mut | PDA ["fee_shares", launch] | | `event_authority` | read | PDA ["__event_authority"] under this program; it signs the self-CPIs that carry the program's events | | `program` | read | this program's id | ### Accounts #### `Launch` | field | type | meaning | |---|---|---| | `seq` | u64 | | | `creator` | pubkey | | | `state` | u8 | 0 OPEN, 1 RESOLVED_YES, 2 LIVE, 3 RESOLVED_NO | | `name` | string | | | `ticker` | string | | | `uri` | string | | | `params` | LaunchParams | terms copied at creation from the launch option the creator picked; later config changes never touch this launch | | `open_ts` | i64 | unix seconds; trading opens then (a private launch may open after it was created) | | `deadline` | i64 | unix seconds; trading stops at this time | | `vs` | u64 | YES curve virtual SOL reserve (lamports) | | `vt` | u64 | YES curve virtual token reserve (base units) | | `k` | u128 | vs * vt at creation | | `sold` | u64 | YES sold so far (base units): minted, or held in buyers' holdings | | `r_yes` | u64 | SOL in the YES pot; the launch graduates when this reaches params.threshold | | `r_no` | u64 | SOL in the NO fund | | `s_no` | u64 | NO shares outstanding (9 decimals): minted, or held in buyers' holdings | | `creator_escrow` | u64 | creator's fee share, paid only if the launch graduates | | `protocol_escrow` | u64 | | | `last_bond` | u64 | | | `s0_yes_gain` | u64 | SOL owed to YES holders if the market resolves No | | `s0_bond_gain` | u64 | | | `paid_out` | u64 | | | `bond_done` | bool | | | `s0_claimed` | bool | | | `migration_prepared` | bool | | | `resolved_yes_ts` | i64 | | | `live_ts` | i64 | graduation time; pool trading opens at live_ts + params.claim_delay | | `pool` | pubkey | Meteora pool address once LIVE | | `position_nft` | pubkey | | | `pool_sol` | u64 | SOL the pool opened with: both pots less params.mig_fee, launch_fee and no_refund | | `pool_tok` | u64 | coin the pool opened with (base units); total supply after graduation is sold + pool_tok | | `bump` | u8 | | | `vault_bump` | u8 | | | `launch_fee` | u64 | SOL paid to the treasury at graduation (params.grad_fee_bps of the pool's SOL before the fee) | | `no_refund` | u64 | No-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_mint` | pubkey | the 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") | | `approver` | pubkey | private 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` | field | type | meaning | |---|---|---| | `threshold` | u64 | SOL the YES pot must reach to graduate (75 SOL in the option enabled today) | | `window` | i64 | seconds the market stays open (1800 in the option enabled today) | | `bond` | u64 | creator bond in lamports (default 0.1 SOL) | | `s0` | u64 | YES holders' starting share of the NO fund (in shares; 2.8125 in the option enabled today) | | `p_min` | u64 | price used to value the starting share | | `mig_fee` | u64 | lamports kept from the YES pot to pay for graduation | | `claim_delay` | i64 | seconds between pool creation and pool trading | | `min_order` | u64 | smallest order-book notional in lamports (default 0.01 SOL) | | `k_no_bps` | u32 | NO fund cap as bps of the remaining YES room; 0 = no cap | | `fee_bps` | u16 | trade fee (default 125 = 1.25%) | | `frontend_bps` | u16 | frontend share of fee_bps (default 25 = 0.25% of the trade) | | `creator_bps` | u16 | creator share of fee_bps (default 30 = 0.30% of the trade) | | `supply` | u64 | coin supply before graduation (base units, 6 decimals) | | `curve_tok` | u64 | coin sold along the YES curve | | `vs0` | u64 | initial virtual SOL reserve | | `vt0` | u64 | initial virtual token reserve | | `pool_fee_bps` | u16 | the locked Meteora pool's swap fee (default 125 = 1.25%; Meteora keeps a fifth) | | `creator_pool_share_bps` | u16 | creator's share of the locked position's fees (default 6400 = 64%, 0.64% of every trade) | | `holder_pool_share_bps` | u16 | the 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_bps` | u16 | share of the NO fund that lifts the opening price at graduation | | `no_unlock_bps` | u16 | the 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_bps` | u16 | launch 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_bps` | u16 | share 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` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `owner` | pubkey | | | `yes` | u64 | YES bought and not minted (base units); `realize` mints it into the owner's position | | `no` | u64 | NO shares bought and not minted (9 decimals); `realize` mints them into the owner's position | | `bump` | u8 | | | `_reserved` | [u8; 76] | pads the account to a token account's 165 bytes, so its rent equals a coin account's | #### `Order` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `nonce` | u64 | | | `maker` | pubkey | | | `maker_token` | pubkey | | | `token` | u8 | | | `side` | u8 | | | `price` | u64 | | | `size` | u64 | | | `left` | u64 | | | `sol` | u64 | | | `bump` | u8 | | | `_reserved` | [u8; 18] | | #### `Config` | field | type | meaning | |---|---|---| | `admin` | pubkey | | | `treasury` | pubkey | | | `rewards_wallet` | pubkey | receives the holders' share of every `claim_pool_fees`; the keeper pays the coin's holders from it | | `takeover_authority` | pubkey | executes approved community takeovers with `set_fee_admin` | | `presets` | [LaunchParams; 3] | the launch options; `create_launch`'s `preset` is an index into this list | | `presets_enabled` | u8 | bit i set: option i can be picked; others fail with `PresetUnavailable` | | `paused` | bool | blocks new launches only; trading, settlement and claims continue | | `bump` | u8 | | #### `FeeShares` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `admin` | pubkey | may set the split, once: the creator, or after a community takeover the new lead | | `locked` | bool | the split has been set and cannot change again, except by a takeover | | `pending` | u64 | creator fees received and not yet paid out (lamports) | | `shares` | Vec | 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) | | `bump` | u8 | | ### 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` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `wallet` | pubkey | | | `spent` | u64 | | #### `CreatorClaimed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `amount` | u64 | | | `to_shares` | u64 | | | `state` | MarketState | | #### `CreatorFeesDistributed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `recipients` | Vec | | | `paid` | Vec | | | `owed` | Vec | | #### `Deposited` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `owner` | pubkey | | | `token` | u8 | | | `amount` | u64 | | #### `FeeSharesChanged` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `by` | pubkey | | | `admin` | pubkey | | | `recipients` | Vec | | | `bps` | Vec | | | `locked` | bool | | | `takeover` | bool | | #### `LaunchCreated` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `meme_mint` | pubkey | | | `creator` | pubkey | | | `name` | string | | | `ticker` | string | | | `uri` | string | | | `params` | LaunchParams | | | `preset` | u8 | | | `state` | MarketState | | #### `LaunchMadePrivate` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `approver` | pubkey | | | `opens_at` | i64 | | | `deadline` | i64 | | | `state` | MarketState | | #### `LaunchResolvedNo` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `r_yes` | u64 | | | `r_no` | u64 | | | `s_no` | u64 | | | `state` | MarketState | | #### `Migrated` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `pool` | pubkey | | | `pool_sol` | u64 | | | `pool_tok` | u64 | | | `minted` | u64 | | | `burned` | u64 | | | `launch_fee` | u64 | | | `no_refund` | u64 | | | `liquidity` | u128 | | | `sqrt_price` | u128 | | | `trading_opens` | i64 | | | `state` | MarketState | | #### `MigrationPrepared` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `state` | MarketState | | #### `NoBought` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `buyer` | pubkey | | | `spend` | u64 | | | `fee` | u64 | | | `net` | u64 | | | `shares` | u64 | | | `to_wallet` | bool | | | `state` | MarketState | | #### `OrderClosed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `order` | pubkey | | | `nonce` | u64 | | | `expired` | bool | | | `burned` | u64 | | | `coins_out` | u64 | | | `sol_out` | u64 | | | `state` | Option | | #### `OrderFilled` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `order` | pubkey | | | `nonce` | u64 | | | `taker` | pubkey | | | `qty` | u64 | | | `notional` | u64 | | | `fee` | u64 | | | `left` | u64 | | | `sol` | u64 | | | `done` | bool | | | `state` | MarketState | | #### `OrderPlaced` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `order` | pubkey | | | `nonce` | u64 | | | `maker` | pubkey | | | `token` | u8 | | | `side` | u8 | | | `price` | u64 | | | `size` | u64 | | | `sol` | u64 | | #### `PoolFeesClaimed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `fees` | u64 | | | `creator_share` | u64 | | | `holder_share` | u64 | | #### `PositionSettled` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `owner` | pubkey | | | `accounts` | u8 | | | `yes_burned` | u64 | | | `no_burned` | u64 | | | `yes_held` | u64 | | | `no_held` | u64 | | | `coins_out` | u64 | | | `sol_out` | u64 | | | `rent_to_caller` | bool | | | `state` | MarketState | | #### `PositionsSettled` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `results` | Vec | | | `state` | MarketState | | #### `Realized` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `owner` | pubkey | | | `token` | u8 | | | `amount` | u64 | | #### `SolClaimed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `user` | pubkey | | | `no_burned` | u64 | | | `yes_burned` | u64 | | | `sol_out` | u64 | | | `state` | MarketState | | #### `TokensClaimed` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `user` | pubkey | | | `amount` | u64 | | #### `WalletApproved` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `wallet` | pubkey | | | `limit` | u64 | | | `spent` | u64 | | #### `Withdrawn` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `owner` | pubkey | | | `token` | u8 | | | `amount` | u64 | | #### `YesBought` | field | type | meaning | |---|---|---| | `launch` | pubkey | | | `buyer` | pubkey | | | `charged` | u64 | | | `fee` | u64 | | | `net` | u64 | | | `yes_out` | u64 | | | `to_wallet` | bool | | | `state` | MarketState | | ### Errors | code | name | message | |---|---|---| | 6000 | `Closed` | Launch is not open for trading | | 6001 | `NotExpired` | Launch deadline has not passed | | 6002 | `WrongState` | Wrong launch state for this action | | 6003 | `Dust` | Amount too small | | 6004 | `Slippage` | Slippage limit exceeded | | 6005 | `NoSideFull` | The No side is full for this launch | | 6006 | `MathOverflow` | Math overflow | | 6007 | `InvalidParam` | Invalid parameter | | 6008 | `Paused` | Launch creation is paused | | 6009 | `InvalidMetadata` | Name, ticker or URI invalid | | 6010 | `BelowMinimum` | Order below minimum notional | | 6011 | `BadFill` | Bad fill size | | 6012 | `NotMaker` | Not the order maker | | 6013 | `WrongMint` | Wrong mint for this order book | | 6014 | `NothingToClaim` | Nothing to claim | | 6015 | `Insolvent` | Payouts would exceed pots plus bond | | 6016 | `SelfFill` | Maker cannot fill their own order | | 6017 | `WrongPool` | Pool accounts do not match this launch | | 6018 | `Unauthorized` | Only the program's upgrade authority can do this | | 6019 | `PresetUnavailable` | That launch option isn't available | | 6020 | `WrongAccount` | Account does not match its derived address | | 6021 | `NoSideClosed` | The No side opens once Yes reaches its unlock | | 6022 | `NotFeeAdmin` | Only the creator, the fee admin or the takeover authority can do this | | 6023 | `InvalidShares` | A fee split needs 1 to 10 different recipients whose shares add up to 100% | | 6024 | `SharesLocked` | The fee split can only be set once | | 6025 | `WrongRecipients` | Recipients must be the current fee shares, in order | | 6026 | `CreatorUnpaid` | Pay the creator's escrow and bond first | | 6027 | `PrivateLaunch` | Only wallets this launch approved can buy it | | 6028 | `OverLimit` | This buy would go past the wallet's limit | | 6029 | `NotPrivate` | This launch is public | | 6030 | `NotOpenYet` | This launch hasn't opened yet | | 6031 | `SharedAccountWritable` | The config and the event authority must be passed read-only | | 6032 | `OrderChanged` | The order at this address is not the one this instruction was built for | | 6033 | `TooManyOwners` | Too many owners for one settlement | | 6034 | `AliasedAccount` | An account appears twice in the settlement | | 6035 | `NothingHeld` | Nothing held on that side |