# Meteora Pools decoder (Carbon 2.0)

> Decode Meteora Pools instructions, accounts and events in Rust with carbon-meteora-pools-decoder 2.0.0. Program ID Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB.

`carbon-meteora-pools-decoder` decodes the instructions, accounts and events of the Meteora Pools program (`Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB`): 26 instructions, 3 account types, 18 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-meteora-pools-decoder`](https://crates.io/crates/carbon-meteora-pools-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-meteora-pools-decoder@2.0.0`                                                                      |
| Program ID       | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` (`carbon_meteora_pools_decoder::PROGRAM_ID`)                         |
| Category         | [DEX & AMM](https://carbon.sevenlabs.org/decoders/dex-and-amm.md)                                                   |
| Decoder          | `carbon_meteora_pools_decoder::MeteoraPoolsDecoder`                                                                 |
| Instruction enum | `instructions::MeteoraPoolsInstruction`                                                                             |
| Account enum     | `accounts::MeteoraPoolsAccount`                                                                                     |
| Event enum       | `instructions::CpiEvent`                                                                                            |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                            |
| API docs         | [docs.rs/carbon-meteora-pools-decoder/2.0.0](https://docs.rs/carbon-meteora-pools-decoder/2.0.0)                    |
| Source           | [decoders/meteora-pools-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/meteora-pools-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), [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), [PumpSwap](https://carbon.sevenlabs.org/decoders/pump-swap.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).

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 Meteora Pools transactions from the public RPC and prints every decoded `Swap` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-meteora-pools-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_meteora_pools_decoder::{
        instructions::MeteoraPoolsInstruction, MeteoraPoolsDecoder, 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(MeteoraPoolsDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

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

Each `Swap` instruction prints one line with the transaction signature and the decoded `Swap` 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 `MeteoraPoolsInstruction::CpiEvent { data: CpiEvent::AddLiquidity(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_meteora_pools_decoder::{accounts::MeteoraPoolsAccount, MeteoraPoolsDecoder, 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(MeteoraPoolsDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

impl Processor<AccountProcessorInputType<'_, MeteoraPoolsAccount>> for AccountLogger {
    async fn process(
        &mut self,
        input: &AccountProcessorInputType<'_, MeteoraPoolsAccount>,
    ) -> CarbonResult<()> {
        if let MeteoraPoolsAccount::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 `MeteoraPoolsInstruction`. Each is `MeteoraPoolsInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_meteora_pools_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 `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB`.
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.

### `AddBalanceLiquidity`

> _From the program's IDL:_
>
> Deposit tokens to the pool in a balanced ratio.

Discriminator `a8e3323ebdab54b0` · data `AddBalanceLiquidity` · accounts `AddBalanceLiquidityInstructionAccounts`.

| Field                    | Type  |
| ------------------------ | ----- |
| `pool_token_amount`      | `u64` |
| `maximum_token_a_amount` | `u64` |
| `maximum_token_b_amount` | `u64` |

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

Fields of `AddBalanceLiquidityInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `user_pool_lp`    | `Pubkey`           |
| 3   | `a_vault_lp`      | `Pubkey`           |
| 4   | `b_vault_lp`      | `Pubkey`           |
| 5   | `a_vault`         | `Pubkey`           |
| 6   | `b_vault`         | `Pubkey`           |
| 7   | `a_vault_lp_mint` | `Pubkey`           |
| 8   | `b_vault_lp_mint` | `Pubkey`           |
| 9   | `a_token_vault`   | `Pubkey`           |
| 10  | `b_token_vault`   | `Pubkey`           |
| 11  | `user_a_token`    | `Pubkey`           |
| 12  | `user_b_token`    | `Pubkey`           |
| 13  | `user`            | `Pubkey`           |
| 14  | `vault_program`   | `Pubkey`           |
| 15  | `token_program`   | `Pubkey`           |
| 16… | `remaining`       | `Vec<AccountMeta>` |

### `AddImbalanceLiquidity`

> _From the program's IDL:_
>
> Deposit tokens to the pool in an imbalance ratio. Only supported by pool with stable swap curve.

Discriminator `4f237a54ad0f5dbf` · data `AddImbalanceLiquidity` · accounts `AddImbalanceLiquidityInstructionAccounts`.

| Field                       | Type  |
| --------------------------- | ----- |
| `minimum_pool_token_amount` | `u64` |
| `token_a_amount`            | `u64` |
| `token_b_amount`            | `u64` |

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

Fields of `AddImbalanceLiquidityInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `user_pool_lp`    | `Pubkey`           |
| 3   | `a_vault_lp`      | `Pubkey`           |
| 4   | `b_vault_lp`      | `Pubkey`           |
| 5   | `a_vault`         | `Pubkey`           |
| 6   | `b_vault`         | `Pubkey`           |
| 7   | `a_vault_lp_mint` | `Pubkey`           |
| 8   | `b_vault_lp_mint` | `Pubkey`           |
| 9   | `a_token_vault`   | `Pubkey`           |
| 10  | `b_token_vault`   | `Pubkey`           |
| 11  | `user_a_token`    | `Pubkey`           |
| 12  | `user_b_token`    | `Pubkey`           |
| 13  | `user`            | `Pubkey`           |
| 14  | `vault_program`   | `Pubkey`           |
| 15  | `token_program`   | `Pubkey`           |
| 16… | `remaining`       | `Vec<AccountMeta>` |

### `BootstrapLiquidity`

> _From the program's IDL:_
>
> Bootstrap the pool when liquidity is depleted.

Discriminator `04e4d747e1fd77ce` · data `BootstrapLiquidity` · accounts `BootstrapLiquidityInstructionAccounts`.

| Field            | Type  |
| ---------------- | ----- |
| `token_a_amount` | `u64` |
| `token_b_amount` | `u64` |

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

Fields of `BootstrapLiquidityInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `user_pool_lp`    | `Pubkey`           |
| 3   | `a_vault_lp`      | `Pubkey`           |
| 4   | `b_vault_lp`      | `Pubkey`           |
| 5   | `a_vault`         | `Pubkey`           |
| 6   | `b_vault`         | `Pubkey`           |
| 7   | `a_vault_lp_mint` | `Pubkey`           |
| 8   | `b_vault_lp_mint` | `Pubkey`           |
| 9   | `a_token_vault`   | `Pubkey`           |
| 10  | `b_token_vault`   | `Pubkey`           |
| 11  | `user_a_token`    | `Pubkey`           |
| 12  | `user_b_token`    | `Pubkey`           |
| 13  | `user`            | `Pubkey`           |
| 14  | `vault_program`   | `Pubkey`           |
| 15  | `token_program`   | `Pubkey`           |
| 16… | `remaining`       | `Vec<AccountMeta>` |

### `ClaimFee`

> _From the program's IDL:_
>
> Claim fee

Discriminator `a9204f8988e84689` · data `ClaimFee` · accounts `ClaimFeeInstructionAccounts`.

| Field        | Type  |
| ------------ | ----- |
| `max_amount` | `u64` |

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

Fields of `ClaimFeeInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `lock_escrow`     | `Pubkey`           |
| 3   | `owner`           | `Pubkey`           |
| 4   | `source_tokens`   | `Pubkey`           |
| 5   | `escrow_vault`    | `Pubkey`           |
| 6   | `token_program`   | `Pubkey`           |
| 7   | `a_token_vault`   | `Pubkey`           |
| 8   | `b_token_vault`   | `Pubkey`           |
| 9   | `a_vault`         | `Pubkey`           |
| 10  | `b_vault`         | `Pubkey`           |
| 11  | `a_vault_lp`      | `Pubkey`           |
| 12  | `b_vault_lp`      | `Pubkey`           |
| 13  | `a_vault_lp_mint` | `Pubkey`           |
| 14  | `b_vault_lp_mint` | `Pubkey`           |
| 15  | `user_a_token`    | `Pubkey`           |
| 16  | `user_b_token`    | `Pubkey`           |
| 17  | `vault_program`   | `Pubkey`           |
| 18… | `remaining`       | `Vec<AccountMeta>` |

### `CloseConfig`

> _From the program's IDL:_
>
> Close config

Discriminator `9109489d5f7d3d55` · data `CloseConfig` · accounts `CloseConfigInstructionAccounts`.

No data fields.

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

Fields of `CloseConfigInstructionAccounts`, in account order:

| #  | Field           | Type               |
| -- | --------------- | ------------------ |
| 0  | `config`        | `Pubkey`           |
| 1  | `admin`         | `Pubkey`           |
| 2  | `rent_receiver` | `Pubkey`           |
| 3… | `remaining`     | `Vec<AccountMeta>` |

### `CreateConfig`

> _From the program's IDL:_
>
> Create config

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

| Field               | Type                                    |
| ------------------- | --------------------------------------- |
| `config_parameters` | [`ConfigParameters`](#configparameters) |

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

Fields of `CreateConfigInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `config`         | `Pubkey`           |
| 1  | `admin`          | `Pubkey`           |
| 2  | `system_program` | `Pubkey`           |
| 3… | `remaining`      | `Vec<AccountMeta>` |

### `CreateLockEscrow`

> _From the program's IDL:_
>
> Create lock account

Discriminator `3657a51345e3dae0` · data `CreateLockEscrow` · accounts `CreateLockEscrowInstructionAccounts`.

No data fields.

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

Fields of `CreateLockEscrowInstructionAccounts`, in account order:

| #  | Field            | Type               |
| -- | ---------------- | ------------------ |
| 0  | `pool`           | `Pubkey`           |
| 1  | `lock_escrow`    | `Pubkey`           |
| 2  | `owner`          | `Pubkey`           |
| 3  | `lp_mint`        | `Pubkey`           |
| 4  | `payer`          | `Pubkey`           |
| 5  | `system_program` | `Pubkey`           |
| 6… | `remaining`      | `Vec<AccountMeta>` |

### `CreateMintMetadata`

> _From the program's IDL:_
>
> Create mint metadata account for old pools

Discriminator `0d46a829fa64945a` · data `CreateMintMetadata` · accounts `CreateMintMetadataInstructionAccounts`.

No data fields.

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

Fields of `CreateMintMetadataInstructionAccounts`, in account order:

| #  | Field              | Type               |
| -- | ------------------ | ------------------ |
| 0  | `pool`             | `Pubkey`           |
| 1  | `lp_mint`          | `Pubkey`           |
| 2  | `a_vault_lp`       | `Pubkey`           |
| 3  | `mint_metadata`    | `Pubkey`           |
| 4  | `metadata_program` | `Pubkey`           |
| 5  | `system_program`   | `Pubkey`           |
| 6  | `payer`            | `Pubkey`           |
| 7… | `remaining`        | `Vec<AccountMeta>` |

### `EnableOrDisablePool`

> _From the program's IDL:_
>
> Enable or disable a pool. A disabled pool allow only remove balanced liquidity operation.

Discriminator `8006e48337a134a9` · data `EnableOrDisablePool` · accounts `EnableOrDisablePoolInstructionAccounts`.

| Field    | Type   |
| -------- | ------ |
| `enable` | `bool` |

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

Fields of `EnableOrDisablePoolInstructionAccounts`, in account order:

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

### `GetPoolInfo`

> _From the program's IDL:_
>
> Get the general information of the pool.

Discriminator `0930dc6516f04ec8` · data `GetPoolInfo` · accounts `GetPoolInfoInstructionAccounts`.

No data fields.

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

Fields of `GetPoolInfoInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `pool`            | `Pubkey`           |
| 1  | `lp_mint`         | `Pubkey`           |
| 2  | `a_vault_lp`      | `Pubkey`           |
| 3  | `b_vault_lp`      | `Pubkey`           |
| 4  | `a_vault`         | `Pubkey`           |
| 5  | `b_vault`         | `Pubkey`           |
| 6  | `a_vault_lp_mint` | `Pubkey`           |
| 7  | `b_vault_lp_mint` | `Pubkey`           |
| 8… | `remaining`       | `Vec<AccountMeta>` |

### `InitializeCustomizablePermissionlessConstantProductPool`

> _From the program's IDL:_
>
> Initialize permissionless pool with customizable params

Discriminator `9118acc2db7d03be` · data `InitializeCustomizablePermissionlessConstantProductPool` · accounts `InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts`.

| Field            | Type                                        |
| ---------------- | ------------------------------------------- |
| `token_a_amount` | `u64`                                       |
| `token_b_amount` | `u64`                                       |
| `params`         | [`CustomizableParams`](#customizableparams) |

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

Fields of `InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `lp_mint`                  | `Pubkey`           |
| 2   | `token_a_mint`             | `Pubkey`           |
| 3   | `token_b_mint`             | `Pubkey`           |
| 4   | `a_vault`                  | `Pubkey`           |
| 5   | `b_vault`                  | `Pubkey`           |
| 6   | `a_token_vault`            | `Pubkey`           |
| 7   | `b_token_vault`            | `Pubkey`           |
| 8   | `a_vault_lp_mint`          | `Pubkey`           |
| 9   | `b_vault_lp_mint`          | `Pubkey`           |
| 10  | `a_vault_lp`               | `Pubkey`           |
| 11  | `b_vault_lp`               | `Pubkey`           |
| 12  | `payer_token_a`            | `Pubkey`           |
| 13  | `payer_token_b`            | `Pubkey`           |
| 14  | `payer_pool_lp`            | `Pubkey`           |
| 15  | `protocol_token_a_fee`     | `Pubkey`           |
| 16  | `protocol_token_b_fee`     | `Pubkey`           |
| 17  | `payer`                    | `Pubkey`           |
| 18  | `rent`                     | `Pubkey`           |
| 19  | `mint_metadata`            | `Pubkey`           |
| 20  | `metadata_program`         | `Pubkey`           |
| 21  | `vault_program`            | `Pubkey`           |
| 22  | `token_program`            | `Pubkey`           |
| 23  | `associated_token_program` | `Pubkey`           |
| 24  | `system_program`           | `Pubkey`           |
| 25… | `remaining`                | `Vec<AccountMeta>` |

### `InitializePermissionedPool`

> _From the program's IDL:_
>
> Initialize a new permissioned pool.

Discriminator `4d55b29d3230d47e` · data `InitializePermissionedPool` · accounts `InitializePermissionedPoolInstructionAccounts`.

| Field        | Type                      |
| ------------ | ------------------------- |
| `curve_type` | [`CurveType`](#curvetype) |

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

Fields of `InitializePermissionedPoolInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `lp_mint`                  | `Pubkey`           |
| 2   | `token_a_mint`             | `Pubkey`           |
| 3   | `token_b_mint`             | `Pubkey`           |
| 4   | `a_vault`                  | `Pubkey`           |
| 5   | `b_vault`                  | `Pubkey`           |
| 6   | `a_vault_lp_mint`          | `Pubkey`           |
| 7   | `b_vault_lp_mint`          | `Pubkey`           |
| 8   | `a_vault_lp`               | `Pubkey`           |
| 9   | `b_vault_lp`               | `Pubkey`           |
| 10  | `admin_token_a`            | `Pubkey`           |
| 11  | `admin_token_b`            | `Pubkey`           |
| 12  | `admin_pool_lp`            | `Pubkey`           |
| 13  | `protocol_token_a_fee`     | `Pubkey`           |
| 14  | `protocol_token_b_fee`     | `Pubkey`           |
| 15  | `admin`                    | `Pubkey`           |
| 16  | `fee_owner`                | `Pubkey`           |
| 17  | `rent`                     | `Pubkey`           |
| 18  | `mint_metadata`            | `Pubkey`           |
| 19  | `metadata_program`         | `Pubkey`           |
| 20  | `vault_program`            | `Pubkey`           |
| 21  | `token_program`            | `Pubkey`           |
| 22  | `associated_token_program` | `Pubkey`           |
| 23  | `system_program`           | `Pubkey`           |
| 24… | `remaining`                | `Vec<AccountMeta>` |

### `InitializePermissionlessConstantProductPoolWithConfig`

> _From the program's IDL:_
>
> Initialize permissionless pool with config

Discriminator `07a68aabceabecf4` · data `InitializePermissionlessConstantProductPoolWithConfig` · accounts `InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts`.

| Field            | Type  |
| ---------------- | ----- |
| `token_a_amount` | `u64` |
| `token_b_amount` | `u64` |

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

Fields of `InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `config`                   | `Pubkey`           |
| 2   | `lp_mint`                  | `Pubkey`           |
| 3   | `token_a_mint`             | `Pubkey`           |
| 4   | `token_b_mint`             | `Pubkey`           |
| 5   | `a_vault`                  | `Pubkey`           |
| 6   | `b_vault`                  | `Pubkey`           |
| 7   | `a_token_vault`            | `Pubkey`           |
| 8   | `b_token_vault`            | `Pubkey`           |
| 9   | `a_vault_lp_mint`          | `Pubkey`           |
| 10  | `b_vault_lp_mint`          | `Pubkey`           |
| 11  | `a_vault_lp`               | `Pubkey`           |
| 12  | `b_vault_lp`               | `Pubkey`           |
| 13  | `payer_token_a`            | `Pubkey`           |
| 14  | `payer_token_b`            | `Pubkey`           |
| 15  | `payer_pool_lp`            | `Pubkey`           |
| 16  | `protocol_token_a_fee`     | `Pubkey`           |
| 17  | `protocol_token_b_fee`     | `Pubkey`           |
| 18  | `payer`                    | `Pubkey`           |
| 19  | `rent`                     | `Pubkey`           |
| 20  | `mint_metadata`            | `Pubkey`           |
| 21  | `metadata_program`         | `Pubkey`           |
| 22  | `vault_program`            | `Pubkey`           |
| 23  | `token_program`            | `Pubkey`           |
| 24  | `associated_token_program` | `Pubkey`           |
| 25  | `system_program`           | `Pubkey`           |
| 26… | `remaining`                | `Vec<AccountMeta>` |

### `InitializePermissionlessConstantProductPoolWithConfig2`

> _From the program's IDL:_
>
> Initialize permissionless pool with config 2

Discriminator `3095dc823d0b09b2` · data `InitializePermissionlessConstantProductPoolWithConfig2` · accounts `InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts`.

| Field              | Type          |
| ------------------ | ------------- |
| `token_a_amount`   | `u64`         |
| `token_b_amount`   | `u64`         |
| `activation_point` | `Option<u64>` |

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

Fields of `InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `config`                   | `Pubkey`           |
| 2   | `lp_mint`                  | `Pubkey`           |
| 3   | `token_a_mint`             | `Pubkey`           |
| 4   | `token_b_mint`             | `Pubkey`           |
| 5   | `a_vault`                  | `Pubkey`           |
| 6   | `b_vault`                  | `Pubkey`           |
| 7   | `a_token_vault`            | `Pubkey`           |
| 8   | `b_token_vault`            | `Pubkey`           |
| 9   | `a_vault_lp_mint`          | `Pubkey`           |
| 10  | `b_vault_lp_mint`          | `Pubkey`           |
| 11  | `a_vault_lp`               | `Pubkey`           |
| 12  | `b_vault_lp`               | `Pubkey`           |
| 13  | `payer_token_a`            | `Pubkey`           |
| 14  | `payer_token_b`            | `Pubkey`           |
| 15  | `payer_pool_lp`            | `Pubkey`           |
| 16  | `protocol_token_a_fee`     | `Pubkey`           |
| 17  | `protocol_token_b_fee`     | `Pubkey`           |
| 18  | `payer`                    | `Pubkey`           |
| 19  | `rent`                     | `Pubkey`           |
| 20  | `mint_metadata`            | `Pubkey`           |
| 21  | `metadata_program`         | `Pubkey`           |
| 22  | `vault_program`            | `Pubkey`           |
| 23  | `token_program`            | `Pubkey`           |
| 24  | `associated_token_program` | `Pubkey`           |
| 25  | `system_program`           | `Pubkey`           |
| 26… | `remaining`                | `Vec<AccountMeta>` |

### `InitializePermissionlessPool`

> _From the program's IDL:_
>
> Initialize a new permissionless pool.

Discriminator `76ad299dad486167` · data `InitializePermissionlessPool` · accounts `InitializePermissionlessPoolInstructionAccounts`.

| Field            | Type                      |
| ---------------- | ------------------------- |
| `curve_type`     | [`CurveType`](#curvetype) |
| `token_a_amount` | `u64`                     |
| `token_b_amount` | `u64`                     |

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

Fields of `InitializePermissionlessPoolInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `lp_mint`                  | `Pubkey`           |
| 2   | `token_a_mint`             | `Pubkey`           |
| 3   | `token_b_mint`             | `Pubkey`           |
| 4   | `a_vault`                  | `Pubkey`           |
| 5   | `b_vault`                  | `Pubkey`           |
| 6   | `a_token_vault`            | `Pubkey`           |
| 7   | `b_token_vault`            | `Pubkey`           |
| 8   | `a_vault_lp_mint`          | `Pubkey`           |
| 9   | `b_vault_lp_mint`          | `Pubkey`           |
| 10  | `a_vault_lp`               | `Pubkey`           |
| 11  | `b_vault_lp`               | `Pubkey`           |
| 12  | `payer_token_a`            | `Pubkey`           |
| 13  | `payer_token_b`            | `Pubkey`           |
| 14  | `payer_pool_lp`            | `Pubkey`           |
| 15  | `protocol_token_a_fee`     | `Pubkey`           |
| 16  | `protocol_token_b_fee`     | `Pubkey`           |
| 17  | `payer`                    | `Pubkey`           |
| 18  | `fee_owner`                | `Pubkey`           |
| 19  | `rent`                     | `Pubkey`           |
| 20  | `mint_metadata`            | `Pubkey`           |
| 21  | `metadata_program`         | `Pubkey`           |
| 22  | `vault_program`            | `Pubkey`           |
| 23  | `token_program`            | `Pubkey`           |
| 24  | `associated_token_program` | `Pubkey`           |
| 25  | `system_program`           | `Pubkey`           |
| 26… | `remaining`                | `Vec<AccountMeta>` |

### `InitializePermissionlessPoolWithFeeTier`

> _From the program's IDL:_
>
> Initialize a new permissionless pool with customized fee tier

Discriminator `06874493e552a971` · data `InitializePermissionlessPoolWithFeeTier` · accounts `InitializePermissionlessPoolWithFeeTierInstructionAccounts`.

| Field            | Type                      |
| ---------------- | ------------------------- |
| `curve_type`     | [`CurveType`](#curvetype) |
| `trade_fee_bps`  | `u64`                     |
| `token_a_amount` | `u64`                     |
| `token_b_amount` | `u64`                     |

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

Fields of `InitializePermissionlessPoolWithFeeTierInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `pool`                     | `Pubkey`           |
| 1   | `lp_mint`                  | `Pubkey`           |
| 2   | `token_a_mint`             | `Pubkey`           |
| 3   | `token_b_mint`             | `Pubkey`           |
| 4   | `a_vault`                  | `Pubkey`           |
| 5   | `b_vault`                  | `Pubkey`           |
| 6   | `a_token_vault`            | `Pubkey`           |
| 7   | `b_token_vault`            | `Pubkey`           |
| 8   | `a_vault_lp_mint`          | `Pubkey`           |
| 9   | `b_vault_lp_mint`          | `Pubkey`           |
| 10  | `a_vault_lp`               | `Pubkey`           |
| 11  | `b_vault_lp`               | `Pubkey`           |
| 12  | `payer_token_a`            | `Pubkey`           |
| 13  | `payer_token_b`            | `Pubkey`           |
| 14  | `payer_pool_lp`            | `Pubkey`           |
| 15  | `protocol_token_a_fee`     | `Pubkey`           |
| 16  | `protocol_token_b_fee`     | `Pubkey`           |
| 17  | `payer`                    | `Pubkey`           |
| 18  | `fee_owner`                | `Pubkey`           |
| 19  | `rent`                     | `Pubkey`           |
| 20  | `mint_metadata`            | `Pubkey`           |
| 21  | `metadata_program`         | `Pubkey`           |
| 22  | `vault_program`            | `Pubkey`           |
| 23  | `token_program`            | `Pubkey`           |
| 24  | `associated_token_program` | `Pubkey`           |
| 25  | `system_program`           | `Pubkey`           |
| 26… | `remaining`                | `Vec<AccountMeta>` |

### `Lock`

> _From the program's IDL:_
>
> Lock Lp token

Discriminator `1513d02bed3eff57` · data `Lock` · accounts `LockInstructionAccounts`.

| Field        | Type  |
| ------------ | ----- |
| `max_amount` | `u64` |

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

Fields of `LockInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `lock_escrow`     | `Pubkey`           |
| 3   | `owner`           | `Pubkey`           |
| 4   | `source_tokens`   | `Pubkey`           |
| 5   | `escrow_vault`    | `Pubkey`           |
| 6   | `token_program`   | `Pubkey`           |
| 7   | `a_vault`         | `Pubkey`           |
| 8   | `b_vault`         | `Pubkey`           |
| 9   | `a_vault_lp`      | `Pubkey`           |
| 10  | `b_vault_lp`      | `Pubkey`           |
| 11  | `a_vault_lp_mint` | `Pubkey`           |
| 12  | `b_vault_lp_mint` | `Pubkey`           |
| 13… | `remaining`       | `Vec<AccountMeta>` |

### `OverrideCurveParam`

> _From the program's IDL:_
>
> Update swap curve parameters. This function do not allow update of curve type. For example: stable swap curve to constant product curve. Only supported by pool with stable swap curve. Only amp is allowed to be override. The other attributes of stable swap curve will be ignored.

Discriminator `6256cc335e4745bb` · data `OverrideCurveParam` · accounts `OverrideCurveParamInstructionAccounts`.

| Field        | Type                      |
| ------------ | ------------------------- |
| `curve_type` | [`CurveType`](#curvetype) |

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

Fields of `OverrideCurveParamInstructionAccounts`, in account order:

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

### `PartnerClaimFee`

> _From the program's IDL:_
>
> Partner claim fee

Discriminator `3935b01e7b463440` · data `PartnerClaimFee` · accounts `PartnerClaimFeeInstructionAccounts`.

| Field          | Type  |
| -------------- | ----- |
| `max_amount_a` | `u64` |
| `max_amount_b` | `u64` |

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

Fields of `PartnerClaimFeeInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `pool`                 | `Pubkey`           |
| 1  | `a_vault_lp`           | `Pubkey`           |
| 2  | `protocol_token_a_fee` | `Pubkey`           |
| 3  | `protocol_token_b_fee` | `Pubkey`           |
| 4  | `partner_token_a`      | `Pubkey`           |
| 5  | `partner_token_b`      | `Pubkey`           |
| 6  | `token_program`        | `Pubkey`           |
| 7  | `partner_authority`    | `Pubkey`           |
| 8… | `remaining`            | `Vec<AccountMeta>` |

### `RemoveBalanceLiquidity`

> _From the program's IDL:_
>
> Withdraw tokens from the pool in a balanced ratio. User will still able to withdraw from pool even the pool is disabled. This allow user to exit their liquidity when there's some unforeseen event happen.

Discriminator `856d2cb338ee7221` · data `RemoveBalanceLiquidity` · accounts `RemoveBalanceLiquidityInstructionAccounts`.

| Field                 | Type  |
| --------------------- | ----- |
| `pool_token_amount`   | `u64` |
| `minimum_a_token_out` | `u64` |
| `minimum_b_token_out` | `u64` |

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

Fields of `RemoveBalanceLiquidityInstructionAccounts`, in account order:

| #   | Field             | Type               |
| --- | ----------------- | ------------------ |
| 0   | `pool`            | `Pubkey`           |
| 1   | `lp_mint`         | `Pubkey`           |
| 2   | `user_pool_lp`    | `Pubkey`           |
| 3   | `a_vault_lp`      | `Pubkey`           |
| 4   | `b_vault_lp`      | `Pubkey`           |
| 5   | `a_vault`         | `Pubkey`           |
| 6   | `b_vault`         | `Pubkey`           |
| 7   | `a_vault_lp_mint` | `Pubkey`           |
| 8   | `b_vault_lp_mint` | `Pubkey`           |
| 9   | `a_token_vault`   | `Pubkey`           |
| 10  | `b_token_vault`   | `Pubkey`           |
| 11  | `user_a_token`    | `Pubkey`           |
| 12  | `user_b_token`    | `Pubkey`           |
| 13  | `user`            | `Pubkey`           |
| 14  | `vault_program`   | `Pubkey`           |
| 15  | `token_program`   | `Pubkey`           |
| 16… | `remaining`       | `Vec<AccountMeta>` |

### `RemoveLiquiditySingleSide`

> _From the program's IDL:_
>
> Withdraw only single token from the pool. Only supported by pool with stable swap curve.

Discriminator `5454b142feb90afb` · data `RemoveLiquiditySingleSide` · accounts `RemoveLiquiditySingleSideInstructionAccounts`.

| Field                | Type  |
| -------------------- | ----- |
| `pool_token_amount`  | `u64` |
| `minimum_out_amount` | `u64` |

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

Fields of `RemoveLiquiditySingleSideInstructionAccounts`, in account order:

| #   | Field                    | Type               |
| --- | ------------------------ | ------------------ |
| 0   | `pool`                   | `Pubkey`           |
| 1   | `lp_mint`                | `Pubkey`           |
| 2   | `user_pool_lp`           | `Pubkey`           |
| 3   | `a_vault_lp`             | `Pubkey`           |
| 4   | `b_vault_lp`             | `Pubkey`           |
| 5   | `a_vault`                | `Pubkey`           |
| 6   | `b_vault`                | `Pubkey`           |
| 7   | `a_vault_lp_mint`        | `Pubkey`           |
| 8   | `b_vault_lp_mint`        | `Pubkey`           |
| 9   | `a_token_vault`          | `Pubkey`           |
| 10  | `b_token_vault`          | `Pubkey`           |
| 11  | `user_destination_token` | `Pubkey`           |
| 12  | `user`                   | `Pubkey`           |
| 13  | `vault_program`          | `Pubkey`           |
| 14  | `token_program`          | `Pubkey`           |
| 15… | `remaining`              | `Vec<AccountMeta>` |

### `SetPoolFees`

> _From the program's IDL:_
>
> Update trading fee charged for liquidity provider, and admin.

Discriminator `662c9e36cd257e4e` · data `SetPoolFees` · accounts `SetPoolFeesInstructionAccounts`.

| Field                       | Type                    |
| --------------------------- | ----------------------- |
| `fees`                      | [`PoolFees`](#poolfees) |
| `new_partner_fee_numerator` | `u64`                   |

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

Fields of `SetPoolFeesInstructionAccounts`, in account order:

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

### `SetWhitelistedVault`

> _From the program's IDL:_
>
> Set whitelisted vault

Discriminator `0c945e2a373953f7` · data `SetWhitelistedVault` · accounts `SetWhitelistedVaultInstructionAccounts`.

| Field               | Type     |
| ------------------- | -------- |
| `whitelisted_vault` | `Pubkey` |

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

Fields of `SetWhitelistedVaultInstructionAccounts`, in account order:

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

### `Swap`

> _From the program's IDL:_
>
> Swap token A to B, or vice versa. An amount of trading fee will be charged for liquidity provider, and the admin of the pool.

Discriminator `f8c69e91e17587c8` · data `Swap` · accounts `SwapInstructionAccounts`.

| Field                | Type  |
| -------------------- | ----- |
| `in_amount`          | `u64` |
| `minimum_out_amount` | `u64` |

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

Fields of `SwapInstructionAccounts`, in account order:

| #   | Field                    | Type               |
| --- | ------------------------ | ------------------ |
| 0   | `pool`                   | `Pubkey`           |
| 1   | `user_source_token`      | `Pubkey`           |
| 2   | `user_destination_token` | `Pubkey`           |
| 3   | `a_vault`                | `Pubkey`           |
| 4   | `b_vault`                | `Pubkey`           |
| 5   | `a_token_vault`          | `Pubkey`           |
| 6   | `b_token_vault`          | `Pubkey`           |
| 7   | `a_vault_lp_mint`        | `Pubkey`           |
| 8   | `b_vault_lp_mint`        | `Pubkey`           |
| 9   | `a_vault_lp`             | `Pubkey`           |
| 10  | `b_vault_lp`             | `Pubkey`           |
| 11  | `protocol_token_fee`     | `Pubkey`           |
| 12  | `user`                   | `Pubkey`           |
| 13  | `vault_program`          | `Pubkey`           |
| 14  | `token_program`          | `Pubkey`           |
| 15… | `remaining`              | `Vec<AccountMeta>` |

### `UpdateActivationPoint`

> _From the program's IDL:_
>
> Update activation slot

Discriminator `963e7ddbabdc1aed` · data `UpdateActivationPoint` · accounts `UpdateActivationPointInstructionAccounts`.

| Field                  | Type  |
| ---------------------- | ----- |
| `new_activation_point` | `u64` |

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

Fields of `UpdateActivationPointInstructionAccounts`, in account order:

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

### `WithdrawProtocolFees`

> _From the program's IDL:_
>
> Withdraw protocol fee

Discriminator `0b44a56212d08649` · data `WithdrawProtocolFees` · accounts `WithdrawProtocolFeesInstructionAccounts`.

No data fields.

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

Fields of `WithdrawProtocolFeesInstructionAccounts`, in account order:

| #  | Field                  | Type               |
| -- | ---------------------- | ------------------ |
| 0  | `pool`                 | `Pubkey`           |
| 1  | `a_vault_lp`           | `Pubkey`           |
| 2  | `protocol_token_a_fee` | `Pubkey`           |
| 3  | `protocol_token_b_fee` | `Pubkey`           |
| 4  | `treasury_token_a`     | `Pubkey`           |
| 5  | `treasury_token_b`     | `Pubkey`           |
| 6  | `token_program`        | `Pubkey`           |
| 7… | `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 `MeteoraPoolsAccount`. Each wraps a boxed struct from `carbon_meteora_pools_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `Config`

Discriminator `9b0caae01efacc82` · `accounts::config::Config`.

| Field                    | Type                    | Description                                                                                                                     |
| ------------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `pool_fees`              | [`PoolFees`](#poolfees) |                                                                                                                                 |
| `activation_duration`    | `u64`                   |                                                                                                                                 |
| `vault_config_key`       | `Pubkey`                |                                                                                                                                 |
| `pool_creator_authority` | `Pubkey`                | Only pool_creator_authority can use the current config to initialize new pool. When it's Pubkey::default, it's a public config. |
| `activation_type`        | `u8`                    | Activation type                                                                                                                 |
| `partner_fee_numerator`  | `u64`                   |                                                                                                                                 |
| `padding`                | `[u8; 219]`             |                                                                                                                                 |

### `LockEscrow`

> _From the program's IDL:_
>
> State of lock escrow account

Discriminator `be6a7906c8b6154b` · `accounts::lock_escrow::LockEscrow`.

| Field                   | Type     | Description                             |
| ----------------------- | -------- | --------------------------------------- |
| `pool`                  | `Pubkey` | Pool address                            |
| `owner`                 | `Pubkey` | Owner address                           |
| `escrow_vault`          | `Pubkey` | Vault address, store the lock user lock |
| `bump`                  | `u8`     | bump, used to sign                      |
| `total_locked_amount`   | `u64`    | Total locked amount                     |
| `lp_per_token`          | `u128`   | Lp per token, virtual price of lp token |
| `unclaimed_fee_pending` | `u64`    | Unclaimed fee pending                   |
| `a_fee`                 | `u64`    | Total a fee claimed so far              |
| `b_fee`                 | `u64`    | Total b fee claimed so far              |

### `Pool`

> _From the program's IDL:_
>
> State of pool account

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

| Field                  | Type                              | Description                                                                                          |
| ---------------------- | --------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `lp_mint`              | `Pubkey`                          | LP token mint of the pool                                                                            |
| `token_a_mint`         | `Pubkey`                          | Token A mint of the pool. Eg: USDT                                                                   |
| `token_b_mint`         | `Pubkey`                          | Token B mint of the pool. Eg: USDC                                                                   |
| `a_vault`              | `Pubkey`                          | Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account.   |
| `b_vault`              | `Pubkey`                          | Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account.   |
| `a_vault_lp`           | `Pubkey`                          | LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault. |
| `b_vault_lp`           | `Pubkey`                          | LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault. |
| `a_vault_lp_bump`      | `u8`                              | "A" vault lp bump. Used to create signer seeds.                                                      |
| `enabled`              | `bool`                            | Flag to determine whether the pool is enabled, or disabled.                                          |
| `protocol_token_a_fee` | `Pubkey`                          | Protocol fee token account for token A. Used to receive trading fee.                                 |
| `protocol_token_b_fee` | `Pubkey`                          | Protocol fee token account for token B. Used to receive trading fee.                                 |
| `fee_last_updated_at`  | `u64`                             | Fee last updated timestamp                                                                           |
| `padding0`             | `[u8; 24]`                        |                                                                                                      |
| `fees`                 | [`PoolFees`](#poolfees)           | Store the fee charges setting.                                                                       |
| `pool_type`            | [`PoolType`](#pooltype)           | Pool type                                                                                            |
| `stake`                | `Pubkey`                          | Stake pubkey of SPL stake pool                                                                       |
| `total_locked_lp`      | `u64`                             | Total locked lp token                                                                                |
| `bootstrapping`        | [`Bootstrapping`](#bootstrapping) | bootstrapping config                                                                                 |
| `partner_info`         | [`PartnerInfo`](#partnerinfo)     |                                                                                                      |
| `padding`              | [`Padding`](#padding)             | Padding for future pool field                                                                        |
| `curve_type`           | [`CurveType`](#curvetype)         | The type of the swap curve supported by the pool.                                                    |

## Events

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

### `AddLiquidity`

Discriminator `1f5e7d5ae3343dba` · `events::add_liquidity::AddLiquidityEvent`.

| Field            | Type  |
| ---------------- | ----- |
| `lp_mint_amount` | `u64` |
| `token_a_amount` | `u64` |
| `token_b_amount` | `u64` |

### `RemoveLiquidity`

Discriminator `74f461e8671f983a` · `events::remove_liquidity::RemoveLiquidityEvent`.

| Field                | Type  |
| -------------------- | ----- |
| `lp_unmint_amount`   | `u64` |
| `token_a_out_amount` | `u64` |
| `token_b_out_amount` | `u64` |

### `BootstrapLiquidity`

Discriminator `797f26885c370ef7` · `events::bootstrap_liquidity::BootstrapLiquidityEvent`.

| Field            | Type     |
| ---------------- | -------- |
| `lp_mint_amount` | `u64`    |
| `token_a_amount` | `u64`    |
| `token_b_amount` | `u64`    |
| `pool`           | `Pubkey` |

### `Swap`

Discriminator `516ce3becdd00ac4` · `events::swap::SwapEvent`.

| Field          | Type  |
| -------------- | ----- |
| `in_amount`    | `u64` |
| `out_amount`   | `u64` |
| `trade_fee`    | `u64` |
| `protocol_fee` | `u64` |
| `host_fee`     | `u64` |

### `SetPoolFees`

Discriminator `f51ac6a458124b09` · `events::set_pool_fees::SetPoolFeesEvent`.

| Field                            | Type     |
| -------------------------------- | -------- |
| `trade_fee_numerator`            | `u64`    |
| `trade_fee_denominator`          | `u64`    |
| `protocol_trade_fee_numerator`   | `u64`    |
| `protocol_trade_fee_denominator` | `u64`    |
| `pool`                           | `Pubkey` |

### `PoolInfo`

Discriminator `cf145761fbd4ea2d` · `events::pool_info::PoolInfoEvent`.

| Field               | Type  |
| ------------------- | ----- |
| `token_a_amount`    | `u64` |
| `token_b_amount`    | `u64` |
| `virtual_price`     | `f64` |
| `current_timestamp` | `u64` |

### `TransferAdmin`

Discriminator `e4a983f43d3841fe` · `events::transfer_admin::TransferAdminEvent`.

| Field       | Type     |
| ----------- | -------- |
| `admin`     | `Pubkey` |
| `new_admin` | `Pubkey` |
| `pool`      | `Pubkey` |

### `OverrideCurveParam`

Discriminator `f714a5f84b0536f6` · `events::override_curve_param::OverrideCurveParamEvent`.

| Field               | Type     |
| ------------------- | -------- |
| `new_amp`           | `u64`    |
| `updated_timestamp` | `u64`    |
| `pool`              | `Pubkey` |

### `PoolCreated`

Discriminator `ca2c295868dc9d52` · `events::pool_created::PoolCreatedEvent`.

| Field          | Type                    |
| -------------- | ----------------------- |
| `lp_mint`      | `Pubkey`                |
| `token_a_mint` | `Pubkey`                |
| `token_b_mint` | `Pubkey`                |
| `pool_type`    | [`PoolType`](#pooltype) |
| `pool`         | `Pubkey`                |

### `PoolEnabled`

Discriminator `02971253cc865cbf` · `events::pool_enabled::PoolEnabledEvent`.

| Field     | Type     |
| --------- | -------- |
| `pool`    | `Pubkey` |
| `enabled` | `bool`   |

### `MigrateFeeAccount`

Discriminator `dfeae81afc69b47d` · `events::migrate_fee_account::MigrateFeeAccountEvent`.

| Field                   | Type     |
| ----------------------- | -------- |
| `pool`                  | `Pubkey` |
| `new_admin_token_a_fee` | `Pubkey` |
| `new_admin_token_b_fee` | `Pubkey` |
| `token_a_amount`        | `u64`    |
| `token_b_amount`        | `u64`    |

### `CreateLockEscrow`

Discriminator `4a5e6a8d3111626d` · `events::create_lock_escrow::CreateLockEscrowEvent`.

| Field   | Type     |
| ------- | -------- |
| `pool`  | `Pubkey` |
| `owner` | `Pubkey` |

### `Lock`

Discriminator `dcb743d799cf38ea` · `events::lock::LockEvent`.

| Field    | Type     |
| -------- | -------- |
| `pool`   | `Pubkey` |
| `owner`  | `Pubkey` |
| `amount` | `u64`    |

### `ClaimFee`

Discriminator `4b7a9a308c4a7ba3` · `events::claim_fee::ClaimFeeEvent`.

| Field    | Type     |
| -------- | -------- |
| `pool`   | `Pubkey` |
| `owner`  | `Pubkey` |
| `amount` | `u64`    |
| `a_fee`  | `u64`    |
| `b_fee`  | `u64`    |

### `CreateConfig`

Discriminator `c7980a1327279d68` · `events::create_config::CreateConfigEvent`.

| Field                          | Type     |
| ------------------------------ | -------- |
| `trade_fee_numerator`          | `u64`    |
| `protocol_trade_fee_numerator` | `u64`    |
| `config`                       | `Pubkey` |

### `CloseConfig`

Discriminator `f9b56c5904965aae` · `events::close_config::CloseConfigEvent`.

| Field    | Type     |
| -------- | -------- |
| `config` | `Pubkey` |

### `WithdrawProtocolFees`

Discriminator `1ef0cfc48bef4f1c` · `events::withdraw_protocol_fees::WithdrawProtocolFeesEvent`.

| Field                  | Type     |
| ---------------------- | -------- |
| `pool`                 | `Pubkey` |
| `protocol_a_fee`       | `u64`    |
| `protocol_b_fee`       | `u64`    |
| `protocol_a_fee_owner` | `Pubkey` |
| `protocol_b_fee_owner` | `Pubkey` |

### `PartnerClaimFees`

Discriminator `87830a5e77d1ca30` · `events::partner_claim_fees::PartnerClaimFeesEvent`.

| Field     | Type     |
| --------- | -------- |
| `pool`    | `Pubkey` |
| `fee_a`   | `u64`    |
| `fee_b`   | `u64`    |
| `partner` | `Pubkey` |

## Types

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

### `ActivationType`

> _From the program's IDL:_
>
> Type of the activation

Enum `types::ActivationType`.

| Variant     |
| ----------- |
| `Slot`      |
| `Timestamp` |

### `AddLiquidity`

Struct `types::AddLiquidity`. Same fields as the [`AddLiquidity`](#addliquidity) event.

### `BootstrapLiquidity`

Struct `types::BootstrapLiquidity`. Same fields as the [`BootstrapLiquidity`](#bootstrapliquidity-1) event.

### `Bootstrapping`

Struct `types::Bootstrapping`.

| Field               | Type     | Description                                                                                    |
| ------------------- | -------- | ---------------------------------------------------------------------------------------------- |
| `activation_point`  | `u64`    | Activation point, can be slot or timestamp                                                     |
| `whitelisted_vault` | `Pubkey` | Whitelisted vault to be able to buy pool before activation_point                               |
| `pool_creator`      | `Pubkey` | Need to store pool creator in lauch pool, so they can modify liquidity before activation_point |
| `activation_type`   | `u8`     | Activation type, 0 means by slot, 1 means by timestamp                                         |

### `ClaimFee`

Struct `types::ClaimFee`. Same fields as the [`ClaimFee`](#claimfee-1) event.

### `CloseConfig`

Struct `types::CloseConfig`. Same fields as the [`CloseConfig`](#closeconfig-1) event.

### `ConfigParameters`

Struct `types::ConfigParameters`.

| Field                          | Type     |
| ------------------------------ | -------- |
| `trade_fee_numerator`          | `u64`    |
| `protocol_trade_fee_numerator` | `u64`    |
| `activation_duration`          | `u64`    |
| `vault_config_key`             | `Pubkey` |
| `pool_creator_authority`       | `Pubkey` |
| `activation_type`              | `u8`     |
| `index`                        | `u64`    |
| `partner_fee_numerator`        | `u64`    |

### `CreateConfig`

Struct `types::CreateConfig`. Same fields as the [`CreateConfig`](#createconfig-1) event.

### `CreateLockEscrow`

Struct `types::CreateLockEscrow`. Same fields as the [`CreateLockEscrow`](#createlockescrow-1) event.

### `CurveType`

> _From the program's IDL:_
>
> Type of the swap curve

Enum `types::CurveType`.

| Variant           | Fields                                                                                                                                   |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `ConstantProduct` |                                                                                                                                          |
| `Stable`          | `amp`: `u64`, `token_multiplier`: [`TokenMultiplier`](#tokenmultiplier), `depeg`: [`Depeg`](#depeg), `last_amp_updated_timestamp`: `u64` |

`Stable` fields:

| Field                        | Type                                  | Description                                                                                                                     |
| ---------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `amp`                        | `u64`                                 | Amplification coefficient                                                                                                       |
| `token_multiplier`           | [`TokenMultiplier`](#tokenmultiplier) | Multiplier for the pool token. Used to normalized token with different decimal into the same precision.                         |
| `depeg`                      | [`Depeg`](#depeg)                     | Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price |
| `last_amp_updated_timestamp` | `u64`                                 | The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period            |

### `CustomizableParams`

Struct `types::CustomizableParams`.

| Field                 | Type          | Description                          |
| --------------------- | ------------- | ------------------------------------ |
| `trade_fee_numerator` | `u32`         | Trading fee.                         |
| `activation_point`    | `Option<u64>` | The pool start trading.              |
| `has_alpha_vault`     | `bool`        | Whether the pool support alpha vault |
| `activation_type`     | `u8`          | Activation type                      |
| `padding`             | `[u8; 90]`    | Padding                              |

### `Depeg`

> _From the program's IDL:_
>
> Contains information for depeg pool

Struct `types::Depeg`.

| Field                | Type                      | Description                                           |
| -------------------- | ------------------------- | ----------------------------------------------------- |
| `base_virtual_price` | `u64`                     | The virtual price of staking / interest bearing token |
| `base_cache_updated` | `u64`                     | The last time base_virtual_price is updated           |
| `depeg_type`         | [`DepegType`](#depegtype) | Type of the depeg pool                                |

### `DepegType`

> _From the program's IDL:_
>
> Type of depeg pool

Enum `types::DepegType`.

| Variant    |
| ---------- |
| `None`     |
| `Marinade` |
| `Lido`     |
| `SplStake` |

### `Lock`

Struct `types::Lock`. Same fields as the [`Lock`](#lock-1) event.

### `MigrateFeeAccount`

Struct `types::MigrateFeeAccount`. Same fields as the [`MigrateFeeAccount`](#migratefeeaccount) event.

### `NewCurveType`

> _From the program's IDL:_
>
> Type of the swap curve

Enum `types::NewCurveType`.

| Variant           | Fields                                                                                                                                   |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `ConstantProduct` |                                                                                                                                          |
| `Stable`          | `amp`: `u64`, `token_multiplier`: [`TokenMultiplier`](#tokenmultiplier), `depeg`: [`Depeg`](#depeg), `last_amp_updated_timestamp`: `u64` |
| `NewCurve`        | `field_one`: `u64`, `field_two`: `u64`                                                                                                   |

`Stable` fields:

| Field                        | Type                                  | Description                                                                                                                     |
| ---------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `amp`                        | `u64`                                 | Amplification coefficient                                                                                                       |
| `token_multiplier`           | [`TokenMultiplier`](#tokenmultiplier) | Multiplier for the pool token. Used to normalized token with different decimal into the same precision.                         |
| `depeg`                      | [`Depeg`](#depeg)                     | Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price |
| `last_amp_updated_timestamp` | `u64`                                 | The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period            |

### `OverrideCurveParam`

Struct `types::OverrideCurveParam`. Same fields as the [`OverrideCurveParam`](#overridecurveparam-1) event.

### `Padding`

> _From the program's IDL:_
>
> Padding for future pool fields

Struct `types::Padding`.

| Field      | Type        | Description |
| ---------- | ----------- | ----------- |
| `padding0` | `[u8; 6]`   | Padding 0   |
| `padding1` | `[u64; 21]` | Padding 1   |
| `padding2` | `[u64; 21]` | Padding 2   |

### `PartnerClaimFees`

Struct `types::PartnerClaimFees`. Same fields as the [`PartnerClaimFees`](#partnerclaimfees) event.

### `PartnerInfo`

Struct `types::PartnerInfo`.

| Field               | Type     |
| ------------------- | -------- |
| `fee_numerator`     | `u64`    |
| `partner_authority` | `Pubkey` |
| `pending_fee_a`     | `u64`    |
| `pending_fee_b`     | `u64`    |

### `PoolCreated`

Struct `types::PoolCreated`. Same fields as the [`PoolCreated`](#poolcreated) event.

### `PoolEnabled`

Struct `types::PoolEnabled`. Same fields as the [`PoolEnabled`](#poolenabled) event.

### `PoolFees`

> _From the program's IDL:_
>
> Information regarding fee charges

Struct `types::PoolFees`.

| Field                            | Type  | Description                                                                                                                                                                                                  |
| -------------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `trade_fee_numerator`            | `u64` | Trade fees are extra token amounts that are held inside the token accounts during a trade, making the value of liquidity tokens rise. Trade fee numerator                                                    |
| `trade_fee_denominator`          | `u64` | Trade fee denominator                                                                                                                                                                                        |
| `protocol_trade_fee_numerator`   | `u64` | Protocol trading fees are extra token amounts that are held inside the token accounts during a trade, with the equivalent in pool tokens minted to the protocol of the program. Protocol trade fee numerator |
| `protocol_trade_fee_denominator` | `u64` | Protocol trade fee denominator                                                                                                                                                                               |

### `PoolInfo`

Struct `types::PoolInfo`. Same fields as the [`PoolInfo`](#poolinfo) event.

### `PoolType`

> _From the program's IDL:_
>
> Pool type

Enum `types::PoolType`.

| Variant          |
| ---------------- |
| `Permissioned`   |
| `Permissionless` |

### `RemoveLiquidity`

Struct `types::RemoveLiquidity`. Same fields as the [`RemoveLiquidity`](#removeliquidity) event.

### `RoundDirection`

> _From the program's IDL:_
>
> Rounding direction

Enum `types::RoundDirection`.

| Variant   |
| --------- |
| `Floor`   |
| `Ceiling` |

### `Rounding`

> _From the program's IDL:_
>
> Round up, down

Enum `types::Rounding`.

| Variant |
| ------- |
| `Up`    |
| `Down`  |

### `SetPoolFees`

Struct `types::SetPoolFees`. Same fields as the [`SetPoolFees`](#setpoolfees-1) event.

### `Swap`

Struct `types::Swap`. Same fields as the [`Swap`](#swap-1) event.

### `TokenMultiplier`

> _From the program's IDL:_
>
> Multiplier for the pool token. Used to normalized token with different decimal into the same precision.

Struct `types::TokenMultiplier`.

| Field                | Type  | Description                                                                                                                       |
| -------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------- |
| `token_a_multiplier` | `u64` | Multiplier for token A of the pool.                                                                                               |
| `token_b_multiplier` | `u64` | Multiplier for token B of the pool.                                                                                               |
| `precision_factor`   | `u8`  | Record the highest token decimal in the pool. For example, Token A is 6 decimal, token B is 9 decimal. This will save value of 9. |

### `TradeDirection`

> _From the program's IDL:_
>
> Trade (swap) direction

Enum `types::TradeDirection`.

| Variant |
| ------- |
| `AtoB`  |
| `BtoA`  |

### `TransferAdmin`

Struct `types::TransferAdmin`. Same fields as the [`TransferAdmin`](#transferadmin) event.

### `WithdrawProtocolFees`

Struct `types::WithdrawProtocolFees`. Same fields as the [`WithdrawProtocolFees`](#withdrawprotocolfees-1) event.

---

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