> ## 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.

# 2026-08-17 — CPMM: permissionless creator-fee collection

> CPMM adds a destination-constrained instruction that lets any payer sweep creator fees to the pool creator's canonical ATAs, and delegates Permission PDA creation without delegating revocation.

<Info>
  A documentation changelog entry for an upcoming CPMM program update. For the index of all updates, see [`reference/changelog`](/reference/changelog). For the protocol's own historical timeline, see [`introduction/history-and-milestones`](/introduction/history-and-milestones).
</Info>

This release adds a permissionless operational path for creator-fee collection. Anyone can pay to trigger the sweep, but the program fixes the recipient owner to `PoolState.pool_creator` and fixes both destinations to that creator's canonical associated token accounts. The existing creator-signed instruction remains unchanged.

It also lets a dedicated authority create CPMM `Permission` PDAs. That delegation is intentionally asymmetric: the dedicated authority can grant access to `InitializeWithPermission`, while only the program admin can revoke a grant with `ClosePermissionPda`.

## TL;DR for integrators

* **New additive instruction: `CollectCreatorFeePermissionless`.** Any signer can be the `payer`. The recorded pool creator does not sign.
* **The caller cannot redirect funds.** `creator` must equal `pool_state.pool_creator`. `creator_token_0` and `creator_token_1` must be that creator's canonical ATAs for the pool vault mints and their respective token programs.
* **The payer covers missing ATAs.** Both recipient accounts use `init_if_needed`; the payer funds rent when either account does not exist.
* **Collection is all-or-nothing.** The instruction transfers both full accrued creator-fee counters, zeros both, and updates `recent_epoch`. It returns the existing `NoFeeCollect` error when both counters are zero.
* **Existing integrations stay compatible.** `CollectCreatorFee` is not modified or removed. No `PoolState`, `AmmConfig`, `Permission`, event, or error-code layout changes are present.
* **Permission creation has a second owner.** `CreatePermissionPda` accepts the program admin or a dedicated create-permission-PDA owner. `ClosePermissionPda` remains admin-only.

## New instruction accounts

`CollectCreatorFeePermissionless` takes 14 accounts in this order:

| #     | Account                              | Constraint or role                                      |
| ----- | ------------------------------------ | ------------------------------------------------------- |
| 1     | `payer`                              | Writable signer; funds missing creator ATAs.            |
| 2     | `creator`                            | Must equal `pool_state.pool_creator`; does not sign.    |
| 3     | `authority`                          | CPMM global vault authority PDA.                        |
| 4     | `pool_state`                         | Writable; holds the creator-fee counters.               |
| 5–6   | `token_0_vault`, `token_1_vault`     | Writable; must match the vaults stored in the pool.     |
| 7–8   | `vault_0_mint`, `vault_1_mint`       | Must match the corresponding vault mint.                |
| 9–10  | `creator_token_0`, `creator_token_1` | Writable canonical creator ATAs; initialized if needed. |
| 11–12 | `token_0_program`, `token_1_program` | SPL Token or Token-2022 for each mint.                  |
| 13    | `associated_token_program`           | Creates a missing creator ATA.                          |
| 14    | `system_program`                     | Supports payer-funded account creation.                 |

Unlike `CollectCreatorFee`, the new layout has separate `payer` and non-signing `creator` accounts and does not take `amm_config`. It therefore requires its own discriminator and builder.

## SDK and IDL impact

The program-source branch does not include a committed SDK or IDL update. Integrators must refresh the deployed CPMM IDL or use a client release that explicitly supports `CollectCreatorFeePermissionless`. The documentation's pinned `@raydium-io/raydium-sdk-v2@0.2.42-alpha` builder set covers only the original creator-signed path.

## Security boundary

Permissionless invocation does not mean permissionless custody. The caller can choose when to collect and can spend SOL to create missing creator ATAs. The caller cannot choose the beneficiary, substitute arbitrary token accounts, request a partial amount, or change the pool's creator-fee configuration.

The new permission-PDA creator role can create a grant for any `permission_authority`, and it pays the new account's rent. It cannot close that PDA under this change. Treat it as a delegated grant authority, not a full permission administrator.

## Migration notes

* Keep existing `CollectCreatorFee` transactions unchanged.
* Add the permissionless instruction only after the target CPMM deployment and client IDL include it.
* Automation can scan pools with non-zero `creator_fees_token_0` or `creator_fees_token_1` and trigger collection without custody of creator keys.
* Handle `NoFeeCollect` as a benign race when another caller drains the counters first.
* Do not pass arbitrary recipient token accounts; derive the creator ATAs from `pool_state.pool_creator`, each vault mint, and the matching token program.

## Pages updated

* `products/cpmm/overview` — creator-fee collection update and destination-safety summary.
* `products/cpmm/instructions` — new instruction summary, full account list, effects, and state-change matrix.
* `products/cpmm/accounts` — creator-fee counter collection paths and delegated Permission PDA creation.
* `products/cpmm/fees` — permissionless collection mechanics and operational flow.
* `products/cpmm/code-demos` — SDK availability warning and client migration boundary.
* `products/launchlab/platform-config` — clarified that the recorded CPMM creator remains the beneficiary even when another payer triggers collection.
* `protocol-overview/shared-infrastructure` — authority-gated and destination-constrained collection paths.
* `security/admin-and-multisig` — delegated grant authority and permissionless collector boundaries.
* `reference/program-addresses` — canonical dedicated `CreatePermissionPda` owner addresses.
* `reference/error-codes` — expanded `NoFeeCollect` to cover creator-fee collection.

**Verified 2026-08-13 against**:

* [`raydium-cp-swap` branch `feat/permissionless-collect-creator-fee`](https://github.com/raydium-io/raydium-cp-swap/tree/feat/permissionless-collect-creator-fee).
* Commits [`9585ea1`](https://github.com/raydium-io/raydium-cp-swap/commit/9585ea1efeb27be7be7eab1ebc033449f9c793b4) and [`d99d542`](https://github.com/raydium-io/raydium-cp-swap/commit/d99d5420c65b973af05d4efa009a2a9d060461f9), compared with `master` at [`78f254e`](https://github.com/raydium-io/raydium-cp-swap/commit/78f254e1023751e706df7dc15c453fc3e046697c).

<Warning>
  This verification covers the source branch, not a mainnet-beta deployment. Confirm the deployed program and published IDL before enabling the new path in production.
</Warning>
