# PumpSwap decoder (Carbon 2.0)

> Decode PumpSwap instructions, accounts and events in Rust with carbon-pump-swap-decoder 2.0.0. Program ID pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA.

`carbon-pump-swap-decoder` decodes the instructions, accounts and events of the PumpSwap program (`pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`): 25 instructions, 7 account types, 22 events. It is generated with Codama from the program's IDL; see [decoders](https://carbon.sevenlabs.org/concepts/decoders.md) for how decoders plug into a pipeline.

|                  |                                                                                                             |
| ---------------- | ----------------------------------------------------------------------------------------------------------- |
| Crate            | [`carbon-pump-swap-decoder`](https://crates.io/crates/carbon-pump-swap-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-pump-swap-decoder@2.0.0`                                                                  |
| Program ID       | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` (`carbon_pump_swap_decoder::PROGRAM_ID`)                      |
| Category         | [DEX & AMM](https://carbon.sevenlabs.org/decoders/dex-and-amm.md)                                           |
| Decoder          | `carbon_pump_swap_decoder::PumpSwapDecoder`                                                                 |
| Instruction enum | `instructions::PumpSwapInstruction`                                                                         |
| Account enum     | `accounts::PumpSwapAccount`                                                                                 |
| Event enum       | `instructions::CpiEvent`                                                                                    |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                    |
| API docs         | [docs.rs/carbon-pump-swap-decoder/2.0.0](https://docs.rs/carbon-pump-swap-decoder/2.0.0)                    |
| Source           | [decoders/pump-swap-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/pump-swap-decoder) |

Other DEX and AMM decoders: [BonkSwap](https://carbon.sevenlabs.org/decoders/bonkswap.md), [FluxBeam](https://carbon.sevenlabs.org/decoders/fluxbeam.md), [Gavel](https://carbon.sevenlabs.org/decoders/gavel.md), [Heaven](https://carbon.sevenlabs.org/decoders/heaven.md), [Jupiter Limit Order](https://carbon.sevenlabs.org/decoders/jupiter-limit-order.md), [Jupiter Limit Order v2](https://carbon.sevenlabs.org/decoders/jupiter-limit-order-2.md), [Kamino Limit Order](https://carbon.sevenlabs.org/decoders/kamino-limit-order.md), [Lifinity AMM v2](https://carbon.sevenlabs.org/decoders/lifinity-amm-v2.md), [Meteora DAMM v2](https://carbon.sevenlabs.org/decoders/meteora-damm-v2.md), [Meteora DLMM](https://carbon.sevenlabs.org/decoders/meteora-dlmm.md), [Meteora Pools](https://carbon.sevenlabs.org/decoders/meteora-pools.md), [OpenBook v2](https://carbon.sevenlabs.org/decoders/openbook-v2.md), [Orca Whirlpools](https://carbon.sevenlabs.org/decoders/orca-whirlpool.md), [PancakeSwap](https://carbon.sevenlabs.org/decoders/pancake-swap.md), [Phoenix v1](https://carbon.sevenlabs.org/decoders/phoenix-v1.md), [Raydium AMM v4](https://carbon.sevenlabs.org/decoders/raydium-amm-v4.md), [Raydium CLMM](https://carbon.sevenlabs.org/decoders/raydium-clmm.md), [Raydium CPMM](https://carbon.sevenlabs.org/decoders/raydium-cpmm.md), [Raydium Stable Swap](https://carbon.sevenlabs.org/decoders/raydium-stable-swap.md), [Stabble Stable Swap](https://carbon.sevenlabs.org/decoders/stabble-stable-swap.md), [Stabble Weighted Swap](https://carbon.sevenlabs.org/decoders/stabble-weighted-swap.md). To decode several in one pipeline, see [dEX and AMM decoders](https://carbon.sevenlabs.org/decoders/dex-and-amm.md).

Guide: [Index swaps across DEXs](https://carbon.sevenlabs.org/guides/index-dex-swaps.md).

The `serde` feature derives `Serialize`/`Deserialize` on every type, `postgres` adds tables and processors for [Postgres](https://carbon.sevenlabs.org/guides/postgres.md), and `graphql` adds a schema for the [GraphQL server](https://carbon.sevenlabs.org/guides/graphql.md).

## Usage

This program crawls recent PumpSwap transactions from the public RPC and prints every decoded `Buy` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-pump-swap-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_pump_swap_decoder::{instructions::PumpSwapInstruction, PumpSwapDecoder, PROGRAM_ID},
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Fetches the program's recent transactions over JSON-RPC, newest first.
    let datasource = RpcTransactionCrawler::new(
        "https://api.mainnet-beta.solana.com".to_string(),
        PROGRAM_ID,
        ConnectionConfig::default(),
        Filters::new(None, None, None),
        None,
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .instruction(PumpSwapDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, PumpSwapInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, PumpSwapInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let PumpSwapInstruction::Buy { data, accounts, .. } = input.decoded_instruction {
            println!("buy {signature}: {data:?} pool={}", accounts.pool);
        }
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each `Buy` instruction prints one line with the transaction signature and the decoded `Buy` data. The public endpoint rate-limits requests, so the first lines can take a while; use your own RPC URL for anything beyond a test. See [stream with RPC](https://carbon.sevenlabs.org/guides/stream-with-rpc.md) for the crawler options.

Events published with Anchor's `emit_cpi!` arrive as the `CpiEvent` instruction. Match them with `PumpSwapInstruction::CpiEvent { data: CpiEvent::AdminSetCoinCreatorEvent(event), .. }` (import `instructions::CpiEvent`); see [Events](#events). If `CpiEvent` never arrives, the program logs its events with `emit!` instead: decode them with [`decode_log_events`](https://carbon.sevenlabs.org/concepts/instructions.md#log-events).

### Decode accounts

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with `programSubscribe` on the public WebSocket endpoint and prints every decoded `Pool` account as it changes. Add the datasource and the Solana RPC types it takes:

```sh
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
```

`src/main.rs`:

```rust
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_pump_swap_decoder::{accounts::PumpSwapAccount, PumpSwapDecoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

#[tokio::main]
async fn main() -> CarbonResult<()> {
    env_logger::init();

    // Streams every change to an account owned by the program (programSubscribe).
    let config = RpcProgramAccountsConfig {
        account_config: RpcAccountInfoConfig {
            encoding: Some(UiAccountEncoding::Base64),
            ..Default::default()
        },
        ..Default::default()
    };
    let datasource = RpcProgramSubscribe::new(
        "wss://api.mainnet-beta.solana.com".to_string(),
        Filters::new(PROGRAM_ID, Some(config)),
    );

    Pipeline::builder()
        .datasource(datasource)
        .metrics(Arc::new(LogMetrics::new()))
        .account(PumpSwapDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, PumpSwapAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, PumpSwapAccount>,
    ) -> CarbonResult<()> {
        if let PumpSwapAccount::Pool(pool) = &input.decoded_account.data {
            println!("pool {}: {pool:?}", input.metadata.pubkey);
        }
        Ok(())
    }
}
```

```sh
RUST_LOG=info cargo run
```

Each update to a `Pool` account prints its address and decoded fields; the program runs until you stop it. Cargo resolves `solana-client` to 4.2.2, the exact version the datasource pins, so both use the same `RpcProgramAccountsConfig` type. To load every existing account once instead of streaming changes, see [load account state](https://carbon.sevenlabs.org/guides/load-account-state.md).

## Instructions

Variants of `PumpSwapInstruction`. Each is `PumpSwapInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_pump_swap_decoder::instructions`. Discriminators are the leading bytes of the instruction data, in hex.

**How an instruction decodes.** The decoder returns a variant only when all of these hold; otherwise the instruction is skipped and no processor is called:

1. The instruction's program ID is `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`.
2. The data starts with the variant's discriminator, and the rest deserializes into its data type.
3. The instruction has at least as many accounts as the variant requires (the "Required accounts" count under each variant).

**Accounts.** They are matched by position, in the order listed. An account marked _optional_ is `None` only when the instruction ends before it; Anchor programs pass the program ID as a placeholder for an omitted optional account, so check for `Some(PROGRAM_ID)` too. Accounts after the listed ones are in `accounts.remaining` as `AccountMeta`s. The decoder doesn't record whether an account signed or was writable: read that from `input.raw_instruction.accounts[i].is_signer` and `.is_writable`, which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.

### `AdminSetCoinCreator`

> _From the program's IDL:_
>
> Overrides the coin creator for a canonical pump pool

Discriminator `f228759149606968` · data `AdminSetCoinCreator` · accounts `AdminSetCoinCreatorInstructionAccounts`.

| Field          | Type     |
| -------------- | -------- |
| `coin_creator` | `Pubkey` |

Required accounts: 5; extras go to `remaining`.

Fields of `AdminSetCoinCreatorInstructionAccounts`, in account order:

| #  | Field                              | Type               |
| -- | ---------------------------------- | ------------------ |
| 0  | `admin_set_coin_creator_authority` | `Pubkey`           |
| 1  | `global_config`                    | `Pubkey`           |
| 2  | `pool`                             | `Pubkey`           |
| 3  | `event_authority`                  | `Pubkey`           |
| 4  | `program`                          | `Pubkey`           |
| 5… | `remaining`                        | `Vec<AccountMeta>` |

### `AdminUpdateTokenIncentives`

Discriminator `d10b7357d5177ccc` · data `AdminUpdateTokenIncentives` · accounts `AdminUpdateTokenIncentivesInstructionAccounts`.

| Field                  | Type  |
| ---------------------- | ----- |
| `start_time`           | `i64` |
| `end_time`             | `i64` |
| `seconds_in_a_day`     | `i64` |
| `day_number`           | `u64` |
| `token_supply_per_day` | `u64` |

Required accounts: 10; extras go to `remaining`.

Fields of `AdminUpdateTokenIncentivesInstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `admin`                          | `Pubkey`           |
| 1   | `global_config`                  | `Pubkey`           |
| 2   | `global_volume_accumulator`      | `Pubkey`           |
| 3   | `mint`                           | `Pubkey`           |
| 4   | `global_incentive_token_account` | `Pubkey`           |
| 5   | `associated_token_program`       | `Pubkey`           |
| 6   | `system_program`                 | `Pubkey`           |
| 7   | `token_program`                  | `Pubkey`           |
| 8   | `event_authority`                | `Pubkey`           |
| 9   | `program`                        | `Pubkey`           |
| 10… | `remaining`                      | `Vec<AccountMeta>` |

### `Buy`

> _From the program's IDL:_
>
> For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts\[0]. If provided and valid, the ATA will be initialized if needed.

Discriminator `66063d1201daebea` · data `Buy` · accounts `BuyInstructionAccounts`.

| Field                 | Type                        |
| --------------------- | --------------------------- |
| `base_amount_out`     | `u64`                       |
| `max_quote_amount_in` | `u64`                       |
| `track_volume`        | [`OptionBool`](#optionbool) |

Required accounts: 23; extras go to `remaining`.

Fields of `BuyInstructionAccounts`, in account order:

| #   | Field                                  | Type               |
| --- | -------------------------------------- | ------------------ |
| 0   | `pool`                                 | `Pubkey`           |
| 1   | `user`                                 | `Pubkey`           |
| 2   | `global_config`                        | `Pubkey`           |
| 3   | `base_mint`                            | `Pubkey`           |
| 4   | `quote_mint`                           | `Pubkey`           |
| 5   | `user_base_token_account`              | `Pubkey`           |
| 6   | `user_quote_token_account`             | `Pubkey`           |
| 7   | `pool_base_token_account`              | `Pubkey`           |
| 8   | `pool_quote_token_account`             | `Pubkey`           |
| 9   | `protocol_fee_recipient`               | `Pubkey`           |
| 10  | `protocol_fee_recipient_token_account` | `Pubkey`           |
| 11  | `base_token_program`                   | `Pubkey`           |
| 12  | `quote_token_program`                  | `Pubkey`           |
| 13  | `system_program`                       | `Pubkey`           |
| 14  | `associated_token_program`             | `Pubkey`           |
| 15  | `event_authority`                      | `Pubkey`           |
| 16  | `program`                              | `Pubkey`           |
| 17  | `coin_creator_vault_ata`               | `Pubkey`           |
| 18  | `coin_creator_vault_authority`         | `Pubkey`           |
| 19  | `global_volume_accumulator`            | `Pubkey`           |
| 20  | `user_volume_accumulator`              | `Pubkey`           |
| 21  | `fee_config`                           | `Pubkey`           |
| 22  | `fee_program`                          | `Pubkey`           |
| 23… | `remaining`                            | `Vec<AccountMeta>` |

### `BuyExactQuoteIn`

> _From the program's IDL:_
>
> Given a budget of spendable_quote_in, buy at least min_base_amount_out\
> Fees will be deducted from spendable_quote_in f(quote) = tokens, where tokens >= min_base_amount_out\
> Make sure the payer has enough SOL to cover creation of the following accounts (unless already created):
>
> - protocol_fee_recipient_token_account:\
>   rent.minimum_balance(TokenAccount::LEN)
> - coin_creator_vault_ata: rent.minimum_balance(TokenAccount::LEN)
> - user_volume_accumulator: rent.minimum_balance(UserVolumeAccumulator::LEN)
>
> For cashback coins, optionally pass user_volume_accumulator_wsol_ata as remaining_accounts\[0]. If provided and valid, the ATA will be initialized if needed.

Discriminator `c62e1552b4d9e870` · data `BuyExactQuoteIn` · accounts `BuyExactQuoteInInstructionAccounts`.

| Field                 | Type                        |
| --------------------- | --------------------------- |
| `spendable_quote_in`  | `u64`                       |
| `min_base_amount_out` | `u64`                       |
| `track_volume`        | [`OptionBool`](#optionbool) |

Required accounts: 23; extras go to `remaining`.

Fields of `BuyExactQuoteInInstructionAccounts`, in account order:

| #   | Field                                  | Type               |
| --- | -------------------------------------- | ------------------ |
| 0   | `pool`                                 | `Pubkey`           |
| 1   | `user`                                 | `Pubkey`           |
| 2   | `global_config`                        | `Pubkey`           |
| 3   | `base_mint`                            | `Pubkey`           |
| 4   | `quote_mint`                           | `Pubkey`           |
| 5   | `user_base_token_account`              | `Pubkey`           |
| 6   | `user_quote_token_account`             | `Pubkey`           |
| 7   | `pool_base_token_account`              | `Pubkey`           |
| 8   | `pool_quote_token_account`             | `Pubkey`           |
| 9   | `protocol_fee_recipient`               | `Pubkey`           |
| 10  | `protocol_fee_recipient_token_account` | `Pubkey`           |
| 11  | `base_token_program`                   | `Pubkey`           |
| 12  | `quote_token_program`                  | `Pubkey`           |
| 13  | `system_program`                       | `Pubkey`           |
| 14  | `associated_token_program`             | `Pubkey`           |
| 15  | `event_authority`                      | `Pubkey`           |
| 16  | `program`                              | `Pubkey`           |
| 17  | `coin_creator_vault_ata`               | `Pubkey`           |
| 18  | `coin_creator_vault_authority`         | `Pubkey`           |
| 19  | `global_volume_accumulator`            | `Pubkey`           |
| 20  | `user_volume_accumulator`              | `Pubkey`           |
| 21  | `fee_config`                           | `Pubkey`           |
| 22  | `fee_program`                          | `Pubkey`           |
| 23… | `remaining`                            | `Vec<AccountMeta>` |

### `ClaimCashback`

Discriminator `253a237ebe35e4c5` · data `ClaimCashback` · accounts `ClaimCashbackInstructionAccounts`.

No data fields.

Required accounts: 9; extras go to `remaining`.

Fields of `ClaimCashbackInstructionAccounts`, in account order:

| #  | Field                                        | Type               |
| -- | -------------------------------------------- | ------------------ |
| 0  | `user`                                       | `Pubkey`           |
| 1  | `user_volume_accumulator`                    | `Pubkey`           |
| 2  | `quote_mint`                                 | `Pubkey`           |
| 3  | `quote_token_program`                        | `Pubkey`           |
| 4  | `user_volume_accumulator_wsol_token_account` | `Pubkey`           |
| 5  | `user_wsol_token_account`                    | `Pubkey`           |
| 6  | `system_program`                             | `Pubkey`           |
| 7  | `event_authority`                            | `Pubkey`           |
| 8  | `program`                                    | `Pubkey`           |
| 9… | `remaining`                                  | `Vec<AccountMeta>` |

### `ClaimTokenIncentives`

Discriminator `1004471ccc01281b` · data `ClaimTokenIncentives` · accounts `ClaimTokenIncentivesInstructionAccounts`.

No data fields.

Required accounts: 12; extras go to `remaining`.

Fields of `ClaimTokenIncentivesInstructionAccounts`, in account order:

| #   | Field                            | Type               |
| --- | -------------------------------- | ------------------ |
| 0   | `user`                           | `Pubkey`           |
| 1   | `user_ata`                       | `Pubkey`           |
| 2   | `global_volume_accumulator`      | `Pubkey`           |
| 3   | `global_incentive_token_account` | `Pubkey`           |
| 4   | `user_volume_accumulator`        | `Pubkey`           |
| 5   | `mint`                           | `Pubkey`           |
| 6   | `token_program`                  | `Pubkey`           |
| 7   | `system_program`                 | `Pubkey`           |
| 8   | `associated_token_program`       | `Pubkey`           |
| 9   | `event_authority`                | `Pubkey`           |
| 10  | `program`                        | `Pubkey`           |
| 11  | `payer`                          | `Pubkey`           |
| 12… | `remaining`                      | `Vec<AccountMeta>` |

### `CloseUserVolumeAccumulator`

Discriminator `f945a4da9667548a` · data `CloseUserVolumeAccumulator` · accounts `CloseUserVolumeAccumulatorInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `CloseUserVolumeAccumulatorInstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `user`                    | `Pubkey`           |
| 1  | `user_volume_accumulator` | `Pubkey`           |
| 2  | `event_authority`         | `Pubkey`           |
| 3  | `program`                 | `Pubkey`           |
| 4… | `remaining`               | `Vec<AccountMeta>` |

### `CollectCoinCreatorFee`

Discriminator `a039592ab58b2b42` · data `CollectCoinCreatorFee` · accounts `CollectCoinCreatorFeeInstructionAccounts`.

No data fields.

Required accounts: 8; extras go to `remaining`.

Fields of `CollectCoinCreatorFeeInstructionAccounts`, in account order:

| #  | Field                          | Type               |
| -- | ------------------------------ | ------------------ |
| 0  | `quote_mint`                   | `Pubkey`           |
| 1  | `quote_token_program`          | `Pubkey`           |
| 2  | `coin_creator`                 | `Pubkey`           |
| 3  | `coin_creator_vault_authority` | `Pubkey`           |
| 4  | `coin_creator_vault_ata`       | `Pubkey`           |
| 5  | `coin_creator_token_account`   | `Pubkey`           |
| 6  | `event_authority`              | `Pubkey`           |
| 7  | `program`                      | `Pubkey`           |
| 8… | `remaining`                    | `Vec<AccountMeta>` |

### `CreateConfig`

Discriminator `c9cff3724b6f2fbd` · data `CreateConfig` · accounts `CreateConfigInstructionAccounts`.

| Field                              | Type          |
| ---------------------------------- | ------------- |
| `lp_fee_basis_points`              | `u64`         |
| `protocol_fee_basis_points`        | `u64`         |
| `protocol_fee_recipients`          | `[Pubkey; 8]` |
| `coin_creator_fee_basis_points`    | `u64`         |
| `admin_set_coin_creator_authority` | `Pubkey`      |

Required accounts: 5; extras go to `remaining`.

Fields of `CreateConfigInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `system_program`  | `Pubkey`           |
| 3  | `event_authority` | `Pubkey`           |
| 4  | `program`         | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `CreatePool`

Discriminator `e992d18ecf6840bc` · data `CreatePool` · accounts `CreatePoolInstructionAccounts`.

| Field              | Type                        |
| ------------------ | --------------------------- |
| `index`            | `u16`                       |
| `base_amount_in`   | `u64`                       |
| `quote_amount_in`  | `u64`                       |
| `coin_creator`     | `Pubkey`                    |
| `is_mayhem_mode`   | `bool`                      |
| `is_cashback_coin` | [`OptionBool`](#optionbool) |

Required accounts: 18; extras go to `remaining`.

Fields of `CreatePoolInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `global_config`            | `Pubkey`           |
| 2   | `creator`                  | `Pubkey`           |
| 3   | `base_mint`                | `Pubkey`           |
| 4   | `quote_mint`               | `Pubkey`           |
| 5   | `lp_mint`                  | `Pubkey`           |
| 6   | `user_base_token_account`  | `Pubkey`           |
| 7   | `user_quote_token_account` | `Pubkey`           |
| 8   | `user_pool_token_account`  | `Pubkey`           |
| 9   | `pool_base_token_account`  | `Pubkey`           |
| 10  | `pool_quote_token_account` | `Pubkey`           |
| 11  | `system_program`           | `Pubkey`           |
| 12  | `token2022_program`        | `Pubkey`           |
| 13  | `base_token_program`       | `Pubkey`           |
| 14  | `quote_token_program`      | `Pubkey`           |
| 15  | `associated_token_program` | `Pubkey`           |
| 16  | `event_authority`          | `Pubkey`           |
| 17  | `program`                  | `Pubkey`           |
| 18… | `remaining`                | `Vec<AccountMeta>` |

### `Deposit`

Discriminator `f223c68952e1f2b6` · data `Deposit` · accounts `DepositInstructionAccounts`.

| Field                 | Type  |
| --------------------- | ----- |
| `lp_token_amount_out` | `u64` |
| `max_base_amount_in`  | `u64` |
| `max_quote_amount_in` | `u64` |

Required accounts: 15; extras go to `remaining`.

Fields of `DepositInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `global_config`            | `Pubkey`           |
| 2   | `user`                     | `Pubkey`           |
| 3   | `base_mint`                | `Pubkey`           |
| 4   | `quote_mint`               | `Pubkey`           |
| 5   | `lp_mint`                  | `Pubkey`           |
| 6   | `user_base_token_account`  | `Pubkey`           |
| 7   | `user_quote_token_account` | `Pubkey`           |
| 8   | `user_pool_token_account`  | `Pubkey`           |
| 9   | `pool_base_token_account`  | `Pubkey`           |
| 10  | `pool_quote_token_account` | `Pubkey`           |
| 11  | `token_program`            | `Pubkey`           |
| 12  | `token2022_program`        | `Pubkey`           |
| 13  | `event_authority`          | `Pubkey`           |
| 14  | `program`                  | `Pubkey`           |
| 15… | `remaining`                | `Vec<AccountMeta>` |

### `Disable`

Discriminator `b9adbb5ad80feee9` · data `Disable` · accounts `DisableInstructionAccounts`.

| Field                 | Type   |
| --------------------- | ------ |
| `disable_create_pool` | `bool` |
| `disable_deposit`     | `bool` |
| `disable_withdraw`    | `bool` |
| `disable_buy`         | `bool` |
| `disable_sell`        | `bool` |

Required accounts: 4; extras go to `remaining`.

Fields of `DisableInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `ExtendAccount`

Discriminator `ea66c2cb96483ee5` · data `ExtendAccount` · accounts `ExtendAccountInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `ExtendAccountInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `account`         | `Pubkey`           |
| 1  | `user`            | `Pubkey`           |
| 2  | `system_program`  | `Pubkey`           |
| 3  | `event_authority` | `Pubkey`           |
| 4  | `program`         | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `InitUserVolumeAccumulator`

Discriminator `5e06ca73ff60e8b7` · data `InitUserVolumeAccumulator` · accounts `InitUserVolumeAccumulatorInstructionAccounts`.

No data fields.

Required accounts: 6; extras go to `remaining`.

Fields of `InitUserVolumeAccumulatorInstructionAccounts`, in account order:

| #  | Field                     | Type               |
| -- | ------------------------- | ------------------ |
| 0  | `payer`                   | `Pubkey`           |
| 1  | `user`                    | `Pubkey`           |
| 2  | `user_volume_accumulator` | `Pubkey`           |
| 3  | `system_program`          | `Pubkey`           |
| 4  | `event_authority`         | `Pubkey`           |
| 5  | `program`                 | `Pubkey`           |
| 6… | `remaining`               | `Vec<AccountMeta>` |

### `MigratePoolCoinCreator`

> _From the program's IDL:_
>
> Migrate Pool Coin Creator to Sharing Config

Discriminator `d0089f044aaf103a` · data `MigratePoolCoinCreator` · accounts `MigratePoolCoinCreatorInstructionAccounts`.

No data fields.

Required accounts: 4; extras go to `remaining`.

Fields of `MigratePoolCoinCreatorInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `pool`            | `Pubkey`           |
| 1  | `sharing_config`  | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `Sell`

Discriminator `33e685a4017f83ad` · data `Sell` · accounts `SellInstructionAccounts`.

| Field                  | Type  |
| ---------------------- | ----- |
| `base_amount_in`       | `u64` |
| `min_quote_amount_out` | `u64` |

Required accounts: 21; extras go to `remaining`.

Fields of `SellInstructionAccounts`, in account order:

| #   | Field                                  | Type               |
| --- | -------------------------------------- | ------------------ |
| 0   | `pool`                                 | `Pubkey`           |
| 1   | `user`                                 | `Pubkey`           |
| 2   | `global_config`                        | `Pubkey`           |
| 3   | `base_mint`                            | `Pubkey`           |
| 4   | `quote_mint`                           | `Pubkey`           |
| 5   | `user_base_token_account`              | `Pubkey`           |
| 6   | `user_quote_token_account`             | `Pubkey`           |
| 7   | `pool_base_token_account`              | `Pubkey`           |
| 8   | `pool_quote_token_account`             | `Pubkey`           |
| 9   | `protocol_fee_recipient`               | `Pubkey`           |
| 10  | `protocol_fee_recipient_token_account` | `Pubkey`           |
| 11  | `base_token_program`                   | `Pubkey`           |
| 12  | `quote_token_program`                  | `Pubkey`           |
| 13  | `system_program`                       | `Pubkey`           |
| 14  | `associated_token_program`             | `Pubkey`           |
| 15  | `event_authority`                      | `Pubkey`           |
| 16  | `program`                              | `Pubkey`           |
| 17  | `coin_creator_vault_ata`               | `Pubkey`           |
| 18  | `coin_creator_vault_authority`         | `Pubkey`           |
| 19  | `fee_config`                           | `Pubkey`           |
| 20  | `fee_program`                          | `Pubkey`           |
| 21… | `remaining`                            | `Vec<AccountMeta>` |

### `SetCoinCreator`

> _From the program's IDL:_
>
> Sets Pool::coin_creator from Metaplex metadata creator or\
> BondingCurve::creator

Discriminator `d295802dbc3a4eaf` · data `SetCoinCreator` · accounts `SetCoinCreatorInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `SetCoinCreatorInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `pool`            | `Pubkey`           |
| 1  | `metadata`        | `Pubkey`           |
| 2  | `bonding_curve`   | `Pubkey`           |
| 3  | `event_authority` | `Pubkey`           |
| 4  | `program`         | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `SetReservedFeeRecipients`

Discriminator `6faca2e87259d58e` · data `SetReservedFeeRecipients` · accounts `SetReservedFeeRecipientsInstructionAccounts`.

| Field           | Type     |
| --------------- | -------- |
| `whitelist_pda` | `Pubkey` |

Required accounts: 4; extras go to `remaining`.

Fields of `SetReservedFeeRecipientsInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `global_config`   | `Pubkey`           |
| 1  | `admin`           | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `SyncUserVolumeAccumulator`

Discriminator `561fc057a3574fee` · data `SyncUserVolumeAccumulator` · accounts `SyncUserVolumeAccumulatorInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `SyncUserVolumeAccumulatorInstructionAccounts`, in account order:

| #  | Field                       | Type               |
| -- | --------------------------- | ------------------ |
| 0  | `user`                      | `Pubkey`           |
| 1  | `global_volume_accumulator` | `Pubkey`           |
| 2  | `user_volume_accumulator`   | `Pubkey`           |
| 3  | `event_authority`           | `Pubkey`           |
| 4  | `program`                   | `Pubkey`           |
| 5… | `remaining`                 | `Vec<AccountMeta>` |

### `ToggleCashbackEnabled`

Discriminator `7367e0ffbd5956c3` · data `ToggleCashbackEnabled` · accounts `ToggleCashbackEnabledInstructionAccounts`.

| Field     | Type   |
| --------- | ------ |
| `enabled` | `bool` |

Required accounts: 4; extras go to `remaining`.

Fields of `ToggleCashbackEnabledInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `ToggleMayhemMode`

Discriminator `01096fd0641fffa3` · data `ToggleMayhemMode` · accounts `ToggleMayhemModeInstructionAccounts`.

| Field     | Type   |
| --------- | ------ |
| `enabled` | `bool` |

Required accounts: 4; extras go to `remaining`.

Fields of `ToggleMayhemModeInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `TransferCreatorFeesToPump`

> _From the program's IDL:_
>
> Transfer creator fees to pump creator vault\
> If coin creator fees are currently below rent.minimum_balance(TokenAccount::LEN) The transfer will be skipped

Discriminator `8b348655e4e56cf1` · data `TransferCreatorFeesToPump` · accounts `TransferCreatorFeesToPumpInstructionAccounts`.

No data fields.

Required accounts: 10; extras go to `remaining`.

Fields of `TransferCreatorFeesToPumpInstructionAccounts`, in account order:

| #   | Field                          | Type               |
| --- | ------------------------------ | ------------------ |
| 0   | `wsol_mint`                    | `Pubkey`           |
| 1   | `token_program`                | `Pubkey`           |
| 2   | `system_program`               | `Pubkey`           |
| 3   | `associated_token_program`     | `Pubkey`           |
| 4   | `coin_creator`                 | `Pubkey`           |
| 5   | `coin_creator_vault_authority` | `Pubkey`           |
| 6   | `coin_creator_vault_ata`       | `Pubkey`           |
| 7   | `pump_creator_vault`           | `Pubkey`           |
| 8   | `event_authority`              | `Pubkey`           |
| 9   | `program`                      | `Pubkey`           |
| 10… | `remaining`                    | `Vec<AccountMeta>` |

### `UpdateAdmin`

Discriminator `a1b028d53cb8b3e4` · data `UpdateAdmin` · accounts `UpdateAdminInstructionAccounts`.

No data fields.

Required accounts: 5; extras go to `remaining`.

Fields of `UpdateAdminInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `new_admin`       | `Pubkey`           |
| 3  | `event_authority` | `Pubkey`           |
| 4  | `program`         | `Pubkey`           |
| 5… | `remaining`       | `Vec<AccountMeta>` |

### `UpdateFeeConfig`

Discriminator `68b867f258976b14` · data `UpdateFeeConfig` · accounts `UpdateFeeConfigInstructionAccounts`.

| Field                              | Type          |
| ---------------------------------- | ------------- |
| `lp_fee_basis_points`              | `u64`         |
| `protocol_fee_basis_points`        | `u64`         |
| `protocol_fee_recipients`          | `[Pubkey; 8]` |
| `coin_creator_fee_basis_points`    | `u64`         |
| `admin_set_coin_creator_authority` | `Pubkey`      |

Required accounts: 4; extras go to `remaining`.

Fields of `UpdateFeeConfigInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `admin`           | `Pubkey`           |
| 1  | `global_config`   | `Pubkey`           |
| 2  | `event_authority` | `Pubkey`           |
| 3  | `program`         | `Pubkey`           |
| 4… | `remaining`       | `Vec<AccountMeta>` |

### `Withdraw`

Discriminator `b712469c946da122` · data `Withdraw` · accounts `WithdrawInstructionAccounts`.

| Field                  | Type  |
| ---------------------- | ----- |
| `lp_token_amount_in`   | `u64` |
| `min_base_amount_out`  | `u64` |
| `min_quote_amount_out` | `u64` |

Required accounts: 15; extras go to `remaining`.

Fields of `WithdrawInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `global_config`            | `Pubkey`           |
| 2   | `user`                     | `Pubkey`           |
| 3   | `base_mint`                | `Pubkey`           |
| 4   | `quote_mint`               | `Pubkey`           |
| 5   | `lp_mint`                  | `Pubkey`           |
| 6   | `user_base_token_account`  | `Pubkey`           |
| 7   | `user_quote_token_account` | `Pubkey`           |
| 8   | `user_pool_token_account`  | `Pubkey`           |
| 9   | `pool_base_token_account`  | `Pubkey`           |
| 10  | `pool_quote_token_account` | `Pubkey`           |
| 11  | `token_program`            | `Pubkey`           |
| 12  | `token2022_program`        | `Pubkey`           |
| 13  | `event_authority`          | `Pubkey`           |
| 14  | `program`                  | `Pubkey`           |
| 15… | `remaining`                | `Vec<AccountMeta>` |

### `CpiEvent`

Anchor self-CPI that carries one of the program's [events](#events). `data` is the `CpiEvent` enum.

Discriminator `e445a52e51cb9a1d` · data `CpiEvent` · accounts `CpiEventInstructionAccounts`.

Required accounts: 2; extras go to `remaining`.

Fields of `CpiEventInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `program`         | `Pubkey`           |
| 1  | `event_authority` | `Pubkey`           |
| 2… | `remaining`       | `Vec<AccountMeta>` |

## Accounts

Variants of `PumpSwapAccount`. Each wraps a boxed struct from `carbon_pump_swap_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `BondingCurve`

Discriminator `17b7f83760d8ac60` · `accounts::bonding_curve::BondingCurve`.

| Field                    | Type     |
| ------------------------ | -------- |
| `virtual_token_reserves` | `u64`    |
| `virtual_sol_reserves`   | `u64`    |
| `real_token_reserves`    | `u64`    |
| `real_sol_reserves`      | `u64`    |
| `token_total_supply`     | `u64`    |
| `complete`               | `bool`   |
| `creator`                | `Pubkey` |
| `is_mayhem_mode`         | `bool`   |
| `is_cashback_coin`       | `bool`   |

### `FeeConfig`

Discriminator `8f3492bbdb7b4c9b` · `accounts::fee_config::FeeConfig`.

| Field       | Type                       |
| ----------- | -------------------------- |
| `bump`      | `u8`                       |
| `admin`     | `Pubkey`                   |
| `flat_fees` | [`Fees`](#fees)            |
| `fee_tiers` | [`Vec<FeeTier>`](#feetier) |

### `GlobalConfig`

Discriminator `95089ccaa0fcb0d9` · `accounts::global_config::GlobalConfig`.

| Field                              | Type          | Description                                                                                                                                                  |
| ---------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `admin`                            | `Pubkey`      | The admin pubkey                                                                                                                                             |
| `lp_fee_basis_points`              | `u64`         |                                                                                                                                                              |
| `protocol_fee_basis_points`        | `u64`         |                                                                                                                                                              |
| `disable_flags`                    | `u8`          | Flags to disable certain functionality bit 0 - Disable create pool bit 1 - Disable deposit bit 2 - Disable withdraw bit 3 - Disable buy bit 4 - Disable sell |
| `protocol_fee_recipients`          | `[Pubkey; 8]` | Addresses of the protocol fee recipients                                                                                                                     |
| `coin_creator_fee_basis_points`    | `u64`         |                                                                                                                                                              |
| `admin_set_coin_creator_authority` | `Pubkey`      | The admin authority for setting coin creators                                                                                                                |
| `whitelist_pda`                    | `Pubkey`      |                                                                                                                                                              |
| `reserved_fee_recipient`           | `Pubkey`      |                                                                                                                                                              |
| `mayhem_mode_enabled`              | `bool`        |                                                                                                                                                              |
| `reserved_fee_recipients`          | `[Pubkey; 7]` |                                                                                                                                                              |
| `is_cashback_enabled`              | `bool`        |                                                                                                                                                              |

### `GlobalVolumeAccumulator`

Discriminator `ca2af62b8ebe1eff` · `accounts::global_volume_accumulator::GlobalVolumeAccumulator`.

| Field                | Type        |
| -------------------- | ----------- |
| `start_time`         | `i64`       |
| `end_time`           | `i64`       |
| `seconds_in_a_day`   | `i64`       |
| `mint`               | `Pubkey`    |
| `total_token_supply` | `[u64; 30]` |
| `sol_volumes`        | `[u64; 30]` |

### `Pool`

Discriminator `f19a6d0411b16dbc` · `accounts::pool::Pool`.

| Field                      | Type     | Description                                        |
| -------------------------- | -------- | -------------------------------------------------- |
| `pool_bump`                | `u8`     |                                                    |
| `index`                    | `u16`    |                                                    |
| `creator`                  | `Pubkey` |                                                    |
| `base_mint`                | `Pubkey` |                                                    |
| `quote_mint`               | `Pubkey` |                                                    |
| `lp_mint`                  | `Pubkey` |                                                    |
| `pool_base_token_account`  | `Pubkey` |                                                    |
| `pool_quote_token_account` | `Pubkey` |                                                    |
| `lp_supply`                | `u64`    | True circulating supply without burns and lock-ups |
| `coin_creator`             | `Pubkey` |                                                    |
| `is_mayhem_mode`           | `bool`   |                                                    |
| `is_cashback_coin`         | `bool`   |                                                    |

### `SharingConfig`

Discriminator `d84a0900388c5d4b` · `accounts::sharing_config::SharingConfig`.

| Field           | Type                               |
| --------------- | ---------------------------------- |
| `bump`          | `u8`                               |
| `version`       | `u8`                               |
| `status`        | [`ConfigStatus`](#configstatus)    |
| `mint`          | `Pubkey`                           |
| `admin`         | `Pubkey`                           |
| `admin_revoked` | `bool`                             |
| `shareholders`  | [`Vec<Shareholder>`](#shareholder) |

### `UserVolumeAccumulator`

Discriminator `56ff700e66359afa` · `accounts::user_volume_accumulator::UserVolumeAccumulator`.

| Field                      | Type     |
| -------------------------- | -------- |
| `user`                     | `Pubkey` |
| `needs_claim`              | `bool`   |
| `total_unclaimed_tokens`   | `u64`    |
| `total_claimed_tokens`     | `u64`    |
| `current_sol_volume`       | `u64`    |
| `last_update_timestamp`    | `i64`    |
| `has_total_claimed_tokens` | `bool`   |
| `cashback_earned`          | `u64`    |
| `total_cashback_claimed`   | `u64`    |

## Events

Variants of `instructions::CpiEvent`, decoded from the `CpiEvent` instruction. Each wraps a struct from `carbon_pump_swap_decoder::events::<module>`. The discriminator is the 8-byte event discriminator that follows the `e445a52e51cb9a1d` CPI-event tag.

### `AdminSetCoinCreatorEvent`

Discriminator `2ddc5d181961ac68` · `events::admin_set_coin_creator_event::AdminSetCoinCreatorEventEvent`.

| Field                              | Type     |
| ---------------------------------- | -------- |
| `timestamp`                        | `i64`    |
| `admin_set_coin_creator_authority` | `Pubkey` |
| `base_mint`                        | `Pubkey` |
| `pool`                             | `Pubkey` |
| `old_coin_creator`                 | `Pubkey` |
| `new_coin_creator`                 | `Pubkey` |

### `AdminUpdateTokenIncentivesEvent`

Discriminator `93fa6c78f71d43de` · `events::admin_update_token_incentives_event::AdminUpdateTokenIncentivesEventEvent`.

| Field                  | Type     |
| ---------------------- | -------- |
| `start_time`           | `i64`    |
| `end_time`             | `i64`    |
| `day_number`           | `u64`    |
| `token_supply_per_day` | `u64`    |
| `mint`                 | `Pubkey` |
| `seconds_in_a_day`     | `i64`    |
| `timestamp`            | `i64`    |

### `BuyEvent`

Discriminator `67f4521f2cf57777` · `events::buy_event::BuyEventEvent`.

| Field                                  | Type     |
| -------------------------------------- | -------- |
| `timestamp`                            | `i64`    |
| `base_amount_out`                      | `u64`    |
| `max_quote_amount_in`                  | `u64`    |
| `user_base_token_reserves`             | `u64`    |
| `user_quote_token_reserves`            | `u64`    |
| `pool_base_token_reserves`             | `u64`    |
| `pool_quote_token_reserves`            | `u64`    |
| `quote_amount_in`                      | `u64`    |
| `lp_fee_basis_points`                  | `u64`    |
| `lp_fee`                               | `u64`    |
| `protocol_fee_basis_points`            | `u64`    |
| `protocol_fee`                         | `u64`    |
| `quote_amount_in_with_lp_fee`          | `u64`    |
| `user_quote_amount_in`                 | `u64`    |
| `pool`                                 | `Pubkey` |
| `user`                                 | `Pubkey` |
| `user_base_token_account`              | `Pubkey` |
| `user_quote_token_account`             | `Pubkey` |
| `protocol_fee_recipient`               | `Pubkey` |
| `protocol_fee_recipient_token_account` | `Pubkey` |
| `coin_creator`                         | `Pubkey` |
| `coin_creator_fee_basis_points`        | `u64`    |
| `coin_creator_fee`                     | `u64`    |
| `track_volume`                         | `bool`   |
| `total_unclaimed_tokens`               | `u64`    |
| `total_claimed_tokens`                 | `u64`    |
| `current_sol_volume`                   | `u64`    |
| `last_update_timestamp`                | `i64`    |
| `min_base_amount_out`                  | `u64`    |
| `ix_name`                              | `String` |
| `cashback_fee_basis_points`            | `u64`    |
| `cashback`                             | `u64`    |

### `ClaimCashbackEvent`

Discriminator `e2d6f62107f293e5` · `events::claim_cashback_event::ClaimCashbackEventEvent`.

| Field                   | Type     |
| ----------------------- | -------- |
| `user`                  | `Pubkey` |
| `amount`                | `u64`    |
| `timestamp`             | `i64`    |
| `total_claimed`         | `u64`    |
| `total_cashback_earned` | `u64`    |

### `ClaimTokenIncentivesEvent`

Discriminator `4facf631cd5bcee8` · `events::claim_token_incentives_event::ClaimTokenIncentivesEventEvent`.

| Field                  | Type     |
| ---------------------- | -------- |
| `user`                 | `Pubkey` |
| `mint`                 | `Pubkey` |
| `amount`               | `u64`    |
| `timestamp`            | `i64`    |
| `total_claimed_tokens` | `u64`    |
| `current_sol_volume`   | `u64`    |

### `CloseUserVolumeAccumulatorEvent`

Discriminator `929fbdac925838f4` · `events::close_user_volume_accumulator_event::CloseUserVolumeAccumulatorEventEvent`.

| Field                    | Type     |
| ------------------------ | -------- |
| `user`                   | `Pubkey` |
| `timestamp`              | `i64`    |
| `total_unclaimed_tokens` | `u64`    |
| `total_claimed_tokens`   | `u64`    |
| `current_sol_volume`     | `u64`    |
| `last_update_timestamp`  | `i64`    |

### `CollectCoinCreatorFeeEvent`

Discriminator `e8f5c2eeeada3a59` · `events::collect_coin_creator_fee_event::CollectCoinCreatorFeeEventEvent`.

| Field                        | Type     |
| ---------------------------- | -------- |
| `timestamp`                  | `i64`    |
| `coin_creator`               | `Pubkey` |
| `coin_creator_fee`           | `u64`    |
| `coin_creator_vault_ata`     | `Pubkey` |
| `coin_creator_token_account` | `Pubkey` |

### `CreateConfigEvent`

Discriminator `6b34598137e25116` · `events::create_config_event::CreateConfigEventEvent`.

| Field                              | Type          |
| ---------------------------------- | ------------- |
| `timestamp`                        | `i64`         |
| `admin`                            | `Pubkey`      |
| `lp_fee_basis_points`              | `u64`         |
| `protocol_fee_basis_points`        | `u64`         |
| `protocol_fee_recipients`          | `[Pubkey; 8]` |
| `coin_creator_fee_basis_points`    | `u64`         |
| `admin_set_coin_creator_authority` | `Pubkey`      |

### `CreatePoolEvent`

Discriminator `b1310cd2a076a774` · `events::create_pool_event::CreatePoolEventEvent`.

| Field                      | Type     |
| -------------------------- | -------- |
| `timestamp`                | `i64`    |
| `index`                    | `u16`    |
| `creator`                  | `Pubkey` |
| `base_mint`                | `Pubkey` |
| `quote_mint`               | `Pubkey` |
| `base_mint_decimals`       | `u8`     |
| `quote_mint_decimals`      | `u8`     |
| `base_amount_in`           | `u64`    |
| `quote_amount_in`          | `u64`    |
| `pool_base_amount`         | `u64`    |
| `pool_quote_amount`        | `u64`    |
| `minimum_liquidity`        | `u64`    |
| `initial_liquidity`        | `u64`    |
| `lp_token_amount_out`      | `u64`    |
| `pool_bump`                | `u8`     |
| `pool`                     | `Pubkey` |
| `lp_mint`                  | `Pubkey` |
| `user_base_token_account`  | `Pubkey` |
| `user_quote_token_account` | `Pubkey` |
| `coin_creator`             | `Pubkey` |
| `is_mayhem_mode`           | `bool`   |

### `DepositEvent`

Discriminator `78f83d531f8e6b90` · `events::deposit_event::DepositEventEvent`.

| Field                       | Type     |
| --------------------------- | -------- |
| `timestamp`                 | `i64`    |
| `lp_token_amount_out`       | `u64`    |
| `max_base_amount_in`        | `u64`    |
| `max_quote_amount_in`       | `u64`    |
| `user_base_token_reserves`  | `u64`    |
| `user_quote_token_reserves` | `u64`    |
| `pool_base_token_reserves`  | `u64`    |
| `pool_quote_token_reserves` | `u64`    |
| `base_amount_in`            | `u64`    |
| `quote_amount_in`           | `u64`    |
| `lp_mint_supply`            | `u64`    |
| `pool`                      | `Pubkey` |
| `user`                      | `Pubkey` |
| `user_base_token_account`   | `Pubkey` |
| `user_quote_token_account`  | `Pubkey` |
| `user_pool_token_account`   | `Pubkey` |

### `DisableEvent`

Discriminator `6bfdc14ce4ca1b68` · `events::disable_event::DisableEventEvent`.

| Field                 | Type     |
| --------------------- | -------- |
| `timestamp`           | `i64`    |
| `admin`               | `Pubkey` |
| `disable_create_pool` | `bool`   |
| `disable_deposit`     | `bool`   |
| `disable_withdraw`    | `bool`   |
| `disable_buy`         | `bool`   |
| `disable_sell`        | `bool`   |

### `ExtendAccountEvent`

Discriminator `6161d7905d92167c` · `events::extend_account_event::ExtendAccountEventEvent`.

| Field          | Type     |
| -------------- | -------- |
| `timestamp`    | `i64`    |
| `account`      | `Pubkey` |
| `user`         | `Pubkey` |
| `current_size` | `u64`    |
| `new_size`     | `u64`    |

### `InitUserVolumeAccumulatorEvent`

Discriminator `86240d48e86582d8` · `events::init_user_volume_accumulator_event::InitUserVolumeAccumulatorEventEvent`.

| Field       | Type     |
| ----------- | -------- |
| `payer`     | `Pubkey` |
| `user`      | `Pubkey` |
| `timestamp` | `i64`    |

### `MigratePoolCoinCreatorEvent`

Discriminator `aadd52c793a5f72e` · `events::migrate_pool_coin_creator_event::MigratePoolCoinCreatorEventEvent`.

| Field              | Type     |
| ------------------ | -------- |
| `timestamp`        | `i64`    |
| `base_mint`        | `Pubkey` |
| `pool`             | `Pubkey` |
| `sharing_config`   | `Pubkey` |
| `old_coin_creator` | `Pubkey` |
| `new_coin_creator` | `Pubkey` |

### `ReservedFeeRecipientsEvent`

Discriminator `2bbcfa12dd4bbb5f` · `events::reserved_fee_recipients_event::ReservedFeeRecipientsEventEvent`.

| Field                     | Type          |
| ------------------------- | ------------- |
| `timestamp`               | `i64`         |
| `reserved_fee_recipient`  | `Pubkey`      |
| `reserved_fee_recipients` | `[Pubkey; 7]` |

### `SellEvent`

Discriminator `3e2f370aa503dc2a` · `events::sell_event::SellEventEvent`.

| Field                                  | Type     |
| -------------------------------------- | -------- |
| `timestamp`                            | `i64`    |
| `base_amount_in`                       | `u64`    |
| `min_quote_amount_out`                 | `u64`    |
| `user_base_token_reserves`             | `u64`    |
| `user_quote_token_reserves`            | `u64`    |
| `pool_base_token_reserves`             | `u64`    |
| `pool_quote_token_reserves`            | `u64`    |
| `quote_amount_out`                     | `u64`    |
| `lp_fee_basis_points`                  | `u64`    |
| `lp_fee`                               | `u64`    |
| `protocol_fee_basis_points`            | `u64`    |
| `protocol_fee`                         | `u64`    |
| `quote_amount_out_without_lp_fee`      | `u64`    |
| `user_quote_amount_out`                | `u64`    |
| `pool`                                 | `Pubkey` |
| `user`                                 | `Pubkey` |
| `user_base_token_account`              | `Pubkey` |
| `user_quote_token_account`             | `Pubkey` |
| `protocol_fee_recipient`               | `Pubkey` |
| `protocol_fee_recipient_token_account` | `Pubkey` |
| `coin_creator`                         | `Pubkey` |
| `coin_creator_fee_basis_points`        | `u64`    |
| `coin_creator_fee`                     | `u64`    |
| `cashback_fee_basis_points`            | `u64`    |
| `cashback`                             | `u64`    |

### `SetBondingCurveCoinCreatorEvent`

Discriminator `f2e7eb664163bdd3` · `events::set_bonding_curve_coin_creator_event::SetBondingCurveCoinCreatorEventEvent`.

| Field           | Type     |
| --------------- | -------- |
| `timestamp`     | `i64`    |
| `base_mint`     | `Pubkey` |
| `pool`          | `Pubkey` |
| `bonding_curve` | `Pubkey` |
| `coin_creator`  | `Pubkey` |

### `SetMetaplexCoinCreatorEvent`

Discriminator `966bc77b7ccf66e4` · `events::set_metaplex_coin_creator_event::SetMetaplexCoinCreatorEventEvent`.

| Field          | Type     |
| -------------- | -------- |
| `timestamp`    | `i64`    |
| `base_mint`    | `Pubkey` |
| `pool`         | `Pubkey` |
| `metadata`     | `Pubkey` |
| `coin_creator` | `Pubkey` |

### `SyncUserVolumeAccumulatorEvent`

Discriminator `c57aa77c74515bff` · `events::sync_user_volume_accumulator_event::SyncUserVolumeAccumulatorEventEvent`.

| Field                         | Type     |
| ----------------------------- | -------- |
| `user`                        | `Pubkey` |
| `total_claimed_tokens_before` | `u64`    |
| `total_claimed_tokens_after`  | `u64`    |
| `timestamp`                   | `i64`    |

### `UpdateAdminEvent`

Discriminator `e198ab57f63f42ea` · `events::update_admin_event::UpdateAdminEventEvent`.

| Field       | Type     |
| ----------- | -------- |
| `timestamp` | `i64`    |
| `admin`     | `Pubkey` |
| `new_admin` | `Pubkey` |

### `UpdateFeeConfigEvent`

Discriminator `5a1741233ef4bcd0` · `events::update_fee_config_event::UpdateFeeConfigEventEvent`.

| Field                              | Type          |
| ---------------------------------- | ------------- |
| `timestamp`                        | `i64`         |
| `admin`                            | `Pubkey`      |
| `lp_fee_basis_points`              | `u64`         |
| `protocol_fee_basis_points`        | `u64`         |
| `protocol_fee_recipients`          | `[Pubkey; 8]` |
| `coin_creator_fee_basis_points`    | `u64`         |
| `admin_set_coin_creator_authority` | `Pubkey`      |

### `WithdrawEvent`

Discriminator `1609851aa02c47c0` · `events::withdraw_event::WithdrawEventEvent`.

| Field                       | Type     |
| --------------------------- | -------- |
| `timestamp`                 | `i64`    |
| `lp_token_amount_in`        | `u64`    |
| `min_base_amount_out`       | `u64`    |
| `min_quote_amount_out`      | `u64`    |
| `user_base_token_reserves`  | `u64`    |
| `user_quote_token_reserves` | `u64`    |
| `pool_base_token_reserves`  | `u64`    |
| `pool_quote_token_reserves` | `u64`    |
| `base_amount_out`           | `u64`    |
| `quote_amount_out`          | `u64`    |
| `lp_mint_supply`            | `u64`    |
| `pool`                      | `Pubkey` |
| `user`                      | `Pubkey` |
| `user_base_token_account`   | `Pubkey` |
| `user_quote_token_account`  | `Pubkey` |
| `user_pool_token_account`   | `Pubkey` |

## Types

Types used by the instructions, accounts and events above, exported from `carbon_pump_swap_decoder::types`.

### `AdminSetCoinCreatorEvent`

Struct `types::AdminSetCoinCreatorEvent`. Same fields as the [`AdminSetCoinCreatorEvent`](#adminsetcoincreatorevent) event.

### `AdminUpdateTokenIncentivesEvent`

Struct `types::AdminUpdateTokenIncentivesEvent`. Same fields as the [`AdminUpdateTokenIncentivesEvent`](#adminupdatetokenincentivesevent) event.

### `BuyEvent`

> _From the program's IDL:_
>
> ix_name: "buy" | "buy_exact_quote_in"

Struct `types::BuyEvent`. Same fields as the [`BuyEvent`](#buyevent) event.

### `ClaimCashbackEvent`

Struct `types::ClaimCashbackEvent`. Same fields as the [`ClaimCashbackEvent`](#claimcashbackevent) event.

### `ClaimTokenIncentivesEvent`

Struct `types::ClaimTokenIncentivesEvent`. Same fields as the [`ClaimTokenIncentivesEvent`](#claimtokenincentivesevent) event.

### `CloseUserVolumeAccumulatorEvent`

Struct `types::CloseUserVolumeAccumulatorEvent`. Same fields as the [`CloseUserVolumeAccumulatorEvent`](#closeuservolumeaccumulatorevent) event.

### `CollectCoinCreatorFeeEvent`

Struct `types::CollectCoinCreatorFeeEvent`. Same fields as the [`CollectCoinCreatorFeeEvent`](#collectcoincreatorfeeevent) event.

### `ConfigStatus`

Enum `types::ConfigStatus`.

| Variant  |
| -------- |
| `Paused` |
| `Active` |

### `CreateConfigEvent`

Struct `types::CreateConfigEvent`. Same fields as the [`CreateConfigEvent`](#createconfigevent) event.

### `CreatePoolEvent`

Struct `types::CreatePoolEvent`. Same fields as the [`CreatePoolEvent`](#createpoolevent) event.

### `DepositEvent`

Struct `types::DepositEvent`. Same fields as the [`DepositEvent`](#depositevent) event.

### `DisableEvent`

Struct `types::DisableEvent`. Same fields as the [`DisableEvent`](#disableevent) event.

### `ExtendAccountEvent`

Struct `types::ExtendAccountEvent`. Same fields as the [`ExtendAccountEvent`](#extendaccountevent) event.

### `Fees`

Struct `types::Fees`.

| Field              | Type  |
| ------------------ | ----- |
| `lp_fee_bps`       | `u64` |
| `protocol_fee_bps` | `u64` |
| `creator_fee_bps`  | `u64` |

### `FeeTier`

Struct `types::FeeTier`.

| Field                           | Type            |
| ------------------------------- | --------------- |
| `market_cap_lamports_threshold` | `u128`          |
| `fees`                          | [`Fees`](#fees) |

### `InitUserVolumeAccumulatorEvent`

Struct `types::InitUserVolumeAccumulatorEvent`. Same fields as the [`InitUserVolumeAccumulatorEvent`](#inituservolumeaccumulatorevent) event.

### `MigratePoolCoinCreatorEvent`

Struct `types::MigratePoolCoinCreatorEvent`. Same fields as the [`MigratePoolCoinCreatorEvent`](#migratepoolcoincreatorevent) event.

### `OptionBool`

Tuple struct `types::OptionBool` (`bool`).

### `ReservedFeeRecipientsEvent`

Struct `types::ReservedFeeRecipientsEvent`. Same fields as the [`ReservedFeeRecipientsEvent`](#reservedfeerecipientsevent) event.

### `SellEvent`

Struct `types::SellEvent`. Same fields as the [`SellEvent`](#sellevent) event.

### `SetBondingCurveCoinCreatorEvent`

Struct `types::SetBondingCurveCoinCreatorEvent`. Same fields as the [`SetBondingCurveCoinCreatorEvent`](#setbondingcurvecoincreatorevent) event.

### `SetMetaplexCoinCreatorEvent`

Struct `types::SetMetaplexCoinCreatorEvent`. Same fields as the [`SetMetaplexCoinCreatorEvent`](#setmetaplexcoincreatorevent) event.

### `Shareholder`

Struct `types::Shareholder`.

| Field       | Type     |
| ----------- | -------- |
| `address`   | `Pubkey` |
| `share_bps` | `u16`    |

### `SyncUserVolumeAccumulatorEvent`

Struct `types::SyncUserVolumeAccumulatorEvent`. Same fields as the [`SyncUserVolumeAccumulatorEvent`](#syncuservolumeaccumulatorevent) event.

### `UpdateAdminEvent`

Struct `types::UpdateAdminEvent`. Same fields as the [`UpdateAdminEvent`](#updateadminevent) event.

### `UpdateFeeConfigEvent`

Struct `types::UpdateFeeConfigEvent`. Same fields as the [`UpdateFeeConfigEvent`](#updatefeeconfigevent) event.

### `WithdrawEvent`

Struct `types::WithdrawEvent`. Same fields as the [`WithdrawEvent`](#withdrawevent) event.

---

Carbon 2.0.0 documentation · Web: https://carbon.sevenlabs.org/decoders/pump-swap · Last updated 2026-11-09 · Index of all pages: https://carbon.sevenlabs.org/llms.txt
