> ## Documentation Index
> Fetch the complete documentation index at: https://docs.raydium.io/llms.txt
> Use this file to discover all available pages before exploring further.

# LaunchLab instructions

> Initialize, Buy, Sell, Graduate, CollectFees, SetParams — argument shapes, account lists, and pre/postconditions for every LaunchLab instruction.

<Info>
  LaunchLab exposes a tight instruction set: six user-facing calls plus a handful of admin primitives. The SDK wraps all of them; this page documents the raw surface for aggregators, monitoring tools, and programs that need CPI.
</Info>

## Instruction inventory

| Group            | Instruction                                                                                                  | Callable by                                                                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Global config    | `CreateConfig` / `UpdateConfig`                                                                              | Program admin; the delegated create-config authority may also call `CreateConfig`                                                                  |
| Launch lifecycle | `Initialize` / `InitializeV2`                                                                                | Anyone (creator) — SPL Token base mint; V2 records `amm_creator_fee_on` for the eventual CPMM graduation. Only V2 accepts a Token-2022 quote mint. |
| Launch lifecycle | `InitializeWithToken2022`                                                                                    | Anyone (creator) — Token-2022 base mint, optional `TransferFeeConfig`; accepts either quote token program                                          |
| Trade            | `BuyExactIn` / `BuyExactOut`                                                                                 | Anyone — exact-input / exact-output buy on the bonding curve                                                                                       |
| Trade            | `SellExactIn` / `SellExactOut`                                                                               | Anyone — exact-input / exact-output sell on the bonding curve                                                                                      |
| Graduation       | `MigrateToAmm`                                                                                               | Migration wallet — legacy AMM v4 graduation for pools initialized before CPMM-only creation was enforced.                                          |
| Graduation       | `MigrateToCpswap`                                                                                            | Migration wallet — graduate to CPMM. All newly initialized launches use this path. Wraps `InitializeWithPermission` on CPMM.                       |
| Fees             | `CollectFee`                                                                                                 | Admin — sweep protocol fees from a launch                                                                                                          |
| Fees             | `CollectMigrateFee`                                                                                          | Admin — sweep accrued migration fees                                                                                                               |
| Fees             | `ClaimCreatorFee`                                                                                            | Creator — claim accrued creator fees during the curve phase                                                                                        |
| Vesting          | `CreateVestingAccount`                                                                                       | Creator — allocate locked tokens to a beneficiary, unlocked after graduation                                                                       |
| Vesting          | `CreatePlatformVestingAccount`                                                                               | Platform admin — allocate locked tokens to platform-side beneficiaries                                                                             |
| Vesting          | `ClaimVestedToken`                                                                                           | Beneficiary — claim unlocked tokens after the cliff                                                                                                |
| Platform config  | `CreatePlatformConfig` / `UpdatePlatformConfig`                                                              | Platform admin                                                                                                                                     |
| Platform config  | `CreatePlatformCurveRule` / `UpdatePlatformCurveRule` / `RemovePlatformCurveRule` / `ClosePlatformCurveRule` | `PlatformConfig.curve_rule_manager` or the platform admin — manage the launch-parameter rule of one `GlobalConfig`                                 |
| Platform fees    | `ClaimPlatformFee` / `ClaimPlatformFeeFromVault`                                                             | Platform admin                                                                                                                                     |
| Platform access  | `CreatePlatformAllowConfig` / `ClosePlatformAllowConfig`                                                     | Platform admin — maintain the `GlobalConfig` allowlist used when that platform enables restriction                                                 |

The "ExactIn/ExactOut" split mirrors CPMM's `SwapBaseInput` / `SwapBaseOutput` — on-chain they are separate instruction discriminators with slightly different rounding.

**Graduation path selection.** Every new `Initialize`, `InitializeV2`, and `InitializeWithToken2022` call must set `migrate_type = 1` (`CPSWAP`). Any attempt to initialize a new AMM v4-bound pool returns `MigrateTypeNotMatch`. `amm_creator_fee_on` only selects whether the resulting CPMM creator fee applies to the quote token or both tokens; it does not select the target program.

`MigrateToAmm` remains callable for an existing `PoolState` that was initialized with `migrate_type = 0` before this restriction. The release does not rewrite existing pool state or remove the legacy instruction.

**Quote-side token program.** The quote mint may be owned by either the SPL Token program or Token-2022. Every instruction that touches it — `CreateConfig`, `InitializeV2`, `InitializeWithToken2022`, all four trade instructions, `CollectFee`, `CollectMigrateFee`, `ClaimCreatorFee`, `ClaimPlatformFee`, and `ClaimPlatformFeeFromVault` — takes the owning program in its quote-program account slot. Account positions did not change; only the accepted value did. Pass the program that actually owns `GlobalConfig.quote_mint`, which you can read from `PoolState.token_program_flag` bit1 for an existing launch (see [`accounts`](/products/launchlab/accounts#poolstate)) or from the mint account's owner otherwise.

The deprecated `Initialize` is the exception: its quote-program account is still typed to SPL Token, so a config whose quote mint is Token-2022 must be launched through `InitializeV2` or `InitializeWithToken2022`.

`MigrateToCpswap` is the other exception, in the opposite direction — it takes **both** programs unconditionally rather than one per mint. See [the migration accounts below](#cpmm-migration-token-programs).

## `Initialize`

Create a new launch.

**Arguments**

```
launch_params: {
    curve_type:                 u8,
    base_supply_max:            u64,
    base_supply_graduation:     u64,
    k:                          u128,              // or initial_virtual_quote_reserve for curve_type=1
    open_time:                  u64,
    quote_mint:                 Pubkey,
    base_token_metadata: {                         // inline name/symbol/uri; program CPIs to Metaplex
        name:   String,
        symbol: String,
        uri:    String,
    },
    fees: {
        buy_numerator:   u64,
        buy_denominator: u64,
        sell_numerator:  u64,
        sell_denominator: u64,
        lp_share:        u64,
        creator_share:   u64,
        protocol_share:  u64,
        total_share:     u64,
    },
    post_graduation_lp_policy:  u8,                // 0 = Burn, 1 = Lock, 2 = ToCreator
}
```

**Accounts** (abridged)

| #  | Name               | W | S | Notes                                                                                                                                       |
| -- | ------------------ | - | - | ------------------------------------------------------------------------------------------------------------------------------------------- |
| 1  | `creator`          | W | S | Pays rent + base mint creation.                                                                                                             |
| 2  | `launch_config`    |   |   | Protocol config binding.                                                                                                                    |
| 3  | `launch_state`     | W |   | New account.                                                                                                                                |
| 4  | `launch_authority` |   |   | PDA.                                                                                                                                        |
| 5  | `base_mint`        | W | S | Fresh Keypair (or PDA) — this instruction initializes it.                                                                                   |
| 6  | `base_vault`       | W |   | ATA of `launch_authority` on `base_mint`.                                                                                                   |
| 7  | `quote_mint`       |   |   |                                                                                                                                             |
| 8  | `quote_vault`      | W |   | ATA of `launch_authority` on `quote_mint`.                                                                                                  |
| 9  | `metadata`         | W |   | Metaplex metadata PDA.                                                                                                                      |
| 10 | `metaplex_program` |   |   |                                                                                                                                             |
| 11 | `token_program`    |   |   | SPL Token for the base mint. `InitializeV2` and `InitializeWithToken2022` take a separate quote-program account that may be either program. |
| 12 | `system_program`   |   |   |                                                                                                                                             |
| 13 | `rent`             |   |   |                                                                                                                                             |

**Preconditions**

* `quote_mint ∈ launch_config.allowed_quote_mints`.
* `base_supply_graduation ≤ base_supply_max`.
* Fee parameters pass `launch_config.max_*_fee_rate` checks.
* `open_time ≥ now − slop` (SDK enforces `≥ now`; program tolerates slight backdating).
* `curve_type` is recognized.

**Postconditions**

* `base_mint` has `supply = base_supply_max`, all in `base_vault`.
* `base_mint.mint_authority = launch_authority`, `freeze_authority = None`.
* `LaunchState` initialized with `status = Active`, `base_sold = 0`, `quote_reserve_real = 0`.
* `quote_reserve_target` computed from curve params + `base_supply_graduation` + `buy_numerator` (approximately).
* For `InitializeWithToken2022` with a `TransferFeeConfig` attached: `transfer_fee_config_authority = launch_authority`, and `withdraw_withheld_authority = PlatformConfig.transfer_fee_extension_auth` when that field is set, otherwise `launch_authority`. The withdraw side is written at mint creation precisely so the platform can sweep withheld fees before graduation. See [`platform-config`](/products/launchlab/platform-config#token-2022-transfer-fee-authorities).

**Common errors** — `InvalidQuoteMint`, `FeeRateTooHigh`, `InvalidCurveParams`, `MathOverflow`.

## `Buy` (canonical variant: `BuyExactIn`)

User provides a fixed `quote_in`; the curve computes `base_out`.

**Arguments**

```
quote_in:          u64
minimum_base_out:  u64
```

**Accounts**

| #  | Name                       | W | S |
| -- | -------------------------- | - | - |
| 1  | `user`                     | W | S |
| 2  | `launch_state`             | W |   |
| 3  | `launch_authority`         |   |   |
| 4  | `base_vault`               | W |   |
| 5  | `quote_vault`              | W |   |
| 6  | `user_base_ata`            | W |   |
| 7  | `user_quote_ata`           | W |   |
| 8  | `base_mint`                |   |   |
| 9  | `quote_mint`               |   |   |
| 10 | `token_program`            |   |   |
| 11 | `associated_token_program` |   |   |
| 12 | `system_program`           |   |   |

**Preconditions**

* `launch_state.status == Active`.
* `now ≥ open_time`.
* `user_quote_ata.balance ≥ quote_in`.
* `quote_in > 0`.

**Effect**

1. Split `quote_in` into `quote_in_after_fee` and the fee parts.
2. Newton-solve the curve for `base_out` given the post-fee quote.
3. `require(base_out ≥ minimum_base_out)` else revert `ExceededSlippage`.
4. Move `quote_in` user → vault. Move `base_out` vault → user.
5. Update `base_sold += base_out`, `quote_reserve_real += quote_in_after_fee × (lp_share / total_share)`.
6. Update fee counters (`protocol_fees_quote`, `creator_fees_quote`).
7. `state_data.num_buys += 1`.
8. If `quote_reserve_real ≥ quote_reserve_target` after the update, the SDK typically chains a `Graduate` ix in the same transaction. The program does not auto-graduate inside `Buy` — a subsequent `Graduate` is required.

## `BuyExactOut`

User specifies the exact `base_out`; program computes `quote_in`.

**Arguments**

```
base_out:      u64
maximum_quote_in: u64
```

Same accounts as `BuyExactIn`. Uses the closed-form quadratic integral (or CPMM inverse, for curve\_type 1) rather than Newton iteration.

## `Sell` / `SellExactIn` / `SellExactOut`

Mirror of `Buy`. User returns `base_in` to the curve and receives `quote_out`. The fee is deducted from `quote_out`, so the user receives less than the raw integrated proceeds.

**Preconditions** —

* `user_base_ata.balance ≥ base_in`.
* Selling cannot push `base_sold` below 0 (redundant with the above given accounting is consistent).
* Launch is `Active`.

**Effect** — symmetrical to `Buy`. `base_sold` decreases, `quote_reserve_real` decreases. Fees still accrue.

### Quote-side transfer fees

When the quote mint carries a `TransferFeeConfig`, the amount the vault moves and the amount the payer is debited or credited differ, and the slippage bound is checked against the payer's side. On a quote mint without the extension every case below is identical to a plain legacy mint.

| Instruction    | Argument             | Checked against                                                                                                                                                                                      |
| -------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BuyExactIn`   | `amount_in`          | The curve is priced on `amount_in − transfer_fee(amount_in)` — what reaches the vault. A full fill debits exactly `amount_in`; a partial fill debits the consumed vault amount plus its inverse fee. |
| `BuyExactOut`  | `maximum_amount_in`  | The vault amount **plus** the inverse transfer fee — the real debit.                                                                                                                                 |
| `SellExactIn`  | `minimum_amount_out` | What the seller keeps after the mint withholds its fee, not the gross amount leaving the vault.                                                                                                      |
| `SellExactOut` | `amount_out`         | Delivered exactly. The curve targets `amount_out` plus the inverse transfer fee.                                                                                                                     |

Two consequences for quoting:

* A bound computed as if the mint were fee-free is rejected. Passing the fee-free cost as `maximum_amount_in`, or the fee-free proceeds as `minimum_amount_out`, reverts with `ExceededSlippage`.
* `real_quote` advances only by what reached the vault. A `BuyExactIn` of `amount_in` on a 5% quote mint moves `real_quote` by `amount_in × 0.95`.

A 100%-fee quote mint (`10000` basis points) cannot be inverted and reverts with `CalculateOverflow` on the exact-out paths.

Both trade-side mints are also constrained to the program passed in their matching slot, so a mismatched `base_token_program` now fails rather than being ignored. See [`algorithms/token-2022-transfer-fees`](/algorithms/token-2022-transfer-fees) for the underlying fee math.

## `MigrateToAmm` / `MigrateToCpswap`

Graduate a launch into a tradeable pool once the curve has hit `total_quote_fund_raising`. New launches are CPMM-only. `MigrateToAmm` is retained for existing pools whose stored `migrate_type` is `0`.

**Who signs**

* `MigrateToAmm` — the `migrate_to_amm_wallet` recorded on the binding `GlobalConfig`.
* `MigrateToCpswap` — the `migrate_to_cpswap_wallet` recorded on the binding `GlobalConfig`.

These wallets are typically held by the Raydium-operated graduation crank; in practice graduation lands seconds after the threshold is crossed, regardless of who triggered the final buy.

**Arguments**

`MigrateToAmm` takes three (mainly OpenBook market parameters that the program forwards to AMM v4):

```
base_lot_size:               u64
quote_lot_size:              u64
market_vault_signer_nonce:   u8
```

`MigrateToCpswap` takes none.

**Effect (common to both)**

1. Verify `pool_state.status == Migrate` (i.e., `quote_reserve_target` has been reached). Otherwise revert with `PoolMigrated` (status was already `Migrated`) or `PoolFunding` (still in funding).
2. Verify `pool_state.migrate_type` matches the instruction (`0` for AMM, `1` for CPMM). Otherwise revert with `MigrateTypeNotMatch`.
3. Compute the post-graduation reserves:
   * `base_amount_out = base_vault.amount − vesting_schedule.total_locked_amount`
   * `quote_amount_out = quote_vault.amount − quote_protocol_fee − migrate_fee − platform_fee`
4. CPI into the target program (`AMM v4 Initialize2` or `CPMM InitializeWithPermission`) with those reserves to create the post-graduation pool.
5. For CPMM migrations executed after the 2026-08-17 upgrade, combine `platform_scale + creator_scale` into one platform-owned locked-LP share and mint at most one Fee Key NFT to `platform_nft_wallet`. Burn the `burn_scale` remainder. Before the upgrade, `creator_scale` was locked separately and its Fee Key went to the token creator. Completed historical migrations are not modified. For legacy AMM v4 graduation, the LP disposition follows that instruction's existing flow.
6. Revoke `base_mint.mint_authority` (set to `None`).
7. Flip `pool_state.status = Migrated`, set `vesting_schedule.start_time = block_time + cliff_period`.

**Token-2022 transfer-fee authority handover** — when the base mint is a Token-2022 mint carrying `TransferFeeConfig` **and** `PlatformConfig.transfer_fee_extension_auth` is non-default, migration also reassigns that extension's authorities to the platform key:

* `transfer_fee_config_authority` is always reassigned. The launch `authority` PDA holds it for the whole pre-graduation phase, so there is always something to move.
* `WithheldWithdraw` is reassigned **only when the `authority` PDA still holds it**. Launches created from 2026-08-27 onward already carry `transfer_fee_extension_auth` on that authority from mint creation, so the step is skipped. The guard is what keeps migration from reverting on those mints — the PDA cannot sign away an authority it no longer holds.

If `transfer_fee_extension_auth` is `Pubkey::default()` at migration time, neither authority moves and both stay with the `authority` PDA permanently. See [`platform-config`](/products/launchlab/platform-config#token-2022-transfer-fee-authorities).

**Postconditions** — `BuyExactIn`, `BuyExactOut`, `SellExactIn`, `SellExactOut` will reject from this point on with `PoolMigrated`. The resulting AMM pool is canonical and trades like any other AMM v4 / CPMM pool.

**Common errors** — `PoolFunding`, `PoolMigrated`, `MigrateTypeNotMatch`, `InvalidCpSwapConfig`, `MathOverflow`.

### CPMM migration remaining accounts

Clients building `MigrateToCpswap` must use these fixed `remaining_accounts` indices:

| Index | Account                                                                                 |
| ----- | --------------------------------------------------------------------------------------- |
| 0–4   | Platform Fee Key owner, mint, token account, locked-liquidity PDA, and metadata account |
| 5     | Original launch creator; used when `platform_cp_creator` is unset                       |
| 6     | CPMM permission PDA derived from `[b"permission", launch_authority]`                    |
| 7     | Configured `platform_cp_creator`; used when the field is non-default                    |
| 8     | CPMM support-mint PDA for sorted `mint0`, derived from `[b"support_mint", mint0]`       |
| 9     | CPMM support-mint PDA for sorted `mint1`, derived from `[b"support_mint", mint1]`       |

The instruction requires at least ten remaining accounts on the upgraded path. The support-mint accounts are read-only CPI inputs. Derive both addresses even when the mint has no initialized support record. Older builders that still append creator-lock accounts or omit indices 8–9 must be updated.

### CPMM migration token programs

`MigrateToCpswap` takes both token programs unconditionally and works out which one owns each mint itself. Its two token-program accounts were renamed accordingly:

| Position | Account              | Value                               |
| -------- | -------------------- | ----------------------------------- |
| first    | `token_program`      | Always the legacy SPL Token program |
| second   | `token_program_2022` | Always the Token-2022 program       |

They replace the former `base_token_program` (whichever program owned the base mint) and `quote_token_program` (always legacy). Positions are unchanged, so this is a value change rather than a layout change — but the two values are close to inverted, and a builder that keeps passing its old pair will supply Token-2022 where the legacy program is required as soon as either mint is a Token-2022 mint.

The legacy program is required even when neither mint uses it, because the CPMM LP mint and the locked-liquidity Fee Key NFT always live on it.

## Platform `GlobalConfig` allowlist

`PlatformConfig.restrict_global_config` controls the check:

* `0`: the platform accepts any otherwise-valid `GlobalConfig`; no allow account is required.
* `1`: `Initialize`, `InitializeV2`, and `InitializeWithToken2022` must include the matching `PlatformAllowConfig` anywhere in `remaining_accounts`.

The platform admin creates or closes the PDA with `CreatePlatformAllowConfig` and `ClosePlatformAllowConfig`. Its seeds are `[b"platform_allow_config", platform_config, global_config]`. The former admin-managed `PlatformGlobalAccess` instructions and PDA are retired.

## Platform launch-parameter rules

Four instructions manage one `PlatformCurveRule` account. All four are signed by `PlatformConfig.curve_rule_manager` or by the platform admin — the program accepts the admin by re-deriving the `PlatformConfig` PDA from the signer, so no separate account proves it. A signer that is neither returns `InvalidCurveRuleAuthority`.

| Instruction               | Accounts                                                                                                                | Arguments                                            |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `CreatePlatformCurveRule` | `curve_rule_authority` (signer, mut), `platform_config`, `global_config`, `platform_curve_rule` (mut), `system_program` | none                                                 |
| `UpdatePlatformCurveRule` | same five                                                                                                               | `group_id: u16`, `constraints: Vec<ParamConstraint>` |
| `RemovePlatformCurveRule` | same five                                                                                                               | `group_id: u16`                                      |
| `ClosePlatformCurveRule`  | the first four                                                                                                          | none                                                 |

`platform_curve_rule` is the PDA at `[b"platform_curve_rule", platform_config, global_config]`.

* **`Create`** allocates the account holding no group. That state does not restrict anything.
* **`Update`** upserts the group with that `group_id`, replacing it wholesale if it exists. It resizes the account to fit, so the signer tops up the rent it grows by and receives back the rent it shrinks by. A new group beyond the tenth returns `CurveRuleGroupsExceeded`; more than 25 constraints, an unknown field or operator, or the same `(field, op)` pair twice in one group returns `InvalidCurveRuleConstraint`; the four `TotalSellA`-derived fields on a non-constant-product config return `CurveRuleFieldNotSupportedByCurve`.
* **`Remove`** drops one group by id, shrinking the account and refunding the difference. An unknown id returns `CurveRuleGroupNotExist`.
* **`Close`** returns the whole rent to the signer. The config is then unrestricted again even while `restrict_curve_param` stays `1`.

None of the four changes whether rules are enforced. That is `UpdatePlatformConfig::RestrictCurveParam(0 | 1)`, which only the platform admin can call.

**On the launch path.** While `restrict_curve_param` is `1`, `InitializeV2` and `InitializeWithToken2022` require the rule PDA in `remaining_accounts` — including when it does not exist, so that omitting it cannot skip the check. A missing account is `NotEnoughRemainingAccounts`; a launch that satisfies no group is `CurveParamNotMatchPlatformRule`. The check runs before `GlobalConfig`'s own limits and can only narrow them. Model and playbooks: [`products/launchlab/curve-rules`](/products/launchlab/curve-rules). Both errors are avoidable client-side — the SDK mirrors this check as a pure function, see [Check before you send](/products/launchlab/curve-rules#check-before-you-send).

## `CollectFee`

Admin sweep of the protocol's accrued trade fees on a single launch.

**Arguments** — none.

**Accounts**

| # | Name                      | W | S | Notes                                                           |
| - | ------------------------- | - | - | --------------------------------------------------------------- |
| 1 | `protocol_fee_owner`      |   | S | Must equal `global_config.protocol_fee_owner`.                  |
| 2 | `authority`               |   |   | PDA `[b"vault_auth_seed"]`; signs the vault transfer.           |
| 3 | `pool_state`              | W |   | Mutated to zero `quote_protocol_fee`.                           |
| 4 | `global_config`           |   |   | Source of truth for the signer.                                 |
| 5 | `quote_vault`             | W |   | Drained by `quote_protocol_fee`.                                |
| 6 | `recipient_token_account` | W |   | ATA of `protocol_fee_owner` on `quote_mint`.                    |
| 7 | `quote_mint`              |   |   |                                                                 |
| 8 | `token_program`           |   |   | The program that owns the quote mint — SPL Token or Token-2022. |

**Effect** — transfer `pool_state.quote_protocol_fee` from `quote_vault` to `recipient_token_account`, then zero the counter. Callable any time after the first buy.

## `CollectMigrateFee`

Admin sweep of the migration fee accumulated at graduation. Same account shape as `CollectFee` with `migrate_fee_owner` as the signer (instead of `protocol_fee_owner`) and `pool_state.migrate_fee` as the drained counter.

## `ClaimCreatorFee`

Per-creator sweep of accrued creator fees across **every launch the creator owns** that uses the same quote mint. Drains the per-creator fee vault, not the per-pool one.

**Arguments** — none.

**Accounts**

| # | Name                       | W | S | Notes                                                               |
| - | -------------------------- | - | - | ------------------------------------------------------------------- |
| 1 | `creator`                  | W | S | The pool creator.                                                   |
| 2 | `fee_vault_authority`      |   |   | PDA `[b"creator_fee_vault_auth_seed"]`.                             |
| 3 | `creator_fee_vault`        | W |   | PDA at seeds `[creator, quote_mint]`; the aggregated creator vault. |
| 4 | `recipient_token_account`  | W |   | `init_if_needed`; ATA of `creator` on `quote_mint`.                 |
| 5 | `quote_mint`               |   |   |                                                                     |
| 6 | `token_program`            |   |   |                                                                     |
| 7 | `system_program`           |   |   | For ATA creation if needed.                                         |
| 8 | `associated_token_program` |   |   |                                                                     |

**Effect** — transfer the entire balance of `creator_fee_vault` to `recipient_token_account`. Reverts with a require-greater-than-zero check if the vault is empty.

## `ClaimPlatformFee`

Per-platform sweep that drains a launch's quote vault directly. Use this when a platform wants to claim its slice for one specific launch without going through the aggregated platform vault.

**Arguments** — none.

**Accounts**

| #  | Name                       | W | S | Notes                                             |
| -- | -------------------------- | - | - | ------------------------------------------------- |
| 1  | `platform_fee_wallet`      | W | S | Must equal `platform_config.platform_fee_wallet`. |
| 2  | `authority`                |   |   | PDA `[b"vault_auth_seed"]`.                       |
| 3  | `pool_state`               | W |   | Drained by `pool_state.platform_fee`.             |
| 4  | `platform_config`          |   |   | Source of truth for the signer.                   |
| 5  | `quote_vault`              | W |   | Drained.                                          |
| 6  | `recipient_token_account`  | W |   | `init_if_needed`; ATA of `platform_fee_wallet`.   |
| 7  | `quote_mint`               |   |   |                                                   |
| 8  | `token_program`            |   |   |                                                   |
| 9  | `system_program`           |   |   |                                                   |
| 10 | `associated_token_program` |   |   |                                                   |

**Effect** — transfer `pool_state.platform_fee` from `quote_vault` to `recipient_token_account`, zero the counter.

## `ClaimPlatformFeeFromVault`

Per-platform aggregated sweep. Drains the platform's per-quote-mint fee vault that accumulates fees from every launch routed through the platform.

**Arguments** — none.

**Accounts**

| # | Name                       | W | S | Notes                                             |
| - | -------------------------- | - | - | ------------------------------------------------- |
| 1 | `platform_fee_wallet`      | W | S | Must equal `platform_config.platform_fee_wallet`. |
| 2 | `fee_vault_authority`      |   |   | PDA `[b"platform_fee_vault_auth_seed"]`.          |
| 3 | `platform_config`          |   |   |                                                   |
| 4 | `platform_fee_vault`       | W |   | PDA at seeds `[platform_config, quote_mint]`.     |
| 5 | `recipient_token_account`  | W |   | `init_if_needed`; ATA of `platform_fee_wallet`.   |
| 6 | `quote_mint`               |   |   |                                                   |
| 7 | `token_program`            |   |   |                                                   |
| 8 | `system_program`           |   |   |                                                   |
| 9 | `associated_token_program` |   |   |                                                   |

**Effect** — transfer the full balance of `platform_fee_vault` to `recipient_token_account`. Reverts if the vault is empty.

## Vesting and platform-config instructions

These are documented on dedicated pages because each has its own state model:

* [`CreateVestingAccount`, `CreatePlatformVestingAccount`, `ClaimVestedToken`](/products/launchlab/vesting)
* [`CreatePlatformConfig`, `UpdatePlatformConfig`, `CreatePlatformAllowConfig`, `ClosePlatformAllowConfig`](/products/launchlab/platform-config)
* [`CreatePlatformCurveRule`, `UpdatePlatformCurveRule`, `RemovePlatformCurveRule`, `ClosePlatformCurveRule`](/products/launchlab/curve-rules)
* [`CreateConfig`, `UpdateConfig`](/products/launchlab/global-config)

## State-change matrix

| Instruction                               | `status`   | `real_base` | `real_quote`     | Fee counters                                   | Post-state pool                                    |
| ----------------------------------------- | ---------- | ----------- | ---------------- | ---------------------------------------------- | -------------------------------------------------- |
| `Initialize{V2,WithToken2022}`            | Funding    | 0           | 0                | 0                                              | —                                                  |
| `BuyExactIn(q_in)`                        | Funding    | +∆          | +∆q\_after\_fee  | `quote_protocol_fee += ∆`, `platform_fee += ∆` | —                                                  |
| `SellExactIn(b_in)`                       | Funding    | −∆          | −∆q\_before\_fee | (same)                                         | —                                                  |
| Threshold reached                         | → Migrate  | —           | —                | —                                              | —                                                  |
| `MigrateToCpswap` / legacy `MigrateToAmm` | → Migrated | (frozen)    | (frozen)         | `migrate_fee` set                              | created; CPMM LP split into platform lock and burn |
| `CollectFee` / `CollectMigrateFee`        | any        | —           | —                | counter zeroed                                 | —                                                  |
| `ClaimCreatorFee` / `ClaimPlatformFee*`   | any        | —           | —                | drains vault                                   | —                                                  |
| `CreateVestingAccount`                    | Funding    | —           | —                | —                                              | bumps `allocated_share_amount`                     |
| `ClaimVestedToken`                        | Migrated   | —           | —                | —                                              | drains `base_vault`                                |

## Where to go next

* [`products/launchlab/code-demos`](/products/launchlab/code-demos) — TypeScript examples for each instruction.
* [`products/launchlab/accounts`](/products/launchlab/accounts) — full state shape.
* [`reference/error-codes`](/reference/error-codes) — LaunchLab error enum.

Sources:

* [Raydium SDK v2 `LaunchLab` module](https://github.com/raydium-io/raydium-sdk-V2)
* Raydium LaunchLab program source
