# Meteora DBC decoder (Carbon 2.0)

> Decode Meteora DBC instructions, accounts and events in Rust with carbon-meteora-dbc-decoder 2.0.0. Program ID dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN.

`carbon-meteora-dbc-decoder` decodes the instructions, accounts and events of the Meteora DBC program (`dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`): 28 instructions, 9 account types, 23 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-dbc-decoder`](https://crates.io/crates/carbon-meteora-dbc-decoder/2.0.0) 2.0.0                 |
| Install          | `cargo add carbon-meteora-dbc-decoder@2.0.0`                                                                    |
| Program ID       | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` (`carbon_meteora_dbc_decoder::PROGRAM_ID`)                        |
| Category         | [Launchpads](https://carbon.sevenlabs.org/decoders/launchpads.md)                                               |
| Decoder          | `carbon_meteora_dbc_decoder::MeteoraDbcDecoder`                                                                 |
| Instruction enum | `instructions::MeteoraDbcInstruction`                                                                           |
| Account enum     | `accounts::MeteoraDbcAccount`                                                                                   |
| Event enum       | `instructions::CpiEvent`                                                                                        |
| Features         | `serde`, `postgres`, `graphql` (none enabled by default)                                                        |
| API docs         | [docs.rs/carbon-meteora-dbc-decoder/2.0.0](https://docs.rs/carbon-meteora-dbc-decoder/2.0.0)                    |
| Source           | [decoders/meteora-dbc-decoder](https://github.com/sevenlabs-hq/carbon/tree/v2.0.0/decoders/meteora-dbc-decoder) |

Other launchpad decoders: [Boop](https://carbon.sevenlabs.org/decoders/boop.md), [Moonshot](https://carbon.sevenlabs.org/decoders/moonshot.md), [Pump.fun](https://carbon.sevenlabs.org/decoders/pumpfun.md), [Raydium Launchpad](https://carbon.sevenlabs.org/decoders/raydium-launchpad.md), [Vertigo](https://carbon.sevenlabs.org/decoders/vertigo.md), [Virtuals](https://carbon.sevenlabs.org/decoders/virtuals.md), [Wavebreak](https://carbon.sevenlabs.org/decoders/wavebreak.md). To decode several in one pipeline, see [launchpad decoders](https://carbon.sevenlabs.org/decoders/launchpads.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 DBC transactions from the public RPC and prints every decoded `Swap` instruction. Add the dependencies:

```sh
cargo add carbon-core@2.0.0 carbon-meteora-dbc-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_dbc_decoder::{
        instructions::MeteoraDbcInstruction, MeteoraDbcDecoder, 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(MeteoraDbcDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, MeteoraDbcInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, MeteoraDbcInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let MeteoraDbcInstruction::Swap { data, accounts, .. } = input.decoded_instruction {
            println!("swap {signature}: {data:?} pool_authority={}", accounts.pool_authority);
        }
        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 `MeteoraDbcInstruction::CpiEvent { data: CpiEvent::EvtClaimCreatorTradingFee(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 `Config` 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_dbc_decoder::{accounts::MeteoraDbcAccount, MeteoraDbcDecoder, 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(MeteoraDbcDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

Each update to a `Config` 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 `MeteoraDbcInstruction`. Each is `MeteoraDbcInstruction::<Variant> { program_id, data, accounts }`, where `data` and `accounts` are the types listed under the variant, exported from `carbon_meteora_dbc_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 `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`.
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.

### `ClaimCreatorTradingFee`

Discriminator `52dcfabd03556b2d` · data `ClaimCreatorTradingFee` · accounts `ClaimCreatorTradingFeeInstructionAccounts`.

| Field              | Type  |
| ------------------ | ----- |
| `max_base_amount`  | `u64` |
| `max_quote_amount` | `u64` |

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

Fields of `ClaimCreatorTradingFeeInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `pool`                | `Pubkey`           |
| 2   | `token_a_account`     | `Pubkey`           |
| 3   | `token_b_account`     | `Pubkey`           |
| 4   | `base_vault`          | `Pubkey`           |
| 5   | `quote_vault`         | `Pubkey`           |
| 6   | `base_mint`           | `Pubkey`           |
| 7   | `quote_mint`          | `Pubkey`           |
| 8   | `creator`             | `Pubkey`           |
| 9   | `token_base_program`  | `Pubkey`           |
| 10  | `token_quote_program` | `Pubkey`           |
| 11  | `event_authority`     | `Pubkey`           |
| 12  | `program`             | `Pubkey`           |
| 13… | `remaining`           | `Vec<AccountMeta>` |

### `ClaimPartnerPoolCreationFee`

Discriminator `faee1a048b0a65f8` · data `ClaimPartnerPoolCreationFee` · accounts `ClaimPartnerPoolCreationFeeInstructionAccounts`.

No data fields.

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

Fields of `ClaimPartnerPoolCreationFeeInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `config`          | `Pubkey`           |
| 1  | `pool`            | `Pubkey`           |
| 2  | `fee_claimer`     | `Pubkey`           |
| 3  | `fee_receiver`    | `Pubkey`           |
| 4  | `event_authority` | `Pubkey`           |
| 5  | `program`         | `Pubkey`           |
| 6… | `remaining`       | `Vec<AccountMeta>` |

### `ClaimProtocolFee`

Discriminator `a5e4853063f9ff21` · data `ClaimProtocolFee` · accounts `ClaimProtocolFeeInstructionAccounts`.

| Field              | Type  |
| ------------------ | ----- |
| `max_base_amount`  | `u64` |
| `max_quote_amount` | `u64` |

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

Fields of `ClaimProtocolFeeInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `pool`                | `Pubkey`           |
| 3   | `base_vault`          | `Pubkey`           |
| 4   | `quote_vault`         | `Pubkey`           |
| 5   | `base_mint`           | `Pubkey`           |
| 6   | `quote_mint`          | `Pubkey`           |
| 7   | `token_base_account`  | `Pubkey`           |
| 8   | `token_quote_account` | `Pubkey`           |
| 9   | `operator`            | `Pubkey`           |
| 10  | `signer`              | `Pubkey`           |
| 11  | `token_base_program`  | `Pubkey`           |
| 12  | `token_quote_program` | `Pubkey`           |
| 13  | `event_authority`     | `Pubkey`           |
| 14  | `program`             | `Pubkey`           |
| 15… | `remaining`           | `Vec<AccountMeta>` |

### `ClaimProtocolPoolCreationFee`

Discriminator `72cd53bcf0991936` · data `ClaimProtocolPoolCreationFee` · accounts `ClaimProtocolPoolCreationFeeInstructionAccounts`.

No data fields.

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

Fields of `ClaimProtocolPoolCreationFeeInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `config`          | `Pubkey`           |
| 1  | `pool`            | `Pubkey`           |
| 2  | `operator`        | `Pubkey`           |
| 3  | `signer`          | `Pubkey`           |
| 4  | `treasury`        | `Pubkey`           |
| 5  | `event_authority` | `Pubkey`           |
| 6  | `program`         | `Pubkey`           |
| 7… | `remaining`       | `Vec<AccountMeta>` |

### `ClaimTradingFee`

Discriminator `08ec5931987db151` · data `ClaimTradingFee` · accounts `ClaimTradingFeeInstructionAccounts`.

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

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

Fields of `ClaimTradingFeeInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `pool`                | `Pubkey`           |
| 3   | `token_a_account`     | `Pubkey`           |
| 4   | `token_b_account`     | `Pubkey`           |
| 5   | `base_vault`          | `Pubkey`           |
| 6   | `quote_vault`         | `Pubkey`           |
| 7   | `base_mint`           | `Pubkey`           |
| 8   | `quote_mint`          | `Pubkey`           |
| 9   | `fee_claimer`         | `Pubkey`           |
| 10  | `token_base_program`  | `Pubkey`           |
| 11  | `token_quote_program` | `Pubkey`           |
| 12  | `event_authority`     | `Pubkey`           |
| 13  | `program`             | `Pubkey`           |
| 14… | `remaining`           | `Vec<AccountMeta>` |

### `CloseClaimProtocolFeeOperator`

Discriminator `082957235030791a` · data `CloseClaimProtocolFeeOperator` · accounts `CloseClaimProtocolFeeOperatorInstructionAccounts`.

No data fields.

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

Fields of `CloseClaimProtocolFeeOperatorInstructionAccounts`, in account order:

| #  | Field                | Type               |
| -- | -------------------- | ------------------ |
| 0  | `claim_fee_operator` | `Pubkey`           |
| 1  | `rent_receiver`      | `Pubkey`           |
| 2  | `signer`             | `Pubkey`           |
| 3  | `event_authority`    | `Pubkey`           |
| 4  | `program`            | `Pubkey`           |
| 5… | `remaining`          | `Vec<AccountMeta>` |

### `CloseOperatorAccount`

Discriminator `ab09d54a7817031d` · data `CloseOperatorAccount` · accounts `CloseOperatorAccountInstructionAccounts`.

No data fields.

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

Fields of `CloseOperatorAccountInstructionAccounts`, in account order:

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

### `CreateConfig`

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

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

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

Fields of `CreateConfigInstructionAccounts`, in account order:

| #  | Field               | Type               |
| -- | ------------------- | ------------------ |
| 0  | `config`            | `Pubkey`           |
| 1  | `fee_claimer`       | `Pubkey`           |
| 2  | `leftover_receiver` | `Pubkey`           |
| 3  | `quote_mint`        | `Pubkey`           |
| 4  | `payer`             | `Pubkey`           |
| 5  | `system_program`    | `Pubkey`           |
| 6  | `event_authority`   | `Pubkey`           |
| 7  | `program`           | `Pubkey`           |
| 8… | `remaining`         | `Vec<AccountMeta>` |

### `CreateLocker`

> _From the program's IDL:_
>
> PERMISSIONLESS FUNCTIONS /// create locker

Discriminator `a75a899a4b2f1154` · data `CreateLocker` · accounts `CreateLockerInstructionAccounts`.

No data fields.

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

Fields of `CreateLockerInstructionAccounts`, in account order:

| #   | Field                    | Type               |
| --- | ------------------------ | ------------------ |
| 0   | `virtual_pool`           | `Pubkey`           |
| 1   | `config`                 | `Pubkey`           |
| 2   | `pool_authority`         | `Pubkey`           |
| 3   | `base_vault`             | `Pubkey`           |
| 4   | `base_mint`              | `Pubkey`           |
| 5   | `base`                   | `Pubkey`           |
| 6   | `creator`                | `Pubkey`           |
| 7   | `escrow`                 | `Pubkey`           |
| 8   | `escrow_token`           | `Pubkey`           |
| 9   | `payer`                  | `Pubkey`           |
| 10  | `token_program`          | `Pubkey`           |
| 11  | `locker_program`         | `Pubkey`           |
| 12  | `locker_event_authority` | `Pubkey`           |
| 13  | `system_program`         | `Pubkey`           |
| 14… | `remaining`              | `Vec<AccountMeta>` |

### `CreateOperatorAccount`

Discriminator `dd40f695f099e5a3` · data `CreateOperatorAccount` · accounts `CreateOperatorAccountInstructionAccounts`.

| Field        | Type   |
| ------------ | ------ |
| `permission` | `u128` |

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

Fields of `CreateOperatorAccountInstructionAccounts`, in account order:

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

### `CreatePartnerMetadata`

> _From the program's IDL:_
>
> PARTNER FUNCTIONS ///

Discriminator `c0a8eabfbce2e3ff` · data `CreatePartnerMetadata` · accounts `CreatePartnerMetadataInstructionAccounts`.

| Field      | Type                                                                  |
| ---------- | --------------------------------------------------------------------- |
| `metadata` | [`CreatePartnerMetadataParameters`](#createpartnermetadataparameters) |

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

Fields of `CreatePartnerMetadataInstructionAccounts`, in account order:

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

### `CreateVirtualPoolMetadata`

Discriminator `2d61bb67fe6d7c86` · data `CreateVirtualPoolMetadata` · accounts `CreateVirtualPoolMetadataInstructionAccounts`.

| Field      | Type                                                                          |
| ---------- | ----------------------------------------------------------------------------- |
| `metadata` | [`CreateVirtualPoolMetadataParameters`](#createvirtualpoolmetadataparameters) |

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

Fields of `CreateVirtualPoolMetadataInstructionAccounts`, in account order:

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

### `CreatorWithdrawSurplus`

Discriminator `a50389071c864c50` · data `CreatorWithdrawSurplus` · accounts `CreatorWithdrawSurplusInstructionAccounts`.

No data fields.

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

Fields of `CreatorWithdrawSurplusInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `virtual_pool`        | `Pubkey`           |
| 3   | `token_quote_account` | `Pubkey`           |
| 4   | `quote_vault`         | `Pubkey`           |
| 5   | `quote_mint`          | `Pubkey`           |
| 6   | `creator`             | `Pubkey`           |
| 7   | `token_quote_program` | `Pubkey`           |
| 8   | `event_authority`     | `Pubkey`           |
| 9   | `program`             | `Pubkey`           |
| 10… | `remaining`           | `Vec<AccountMeta>` |

### `InitializeVirtualPoolWithSplToken`

> _From the program's IDL:_
>
> POOL CREATOR FUNCTIONS ////

Discriminator `8c55d7b06636684f` · data `InitializeVirtualPoolWithSplToken` · accounts `InitializeVirtualPoolWithSplTokenInstructionAccounts`.

| Field    | Type                                                    |
| -------- | ------------------------------------------------------- |
| `params` | [`InitializePoolParameters`](#initializepoolparameters) |

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

Fields of `InitializeVirtualPoolWithSplTokenInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `config`              | `Pubkey`           |
| 1   | `pool_authority`      | `Pubkey`           |
| 2   | `creator`             | `Pubkey`           |
| 3   | `base_mint`           | `Pubkey`           |
| 4   | `quote_mint`          | `Pubkey`           |
| 5   | `pool`                | `Pubkey`           |
| 6   | `base_vault`          | `Pubkey`           |
| 7   | `quote_vault`         | `Pubkey`           |
| 8   | `mint_metadata`       | `Pubkey`           |
| 9   | `metadata_program`    | `Pubkey`           |
| 10  | `payer`               | `Pubkey`           |
| 11  | `token_quote_program` | `Pubkey`           |
| 12  | `token_program`       | `Pubkey`           |
| 13  | `system_program`      | `Pubkey`           |
| 14  | `event_authority`     | `Pubkey`           |
| 15  | `program`             | `Pubkey`           |
| 16… | `remaining`           | `Vec<AccountMeta>` |

### `InitializeVirtualPoolWithToken2022`

Discriminator `a976334e916edc9b` · data `InitializeVirtualPoolWithToken2022` · accounts `InitializeVirtualPoolWithToken2022InstructionAccounts`.

| Field    | Type                                                    |
| -------- | ------------------------------------------------------- |
| `params` | [`InitializePoolParameters`](#initializepoolparameters) |

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

Fields of `InitializeVirtualPoolWithToken2022InstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `config`              | `Pubkey`           |
| 1   | `pool_authority`      | `Pubkey`           |
| 2   | `creator`             | `Pubkey`           |
| 3   | `base_mint`           | `Pubkey`           |
| 4   | `quote_mint`          | `Pubkey`           |
| 5   | `pool`                | `Pubkey`           |
| 6   | `base_vault`          | `Pubkey`           |
| 7   | `quote_vault`         | `Pubkey`           |
| 8   | `payer`               | `Pubkey`           |
| 9   | `token_quote_program` | `Pubkey`           |
| 10  | `token_program`       | `Pubkey`           |
| 11  | `system_program`      | `Pubkey`           |
| 12  | `event_authority`     | `Pubkey`           |
| 13  | `program`             | `Pubkey`           |
| 14… | `remaining`           | `Vec<AccountMeta>` |

### `MigrateMeteoraDamm`

Discriminator `1b013016b43f76d9` · data `MigrateMeteoraDamm` · accounts `MigrateMeteoraDammInstructionAccounts`.

No data fields.

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

Fields of `MigrateMeteoraDammInstructionAccounts`, in account order:

| #   | Field                      | Type               |
| --- | -------------------------- | ------------------ |
| 0   | `virtual_pool`             | `Pubkey`           |
| 1   | `migration_metadata`       | `Pubkey`           |
| 2   | `config`                   | `Pubkey`           |
| 3   | `pool_authority`           | `Pubkey`           |
| 4   | `pool`                     | `Pubkey`           |
| 5   | `damm_config`              | `Pubkey`           |
| 6   | `lp_mint`                  | `Pubkey`           |
| 7   | `token_a_mint`             | `Pubkey`           |
| 8   | `token_b_mint`             | `Pubkey`           |
| 9   | `a_vault`                  | `Pubkey`           |
| 10  | `b_vault`                  | `Pubkey`           |
| 11  | `a_token_vault`            | `Pubkey`           |
| 12  | `b_token_vault`            | `Pubkey`           |
| 13  | `a_vault_lp_mint`          | `Pubkey`           |
| 14  | `b_vault_lp_mint`          | `Pubkey`           |
| 15  | `a_vault_lp`               | `Pubkey`           |
| 16  | `b_vault_lp`               | `Pubkey`           |
| 17  | `base_vault`               | `Pubkey`           |
| 18  | `quote_vault`              | `Pubkey`           |
| 19  | `virtual_pool_lp`          | `Pubkey`           |
| 20  | `protocol_token_a_fee`     | `Pubkey`           |
| 21  | `protocol_token_b_fee`     | `Pubkey`           |
| 22  | `payer`                    | `Pubkey`           |
| 23  | `rent`                     | `Pubkey`           |
| 24  | `mint_metadata`            | `Pubkey`           |
| 25  | `metadata_program`         | `Pubkey`           |
| 26  | `amm_program`              | `Pubkey`           |
| 27  | `vault_program`            | `Pubkey`           |
| 28  | `token_program`            | `Pubkey`           |
| 29  | `associated_token_program` | `Pubkey`           |
| 30  | `system_program`           | `Pubkey`           |
| 31… | `remaining`                | `Vec<AccountMeta>` |

### `MigrateMeteoraDammClaimLpToken`

Discriminator `8b85021e5b917f9a` · data `MigrateMeteoraDammClaimLpToken` · accounts `MigrateMeteoraDammClaimLpTokenInstructionAccounts`.

No data fields.

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

Fields of `MigrateMeteoraDammClaimLpTokenInstructionAccounts`, in account order:

| #  | Field                | Type               |
| -- | -------------------- | ------------------ |
| 0  | `virtual_pool`       | `Pubkey`           |
| 1  | `migration_metadata` | `Pubkey`           |
| 2  | `pool_authority`     | `Pubkey`           |
| 3  | `lp_mint`            | `Pubkey`           |
| 4  | `source_token`       | `Pubkey`           |
| 5  | `destination_token`  | `Pubkey`           |
| 6  | `owner`              | `Pubkey`           |
| 7  | `sender`             | `Pubkey`           |
| 8  | `token_program`      | `Pubkey`           |
| 9… | `remaining`          | `Vec<AccountMeta>` |

### `MigrateMeteoraDammLockLpToken`

Discriminator `b137ee9dfb58a52a` · data `MigrateMeteoraDammLockLpToken` · accounts `MigrateMeteoraDammLockLpTokenInstructionAccounts`.

No data fields.

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

Fields of `MigrateMeteoraDammLockLpTokenInstructionAccounts`, in account order:

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

### `MigrationDammV2`

Discriminator `9ca9e66735e45040` · data `MigrationDammV2` · accounts `MigrationDammV2InstructionAccounts`.

No data fields.

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

Fields of `MigrationDammV2InstructionAccounts`, in account order:

| #   | Field                         | Type               |
| --- | ----------------------------- | ------------------ |
| 0   | `virtual_pool`                | `Pubkey`           |
| 1   | `migration_metadata`          | `Pubkey`           |
| 2   | `config`                      | `Pubkey`           |
| 3   | `pool_authority`              | `Pubkey`           |
| 4   | `pool`                        | `Pubkey`           |
| 5   | `first_position_nft_mint`     | `Pubkey`           |
| 6   | `first_position_nft_account`  | `Pubkey`           |
| 7   | `first_position`              | `Pubkey`           |
| 8   | `second_position_nft_mint`    | `Option<Pubkey>`   |
| 9   | `second_position_nft_account` | `Option<Pubkey>`   |
| 10  | `second_position`             | `Option<Pubkey>`   |
| 11  | `damm_pool_authority`         | `Pubkey`           |
| 12  | `amm_program`                 | `Pubkey`           |
| 13  | `base_mint`                   | `Pubkey`           |
| 14  | `quote_mint`                  | `Pubkey`           |
| 15  | `token_a_vault`               | `Pubkey`           |
| 16  | `token_b_vault`               | `Pubkey`           |
| 17  | `base_vault`                  | `Pubkey`           |
| 18  | `quote_vault`                 | `Pubkey`           |
| 19  | `payer`                       | `Pubkey`           |
| 20  | `token_base_program`          | `Pubkey`           |
| 21  | `token_quote_program`         | `Pubkey`           |
| 22  | `token2022_program`           | `Pubkey`           |
| 23  | `damm_event_authority`        | `Pubkey`           |
| 24  | `system_program`              | `Pubkey`           |
| 25… | `remaining`                   | `Vec<AccountMeta>` |

### `MigrationDammV2CreateMetadata`

Discriminator `6dbd1324c3b7de52` · data `MigrationDammV2CreateMetadata` · accounts `MigrationDammV2CreateMetadataInstructionAccounts`.

No data fields.

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

Fields of `MigrationDammV2CreateMetadataInstructionAccounts`, in account order:

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

### `MigrationMeteoraDammCreateMetadata`

> _From the program's IDL:_
>
> migrate damm v1

Discriminator `2f5e7e73dde2c285` · data `MigrationMeteoraDammCreateMetadata` · accounts `MigrationMeteoraDammCreateMetadataInstructionAccounts`.

No data fields.

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

Fields of `MigrationMeteoraDammCreateMetadataInstructionAccounts`, in account order:

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

### `PartnerWithdrawSurplus`

Discriminator `a8ad4864c962265c` · data `PartnerWithdrawSurplus` · accounts `PartnerWithdrawSurplusInstructionAccounts`.

No data fields.

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

Fields of `PartnerWithdrawSurplusInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `virtual_pool`        | `Pubkey`           |
| 3   | `token_quote_account` | `Pubkey`           |
| 4   | `quote_vault`         | `Pubkey`           |
| 5   | `quote_mint`          | `Pubkey`           |
| 6   | `fee_claimer`         | `Pubkey`           |
| 7   | `token_quote_program` | `Pubkey`           |
| 8   | `event_authority`     | `Pubkey`           |
| 9   | `program`             | `Pubkey`           |
| 10… | `remaining`           | `Vec<AccountMeta>` |

### `Swap`

> _From the program's IDL:_
>
> TRADING BOTS FUNCTIONS ////

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

| Field    | Type                                |
| -------- | ----------------------------------- |
| `params` | [`SwapParameters`](#swapparameters) |

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

Fields of `SwapInstructionAccounts`, in account order:

| #   | Field                    | Type               |
| --- | ------------------------ | ------------------ |
| 0   | `pool_authority`         | `Pubkey`           |
| 1   | `config`                 | `Pubkey`           |
| 2   | `pool`                   | `Pubkey`           |
| 3   | `input_token_account`    | `Pubkey`           |
| 4   | `output_token_account`   | `Pubkey`           |
| 5   | `base_vault`             | `Pubkey`           |
| 6   | `quote_vault`            | `Pubkey`           |
| 7   | `base_mint`              | `Pubkey`           |
| 8   | `quote_mint`             | `Pubkey`           |
| 9   | `payer`                  | `Pubkey`           |
| 10  | `token_base_program`     | `Pubkey`           |
| 11  | `token_quote_program`    | `Pubkey`           |
| 12  | `referral_token_account` | `Option<Pubkey>`   |
| 13  | `event_authority`        | `Pubkey`           |
| 14  | `program`                | `Pubkey`           |
| 15… | `remaining`              | `Vec<AccountMeta>` |

### `Swap2`

Discriminator `414b3f4ceb5b5b88` · data `Swap2` · accounts `Swap2InstructionAccounts`.

| Field    | Type                                  |
| -------- | ------------------------------------- |
| `params` | [`SwapParameters2`](#swapparameters2) |

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

Fields of `Swap2InstructionAccounts`, in account order:

| #   | Field                    | Type               |
| --- | ------------------------ | ------------------ |
| 0   | `pool_authority`         | `Pubkey`           |
| 1   | `config`                 | `Pubkey`           |
| 2   | `pool`                   | `Pubkey`           |
| 3   | `input_token_account`    | `Pubkey`           |
| 4   | `output_token_account`   | `Pubkey`           |
| 5   | `base_vault`             | `Pubkey`           |
| 6   | `quote_vault`            | `Pubkey`           |
| 7   | `base_mint`              | `Pubkey`           |
| 8   | `quote_mint`             | `Pubkey`           |
| 9   | `payer`                  | `Pubkey`           |
| 10  | `token_base_program`     | `Pubkey`           |
| 11  | `token_quote_program`    | `Pubkey`           |
| 12  | `referral_token_account` | `Option<Pubkey>`   |
| 13  | `event_authority`        | `Pubkey`           |
| 14  | `program`                | `Pubkey`           |
| 15… | `remaining`              | `Vec<AccountMeta>` |

### `TransferPoolCreator`

Discriminator `1407a9213a93a621` · data `TransferPoolCreator` · accounts `TransferPoolCreatorInstructionAccounts`.

No data fields.

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

Fields of `TransferPoolCreatorInstructionAccounts`, in account order:

| #  | Field             | Type               |
| -- | ----------------- | ------------------ |
| 0  | `virtual_pool`    | `Pubkey`           |
| 1  | `config`          | `Pubkey`           |
| 2  | `creator`         | `Pubkey`           |
| 3  | `new_creator`     | `Pubkey`           |
| 4  | `event_authority` | `Pubkey`           |
| 5  | `program`         | `Pubkey`           |
| 6… | `remaining`       | `Vec<AccountMeta>` |

### `WithdrawLeftover`

Discriminator `14c6caedebf3b742` · data `WithdrawLeftover` · accounts `WithdrawLeftoverInstructionAccounts`.

No data fields.

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

Fields of `WithdrawLeftoverInstructionAccounts`, in account order:

| #   | Field                | Type               |
| --- | -------------------- | ------------------ |
| 0   | `pool_authority`     | `Pubkey`           |
| 1   | `config`             | `Pubkey`           |
| 2   | `virtual_pool`       | `Pubkey`           |
| 3   | `token_base_account` | `Pubkey`           |
| 4   | `base_vault`         | `Pubkey`           |
| 5   | `base_mint`          | `Pubkey`           |
| 6   | `leftover_receiver`  | `Pubkey`           |
| 7   | `token_base_program` | `Pubkey`           |
| 8   | `event_authority`    | `Pubkey`           |
| 9   | `program`            | `Pubkey`           |
| 10… | `remaining`          | `Vec<AccountMeta>` |

### `WithdrawMigrationFee`

> _From the program's IDL:_
>
> BOTH partner and creator FUNCTIONS ///

Discriminator `ed8e2d178106dea2` · data `WithdrawMigrationFee` · accounts `WithdrawMigrationFeeInstructionAccounts`.

| Field  | Type |
| ------ | ---- |
| `flag` | `u8` |

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

Fields of `WithdrawMigrationFeeInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `virtual_pool`        | `Pubkey`           |
| 3   | `token_quote_account` | `Pubkey`           |
| 4   | `quote_vault`         | `Pubkey`           |
| 5   | `quote_mint`          | `Pubkey`           |
| 6   | `sender`              | `Pubkey`           |
| 7   | `token_quote_program` | `Pubkey`           |
| 8   | `event_authority`     | `Pubkey`           |
| 9   | `program`             | `Pubkey`           |
| 10… | `remaining`           | `Vec<AccountMeta>` |

### `ZapProtocolFee`

Discriminator `d59bbb2238b65bf0` · data `ZapProtocolFee` · accounts `ZapProtocolFeeInstructionAccounts`.

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

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

Fields of `ZapProtocolFeeInstructionAccounts`, in account order:

| #   | Field                 | Type               |
| --- | --------------------- | ------------------ |
| 0   | `pool_authority`      | `Pubkey`           |
| 1   | `config`              | `Pubkey`           |
| 2   | `pool`                | `Pubkey`           |
| 3   | `token_vault`         | `Pubkey`           |
| 4   | `token_mint`          | `Pubkey`           |
| 5   | `receiver_token`      | `Pubkey`           |
| 6   | `operator`            | `Pubkey`           |
| 7   | `signer`              | `Pubkey`           |
| 8   | `token_program`       | `Pubkey`           |
| 9   | `sysvar_instructions` | `Pubkey`           |
| 10… | `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 `MeteoraDbcAccount`. Each wraps a boxed struct from `carbon_meteora_dbc_decoder::accounts::<module>`. `decode_account` only considers accounts owned by `PROGRAM_ID` and returns the first variant that matches.

### `ClaimFeeOperator`

Discriminator `a630865622c8bc96` · `accounts::claim_fee_operator::ClaimFeeOperator`.

| Field      | Type        | Description |
| ---------- | ----------- | ----------- |
| `operator` | `Pubkey`    | operator    |
| `padding`  | `[u8; 128]` | Reserve     |

### `Config`

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

| Field                    | Type                    |
| ------------------------ | ----------------------- |
| `pool_fees`              | [`PoolFees`](#poolfees) |
| `activation_duration`    | `u64`                   |
| `vault_config_key`       | `Pubkey`                |
| `pool_creator_authority` | `Pubkey`                |
| `activation_type`        | `u8`                    |
| `partner_fee_numerator`  | `u64`                   |
| `padding`                | `[u8; 219]`             |

### `LockEscrow`

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

| Field                   | Type     |
| ----------------------- | -------- |
| `pool`                  | `Pubkey` |
| `owner`                 | `Pubkey` |
| `escrow_vault`          | `Pubkey` |
| `bump`                  | `u8`     |
| `total_locked_amount`   | `u64`    |
| `lp_per_token`          | `u128`   |
| `unclaimed_fee_pending` | `u64`    |
| `a_fee`                 | `u64`    |
| `b_fee`                 | `u64`    |

### `MeteoraDammMigrationMetadata`

Discriminator `119b8dd7cf04859c` · `accounts::meteora_damm_migration_metadata::MeteoraDammMigrationMetadata`.

| Field                      | Type        | Description                                                     |
| -------------------------- | ----------- | --------------------------------------------------------------- |
| `virtual_pool`             | `Pubkey`    | pool                                                            |
| `_padding0`                | `[u8; 32]`  | !!! BE CAREFUL to use tombstone field, previous is pool creator |
| `partner`                  | `Pubkey`    | partner                                                         |
| `lp_mint`                  | `Pubkey`    | lp mint                                                         |
| `partner_locked_liquidity` | `u64`       | partner locked liquidity                                        |
| `partner_liquidity`        | `u64`       | partner liquidity                                               |
| `creator_locked_liquidity` | `u64`       | creator locked liquidity                                        |
| `creator_liquidity`        | `u64`       | creator liquidity                                               |
| `padding0`                 | `u8`        | padding                                                         |
| `creator_locked_status`    | `u8`        | flag to check whether liquidity token is locked for creator     |
| `partner_locked_status`    | `u8`        | flag to check whether liquidity token is locked for partner     |
| `creator_claim_status`     | `u8`        | flag to check whether creator has claimed liquidity token       |
| `partner_claim_status`     | `u8`        | flag to check whether partner has claimed liquidity token       |
| `padding`                  | `[u8; 107]` | Reserve                                                         |

### `Operator`

Discriminator `db1fbc91458bcc75` · `accounts::operator::Operator`.

| Field                 | Type       |
| --------------------- | ---------- |
| `whitelisted_address` | `Pubkey`   |
| `permission`          | `u128`     |
| `padding`             | `[u64; 2]` |

### `PartnerMetadata`

Discriminator `4444821310d1629c` · `accounts::partner_metadata::PartnerMetadata`.

| Field         | Type        | Description            |
| ------------- | ----------- | ---------------------- |
| `fee_claimer` | `Pubkey`    | fee claimer            |
| `padding`     | `[u128; 6]` | padding for future use |
| `name`        | `String`    | Name of partner.       |
| `website`     | `String`    | Website of partner.    |
| `logo`        | `String`    | Logo of partner        |

### `PoolConfig`

Discriminator `1a6c0e7b74e6812b` · `accounts::pool_config::PoolConfig`.

| Field                                           | Type                                                                | Description                                                                                                            |
| ----------------------------------------------- | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| `quote_mint`                                    | `Pubkey`                                                            | quote mint                                                                                                             |
| `fee_claimer`                                   | `Pubkey`                                                            | Address to get the fee                                                                                                 |
| `leftover_receiver`                             | `Pubkey`                                                            | Address to receive extra base token after migration, in case token is fixed supply                                     |
| `pool_fees`                                     | [`PoolFeesConfig`](#poolfeesconfig)                                 | Pool fee                                                                                                               |
| `partner_liquidity_vesting_info`                | [`LiquidityVestingInfo`](#liquidityvestinginfo)                     |                                                                                                                        |
| `creator_liquidity_vesting_info`                | [`LiquidityVestingInfo`](#liquidityvestinginfo)                     |                                                                                                                        |
| `padding0`                                      | `[u8; 14]`                                                          | Padding for future use                                                                                                 |
| `padding1`                                      | `u16`                                                               | Previously was protocol and referral fee percent. Beware of tombstone.                                                 |
| `collect_fee_mode`                              | `u8`                                                                | Collect fee mode                                                                                                       |
| `migration_option`                              | `u8`                                                                | migration option                                                                                                       |
| `activation_type`                               | `u8`                                                                | whether mode slot or timestamp                                                                                         |
| `token_decimal`                                 | `u8`                                                                | token decimals                                                                                                         |
| `version`                                       | `u8`                                                                | version                                                                                                                |
| `token_type`                                    | `u8`                                                                | token type of base token                                                                                               |
| `quote_token_flag`                              | `u8`                                                                | quote token flag                                                                                                       |
| `partner_permanent_locked_liquidity_percentage` | `u8`                                                                | partner locked liquidity percentage                                                                                    |
| `partner_liquidity_percentage`                  | `u8`                                                                | partner liquidity percentage                                                                                           |
| `creator_permanent_locked_liquidity_percentage` | `u8`                                                                | creator post migration fee percentage                                                                                  |
| `creator_liquidity_percentage`                  | `u8`                                                                | creator liquidity percentage                                                                                           |
| `migration_fee_option`                          | `u8`                                                                | migration fee option                                                                                                   |
| `fixed_token_supply_flag`                       | `u8`                                                                | flag to indicate whether token is dynamic supply (0) or fixed supply (1)                                               |
| `creator_trading_fee_percentage`                | `u8`                                                                | creator trading fee percentage                                                                                         |
| `token_update_authority`                        | `u8`                                                                | token update authority                                                                                                 |
| `migration_fee_percentage`                      | `u8`                                                                | migration fee percentage                                                                                               |
| `creator_migration_fee_percentage`              | `u8`                                                                | creator migration fee percentage                                                                                       |
| `padding2`                                      | `[u8; 7]`                                                           |                                                                                                                        |
| `swap_base_amount`                              | `u64`                                                               | swap base amount                                                                                                       |
| `migration_quote_threshold`                     | `u64`                                                               | migration quote threshold (in quote token)                                                                             |
| `migration_base_threshold`                      | `u64`                                                               | migration base threshold (in base token)                                                                               |
| `migration_sqrt_price`                          | `u128`                                                              | migration sqrt price                                                                                                   |
| `locked_vesting_config`                         | [`LockedVestingConfig`](#lockedvestingconfig)                       | locked vesting config                                                                                                  |
| `pre_migration_token_supply`                    | `u64`                                                               | pre migration token supply                                                                                             |
| `post_migration_token_supply`                   | `u64`                                                               | post migration token supply                                                                                            |
| `migrated_collect_fee_mode`                     | `u8`                                                                | migrated pool collect fee mode                                                                                         |
| `migrated_dynamic_fee`                          | `u8`                                                                | migrated dynamic fee option.                                                                                           |
| `migrated_pool_fee_bps`                         | `u16`                                                               | migrated pool fee in bps                                                                                               |
| `migrated_pool_base_fee_mode`                   | `u8`                                                                |                                                                                                                        |
| `enable_first_swap_with_min_fee`                | `u8`                                                                |                                                                                                                        |
| `migrated_compounding_fee_bps`                  | `u16`                                                               | compounding fee bps for migrated DAMM v2 pool, should only be non-zero if migrated_collect_fee_mode is 2 (Compounding) |
| `pool_creation_fee`                             | `u64`                                                               | pool creation fee in lamports value                                                                                    |
| `migrated_pool_base_fee_bytes`                  | `[u8; 16]`                                                          | serialized MigratedPoolMarketCapFeeSchedulerParams, only used when migrated_pool_base_fee_mode is market cap scheduler |
| `sqrt_start_price`                              | `u128`                                                              | minimum price                                                                                                          |
| `curve`                                         | [`[LiquidityDistributionConfig; 20]`](#liquiditydistributionconfig) | curve, only use 20 point firstly, we can extend that latter                                                            |

### `VirtualPool`

Discriminator `d5e005d16245775c` · `accounts::virtual_pool::VirtualPool`.

| Field                                  | Type                                      | Description                                                               |
| -------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------- |
| `volatility_tracker`                   | [`VolatilityTracker`](#volatilitytracker) | volatility tracker                                                        |
| `config`                               | `Pubkey`                                  | config key                                                                |
| `creator`                              | `Pubkey`                                  | creator                                                                   |
| `base_mint`                            | `Pubkey`                                  | base mint                                                                 |
| `base_vault`                           | `Pubkey`                                  | base vault                                                                |
| `quote_vault`                          | `Pubkey`                                  | quote vault                                                               |
| `base_reserve`                         | `u64`                                     | base reserve                                                              |
| `quote_reserve`                        | `u64`                                     | quote reserve                                                             |
| `protocol_base_fee`                    | `u64`                                     | protocol base fee                                                         |
| `protocol_quote_fee`                   | `u64`                                     | protocol quote fee                                                        |
| `partner_base_fee`                     | `u64`                                     | partner base fee                                                          |
| `partner_quote_fee`                    | `u64`                                     | trading quote fee                                                         |
| `sqrt_price`                           | `u128`                                    | current price                                                             |
| `activation_point`                     | `u64`                                     | Activation point                                                          |
| `pool_type`                            | `u8`                                      | pool type, spl token or token2022                                         |
| `is_migrated`                          | `u8`                                      | is migrated                                                               |
| `is_partner_withdraw_surplus`          | `u8`                                      | is partner withdraw surplus                                               |
| `is_protocol_withdraw_surplus`         | `u8`                                      | is protocol withdraw surplus                                              |
| `migration_progress`                   | `u8`                                      | migration progress                                                        |
| `is_withdraw_leftover`                 | `u8`                                      | is withdraw leftover                                                      |
| `is_creator_withdraw_surplus`          | `u8`                                      | is creator withdraw surplus                                               |
| `migration_fee_withdraw_status`        | `u8`                                      | migration fee withdraw status bit 1 (0b010) creator bit 2 (0b100) partner |
| `metrics`                              | [`PoolMetrics`](#poolmetrics)             | pool metrics                                                              |
| `finish_curve_timestamp`               | `u64`                                     | The time curve is finished                                                |
| `creator_base_fee`                     | `u64`                                     | creator base fee                                                          |
| `creator_quote_fee`                    | `u64`                                     | creator quote fee                                                         |
| `legacy_creation_fee_bits`             | `u8`                                      | legacy creation fee bits, we dont use this now                            |
| `creation_fee_bits`                    | `u8`                                      | pool creation fee claim status                                            |
| `has_swap`                             | `u8`                                      | Cached flag                                                               |
| `padding0`                             | `[u8; 5]`                                 | Padding for further use                                                   |
| `protocol_liquidity_migration_fee_bps` | `u16`                                     |                                                                           |
| `padding1`                             | `[u8; 6]`                                 |                                                                           |
| `protocol_migration_base_fee_amount`   | `u64`                                     |                                                                           |
| `protocol_migration_quote_fee_amount`  | `u64`                                     |                                                                           |
| `padding2`                             | `[u64; 3]`                                | Padding for further use                                                   |

### `VirtualPoolMetadata`

Discriminator `d92552fa2b2fe4fe` · `accounts::virtual_pool_metadata::VirtualPoolMetadata`.

| Field          | Type        | Description            |
| -------------- | ----------- | ---------------------- |
| `virtual_pool` | `Pubkey`    | virtual pool           |
| `padding`      | `[u128; 6]` | padding for future use |
| `name`         | `String`    | Name of project.       |
| `website`      | `String`    | Website of project.    |
| `logo`         | `String`    | Logo of project        |

## Events

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

### `EvtClaimCreatorTradingFee`

Discriminator `9ae4d7ca859bd68a` · `events::evt_claim_creator_trading_fee::EvtClaimCreatorTradingFeeEvent`.

| Field                | Type     |
| -------------------- | -------- |
| `pool`               | `Pubkey` |
| `token_base_amount`  | `u64`    |
| `token_quote_amount` | `u64`    |

### `EvtClaimPoolCreationFee`

Discriminator `956f952c8840af3e` · `events::evt_claim_pool_creation_fee::EvtClaimPoolCreationFeeEvent`.

| Field          | Type     |
| -------------- | -------- |
| `pool`         | `Pubkey` |
| `receiver`     | `Pubkey` |
| `creation_fee` | `u64`    |

### `EvtClaimProtocolFee`

Discriminator `baf44bfbbc0d1921` · `events::evt_claim_protocol_fee::EvtClaimProtocolFeeEvent`.

| Field                | Type     |
| -------------------- | -------- |
| `pool`               | `Pubkey` |
| `token_base_amount`  | `u64`    |
| `token_quote_amount` | `u64`    |

### `EvtClaimProtocolLiquidityMigrationFee`

Discriminator `51a8741fa1561b23` · `events::evt_claim_protocol_liquidity_migration_fee::EvtClaimProtocolLiquidityMigrationFeeEvent`.

| Field                | Type     |
| -------------------- | -------- |
| `pool`               | `Pubkey` |
| `token_base_amount`  | `u64`    |
| `token_quote_amount` | `u64`    |

### `EvtClaimTradingFee`

Discriminator `1a5375f05cca70fe` · `events::evt_claim_trading_fee::EvtClaimTradingFeeEvent`.

| Field                | Type     |
| -------------------- | -------- |
| `pool`               | `Pubkey` |
| `token_base_amount`  | `u64`    |
| `token_quote_amount` | `u64`    |

### `EvtCloseClaimFeeOperator`

Discriminator `6f2725376ed8c217` · `events::evt_close_claim_fee_operator::EvtCloseClaimFeeOperatorEvent`.

| Field                | Type     |
| -------------------- | -------- |
| `claim_fee_operator` | `Pubkey` |
| `operator`           | `Pubkey` |

### `EvtCreateClaimFeeOperator`

Discriminator `1506997844741cb1` · `events::evt_create_claim_fee_operator::EvtCreateClaimFeeOperatorEvent`.

| Field      | Type     |
| ---------- | -------- |
| `operator` | `Pubkey` |

### `EvtCreateConfig`

Discriminator `83cfb4aeb449a536` · `events::evt_create_config::EvtCreateConfigEvent`.

| Field                                           | Type                                                                       |
| ----------------------------------------------- | -------------------------------------------------------------------------- |
| `config`                                        | `Pubkey`                                                                   |
| `quote_mint`                                    | `Pubkey`                                                                   |
| `fee_claimer`                                   | `Pubkey`                                                                   |
| `owner`                                         | `Pubkey`                                                                   |
| `pool_fees`                                     | [`PoolFeeParameters`](#poolfeeparameters)                                  |
| `collect_fee_mode`                              | `u8`                                                                       |
| `migration_option`                              | `u8`                                                                       |
| `activation_type`                               | `u8`                                                                       |
| `token_decimal`                                 | `u8`                                                                       |
| `token_type`                                    | `u8`                                                                       |
| `partner_permanent_locked_liquidity_percentage` | `u8`                                                                       |
| `partner_liquidity_percentage`                  | `u8`                                                                       |
| `creator_permanent_locked_liquidity_percentage` | `u8`                                                                       |
| `creator_liquidity_percentage`                  | `u8`                                                                       |
| `swap_base_amount`                              | `u64`                                                                      |
| `migration_quote_threshold`                     | `u64`                                                                      |
| `migration_base_amount`                         | `u64`                                                                      |
| `sqrt_start_price`                              | `u128`                                                                     |
| `locked_vesting`                                | [`LockedVestingParams`](#lockedvestingparams)                              |
| `migration_fee_option`                          | `u8`                                                                       |
| `fixed_token_supply_flag`                       | `u8`                                                                       |
| `pre_migration_token_supply`                    | `u64`                                                                      |
| `post_migration_token_supply`                   | `u64`                                                                      |
| `curve`                                         | [`Vec<LiquidityDistributionParameters>`](#liquiditydistributionparameters) |

### `EvtCreateConfigV2`

Discriminator `a34a42bb77c31a90` · `events::evt_create_config_v2::EvtCreateConfigV2Event`.

| Field               | Type                                    |
| ------------------- | --------------------------------------- |
| `config`            | `Pubkey`                                |
| `quote_mint`        | `Pubkey`                                |
| `fee_claimer`       | `Pubkey`                                |
| `leftover_receiver` | `Pubkey`                                |
| `config_parameters` | [`ConfigParameters`](#configparameters) |

### `EvtCreateMeteoraMigrationMetadata`

Discriminator `63a7853fd68faf8b` · `events::evt_create_meteora_migration_metadata::EvtCreateMeteoraMigrationMetadataEvent`.

| Field          | Type     |
| -------------- | -------- |
| `virtual_pool` | `Pubkey` |

### `EvtCreatorWithdrawSurplus`

Discriminator `9849150f4257359d` · `events::evt_creator_withdraw_surplus::EvtCreatorWithdrawSurplusEvent`.

| Field            | Type     |
| ---------------- | -------- |
| `pool`           | `Pubkey` |
| `surplus_amount` | `u64`    |

### `EvtCurveComplete`

Discriminator `e5e756549c864b18` · `events::evt_curve_complete::EvtCurveCompleteEvent`.

| Field           | Type     |
| --------------- | -------- |
| `pool`          | `Pubkey` |
| `config`        | `Pubkey` |
| `base_reserve`  | `u64`    |
| `quote_reserve` | `u64`    |

### `EvtInitializePool`

Discriminator `e432f655cb428625` · `events::evt_initialize_pool::EvtInitializePoolEvent`.

| Field              | Type     |
| ------------------ | -------- |
| `pool`             | `Pubkey` |
| `config`           | `Pubkey` |
| `creator`          | `Pubkey` |
| `base_mint`        | `Pubkey` |
| `pool_type`        | `u8`     |
| `activation_point` | `u64`    |

### `EvtPartnerClaimPoolCreationFee`

Discriminator `aedf2c96916259c3` · `events::evt_partner_claim_pool_creation_fee::EvtPartnerClaimPoolCreationFeeEvent`.

| Field          | Type     |
| -------------- | -------- |
| `pool`         | `Pubkey` |
| `partner`      | `Pubkey` |
| `creation_fee` | `u64`    |
| `fee_receiver` | `Pubkey` |

### `EvtPartnerMetadata`

Discriminator `c87f06370d200896` · `events::evt_partner_metadata::EvtPartnerMetadataEvent`.

| Field              | Type     |
| ------------------ | -------- |
| `partner_metadata` | `Pubkey` |
| `fee_claimer`      | `Pubkey` |

### `EvtPartnerWithdrawMigrationFee`

Discriminator `b5697f4308bb7839` · `events::evt_partner_withdraw_migration_fee::EvtPartnerWithdrawMigrationFeeEvent`.

| Field  | Type     |
| ------ | -------- |
| `pool` | `Pubkey` |
| `fee`  | `u64`    |

### `EvtPartnerWithdrawSurplus`

Discriminator `c3389809e8482316` · `events::evt_partner_withdraw_surplus::EvtPartnerWithdrawSurplusEvent`.

| Field            | Type     |
| ---------------- | -------- |
| `pool`           | `Pubkey` |
| `surplus_amount` | `u64`    |

### `EvtSwap`

Discriminator `1b3c15d58aaabb93` · `events::evt_swap::EvtSwapEvent`.

| Field               | Type                                |
| ------------------- | ----------------------------------- |
| `pool`              | `Pubkey`                            |
| `config`            | `Pubkey`                            |
| `trade_direction`   | `u8`                                |
| `has_referral`      | `bool`                              |
| `params`            | [`SwapParameters`](#swapparameters) |
| `swap_result`       | [`SwapResult`](#swapresult)         |
| `amount_in`         | `u64`                               |
| `current_timestamp` | `u64`                               |

### `EvtSwap2`

Discriminator `bd4233a826507599` · `events::evt_swap2::EvtSwap2Event`.

| Field                  | Type                                  |
| ---------------------- | ------------------------------------- |
| `pool`                 | `Pubkey`                              |
| `config`               | `Pubkey`                              |
| `trade_direction`      | `u8`                                  |
| `has_referral`         | `bool`                                |
| `swap_parameters`      | [`SwapParameters2`](#swapparameters2) |
| `swap_result`          | [`SwapResult2`](#swapresult2)         |
| `quote_reserve_amount` | `u64`                                 |
| `migration_threshold`  | `u64`                                 |
| `current_timestamp`    | `u64`                                 |

### `EvtUpdatePoolCreator`

Discriminator `6be1a5ed5b9ed5dc` · `events::evt_update_pool_creator::EvtUpdatePoolCreatorEvent`.

| Field         | Type     |
| ------------- | -------- |
| `pool`        | `Pubkey` |
| `creator`     | `Pubkey` |
| `new_creator` | `Pubkey` |

### `EvtVirtualPoolMetadata`

Discriminator `bc12484cc35b264a` · `events::evt_virtual_pool_metadata::EvtVirtualPoolMetadataEvent`.

| Field                   | Type     |
| ----------------------- | -------- |
| `virtual_pool_metadata` | `Pubkey` |
| `virtual_pool`          | `Pubkey` |

### `EvtWithdrawLeftover`

Discriminator `bfbd688f6f9c5ee5` · `events::evt_withdraw_leftover::EvtWithdrawLeftoverEvent`.

| Field               | Type     |
| ------------------- | -------- |
| `pool`              | `Pubkey` |
| `leftover_receiver` | `Pubkey` |
| `leftover_amount`   | `u64`    |

### `EvtWithdrawMigrationFee`

Discriminator `1acb5455a11764d6` · `events::evt_withdraw_migration_fee::EvtWithdrawMigrationFeeEvent`.

| Field  | Type     |
| ------ | -------- |
| `pool` | `Pubkey` |
| `fee`  | `u64`    |
| `flag` | `u8`     |

## Types

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

### `BaseFeeConfig`

Struct `types::BaseFeeConfig`.

| Field                 | Type      |
| --------------------- | --------- |
| `cliff_fee_numerator` | `u64`     |
| `second_factor`       | `u64`     |
| `third_factor`        | `u64`     |
| `first_factor`        | `u16`     |
| `base_fee_mode`       | `u8`      |
| `padding0`            | `[u8; 5]` |

### `BaseFeeParameters`

Struct `types::BaseFeeParameters`.

| Field                 | Type  |
| --------------------- | ----- |
| `cliff_fee_numerator` | `u64` |
| `first_factor`        | `u16` |
| `second_factor`       | `u64` |
| `third_factor`        | `u64` |
| `base_fee_mode`       | `u8`  |

### `ConfigParameters`

Struct `types::ConfigParameters`.

| Field                                           | Type                                                                                  | Description                             |
| ----------------------------------------------- | ------------------------------------------------------------------------------------- | --------------------------------------- |
| `pool_fees`                                     | [`PoolFeeParameters`](#poolfeeparameters)                                             |                                         |
| `collect_fee_mode`                              | `u8`                                                                                  |                                         |
| `migration_option`                              | `u8`                                                                                  |                                         |
| `activation_type`                               | `u8`                                                                                  |                                         |
| `token_type`                                    | `u8`                                                                                  |                                         |
| `token_decimal`                                 | `u8`                                                                                  |                                         |
| `partner_liquidity_percentage`                  | `u8`                                                                                  |                                         |
| `partner_permanent_locked_liquidity_percentage` | `u8`                                                                                  |                                         |
| `creator_liquidity_percentage`                  | `u8`                                                                                  |                                         |
| `creator_permanent_locked_liquidity_percentage` | `u8`                                                                                  |                                         |
| `migration_quote_threshold`                     | `u64`                                                                                 |                                         |
| `sqrt_start_price`                              | `u128`                                                                                |                                         |
| `locked_vesting`                                | [`LockedVestingParams`](#lockedvestingparams)                                         |                                         |
| `migration_fee_option`                          | `u8`                                                                                  |                                         |
| `token_supply`                                  | [`Option<TokenSupplyParams>`](#tokensupplyparams)                                     |                                         |
| `creator_trading_fee_percentage`                | `u8`                                                                                  |                                         |
| `token_update_authority`                        | `u8`                                                                                  |                                         |
| `migration_fee`                                 | [`MigrationFee`](#migrationfee)                                                       |                                         |
| `migrated_pool_fee`                             | [`MigratedPoolFee`](#migratedpoolfee)                                                 |                                         |
| `pool_creation_fee`                             | `u64`                                                                                 | pool creation fee in SOL lamports value |
| `partner_liquidity_vesting_info`                | [`LiquidityVestingInfoParams`](#liquidityvestinginfoparams)                           |                                         |
| `creator_liquidity_vesting_info`                | [`LiquidityVestingInfoParams`](#liquidityvestinginfoparams)                           |                                         |
| `migrated_pool_base_fee_mode`                   | `u8`                                                                                  |                                         |
| `migrated_pool_market_cap_fee_scheduler_params` | [`MigratedPoolMarketCapFeeSchedulerParams`](#migratedpoolmarketcapfeeschedulerparams) |                                         |
| `enable_first_swap_with_min_fee`                | `bool`                                                                                |                                         |
| `compounding_fee_bps`                           | `u16`                                                                                 |                                         |
| `padding`                                       | `[u8; 2]`                                                                             | padding for future use                  |
| `curve`                                         | [`Vec<LiquidityDistributionParameters>`](#liquiditydistributionparameters)            |                                         |

### `CreatePartnerMetadataParameters`

Struct `types::CreatePartnerMetadataParameters`.

| Field     | Type       |
| --------- | ---------- |
| `padding` | `[u8; 96]` |
| `name`    | `String`   |
| `website` | `String`   |
| `logo`    | `String`   |

### `CreateVirtualPoolMetadataParameters`

Struct `types::CreateVirtualPoolMetadataParameters`.

| Field     | Type       |
| --------- | ---------- |
| `padding` | `[u8; 96]` |
| `name`    | `String`   |
| `website` | `String`   |
| `logo`    | `String`   |

### `DynamicFeeConfig`

Struct `types::DynamicFeeConfig`.

| Field                        | Type      |
| ---------------------------- | --------- |
| `initialized`                | `u8`      |
| `padding`                    | `[u8; 7]` |
| `max_volatility_accumulator` | `u32`     |
| `variable_fee_control`       | `u32`     |
| `bin_step`                   | `u16`     |
| `filter_period`              | `u16`     |
| `decay_period`               | `u16`     |
| `reduction_factor`           | `u16`     |
| `padding2`                   | `[u8; 8]` |
| `bin_step_u128`              | `u128`    |

### `DynamicFeeParameters`

Struct `types::DynamicFeeParameters`.

| Field                        | Type   |
| ---------------------------- | ------ |
| `bin_step`                   | `u16`  |
| `bin_step_u128`              | `u128` |
| `filter_period`              | `u16`  |
| `decay_period`               | `u16`  |
| `reduction_factor`           | `u16`  |
| `max_volatility_accumulator` | `u32`  |
| `variable_fee_control`       | `u32`  |

### `EvtClaimCreatorTradingFee`

Struct `types::EvtClaimCreatorTradingFee`. Same fields as the [`EvtClaimCreatorTradingFee`](#evtclaimcreatortradingfee) event.

### `EvtClaimPoolCreationFee`

Struct `types::EvtClaimPoolCreationFee`. Same fields as the [`EvtClaimPoolCreationFee`](#evtclaimpoolcreationfee) event.

### `EvtClaimProtocolFee`

Struct `types::EvtClaimProtocolFee`. Same fields as the [`EvtClaimProtocolFee`](#evtclaimprotocolfee) event.

### `EvtClaimProtocolLiquidityMigrationFee`

Struct `types::EvtClaimProtocolLiquidityMigrationFee`. Same fields as the [`EvtClaimProtocolLiquidityMigrationFee`](#evtclaimprotocolliquiditymigrationfee) event.

### `EvtClaimTradingFee`

Struct `types::EvtClaimTradingFee`. Same fields as the [`EvtClaimTradingFee`](#evtclaimtradingfee) event.

### `EvtCloseClaimFeeOperator`

> _From the program's IDL:_
>
> Close claim fee operator

Struct `types::EvtCloseClaimFeeOperator`. Same fields as the [`EvtCloseClaimFeeOperator`](#evtcloseclaimfeeoperator) event.

### `EvtCreateClaimFeeOperator`

> _From the program's IDL:_
>
> Create claim fee operator

Struct `types::EvtCreateClaimFeeOperator`. Same fields as the [`EvtCreateClaimFeeOperator`](#evtcreateclaimfeeoperator) event.

### `EvtCreateConfig`

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

Struct `types::EvtCreateConfig`. Same fields as the [`EvtCreateConfig`](#evtcreateconfig) event.

### `EvtCreateConfigV2`

Struct `types::EvtCreateConfigV2`. Same fields as the [`EvtCreateConfigV2`](#evtcreateconfigv2) event.

### `EvtCreateMeteoraMigrationMetadata`

Struct `types::EvtCreateMeteoraMigrationMetadata`. Same fields as the [`EvtCreateMeteoraMigrationMetadata`](#evtcreatemeteoramigrationmetadata) event.

### `EvtCreatorWithdrawSurplus`

Struct `types::EvtCreatorWithdrawSurplus`. Same fields as the [`EvtCreatorWithdrawSurplus`](#evtcreatorwithdrawsurplus) event.

### `EvtCurveComplete`

Struct `types::EvtCurveComplete`. Same fields as the [`EvtCurveComplete`](#evtcurvecomplete) event.

### `EvtInitializePool`

Struct `types::EvtInitializePool`. Same fields as the [`EvtInitializePool`](#evtinitializepool) event.

### `EvtPartnerClaimPoolCreationFee`

Struct `types::EvtPartnerClaimPoolCreationFee`. Same fields as the [`EvtPartnerClaimPoolCreationFee`](#evtpartnerclaimpoolcreationfee) event.

### `EvtPartnerMetadata`

> _From the program's IDL:_
>
> Create partner metadata

Struct `types::EvtPartnerMetadata`. Same fields as the [`EvtPartnerMetadata`](#evtpartnermetadata) event.

### `EvtPartnerWithdrawMigrationFee`

Struct `types::EvtPartnerWithdrawMigrationFee`. Same fields as the [`EvtPartnerWithdrawMigrationFee`](#evtpartnerwithdrawmigrationfee) event.

### `EvtPartnerWithdrawSurplus`

Struct `types::EvtPartnerWithdrawSurplus`. Same fields as the [`EvtPartnerWithdrawSurplus`](#evtpartnerwithdrawsurplus) event.

### `EvtSwap`

Struct `types::EvtSwap`. Same fields as the [`EvtSwap`](#evtswap) event.

### `EvtSwap2`

Struct `types::EvtSwap2`. Same fields as the [`EvtSwap2`](#evtswap2) event.

### `EvtUpdatePoolCreator`

Struct `types::EvtUpdatePoolCreator`. Same fields as the [`EvtUpdatePoolCreator`](#evtupdatepoolcreator) event.

### `EvtVirtualPoolMetadata`

> _From the program's IDL:_
>
> Create virtual pool metadata

Struct `types::EvtVirtualPoolMetadata`. Same fields as the [`EvtVirtualPoolMetadata`](#evtvirtualpoolmetadata) event.

### `EvtWithdrawLeftover`

Struct `types::EvtWithdrawLeftover`. Same fields as the [`EvtWithdrawLeftover`](#evtwithdrawleftover) event.

### `EvtWithdrawMigrationFee`

Struct `types::EvtWithdrawMigrationFee`. Same fields as the [`EvtWithdrawMigrationFee`](#evtwithdrawmigrationfee) event.

### `InitializePoolParameters`

Struct `types::InitializePoolParameters`.

| Field    | Type     |
| -------- | -------- |
| `name`   | `String` |
| `symbol` | `String` |
| `uri`    | `String` |

### `LiquidityDistributionConfig`

Struct `types::LiquidityDistributionConfig`.

| Field        | Type   |
| ------------ | ------ |
| `sqrt_price` | `u128` |
| `liquidity`  | `u128` |

### `LiquidityDistributionParameters`

Struct `types::LiquidityDistributionParameters`.

| Field        | Type   |
| ------------ | ------ |
| `sqrt_price` | `u128` |
| `liquidity`  | `u128` |

### `LiquidityVestingInfo`

Struct `types::LiquidityVestingInfo`.

| Field                                | Type      |
| ------------------------------------ | --------- |
| `is_initialized`                     | `u8`      |
| `vesting_percentage`                 | `u8`      |
| `padding`                            | `[u8; 2]` |
| `bps_per_period`                     | `u16`     |
| `number_of_periods`                  | `u16`     |
| `frequency`                          | `u32`     |
| `cliff_duration_from_migration_time` | `u32`     |

### `LiquidityVestingInfoParams`

Struct `types::LiquidityVestingInfoParams`.

| Field                                | Type  |
| ------------------------------------ | ----- |
| `vesting_percentage`                 | `u8`  |
| `bps_per_period`                     | `u16` |
| `number_of_periods`                  | `u16` |
| `cliff_duration_from_migration_time` | `u32` |
| `frequency`                          | `u32` |

### `LockedVestingConfig`

Struct `types::LockedVestingConfig`.

| Field                                | Type  |
| ------------------------------------ | ----- |
| `amount_per_period`                  | `u64` |
| `cliff_duration_from_migration_time` | `u64` |
| `frequency`                          | `u64` |
| `number_of_period`                   | `u64` |
| `cliff_unlock_amount`                | `u64` |
| `padding`                            | `u64` |

### `LockedVestingParams`

Struct `types::LockedVestingParams`.

| Field                                | Type  |
| ------------------------------------ | ----- |
| `amount_per_period`                  | `u64` |
| `cliff_duration_from_migration_time` | `u64` |
| `frequency`                          | `u64` |
| `number_of_period`                   | `u64` |
| `cliff_unlock_amount`                | `u64` |

### `MigratedPoolFee`

Struct `types::MigratedPoolFee`.

| Field              | Type  |
| ------------------ | ----- |
| `collect_fee_mode` | `u8`  |
| `dynamic_fee`      | `u8`  |
| `pool_fee_bps`     | `u16` |

### `MigratedPoolMarketCapFeeSchedulerParams`

Struct `types::MigratedPoolMarketCapFeeSchedulerParams`.

| Field                           | Type  |
| ------------------------------- | ----- |
| `number_of_period`              | `u16` |
| `sqrt_price_step_bps`           | `u16` |
| `scheduler_expiration_duration` | `u32` |
| `reduction_factor`              | `u64` |

### `MigrationFee`

Struct `types::MigrationFee`.

| Field                    | Type |
| ------------------------ | ---- |
| `fee_percentage`         | `u8` |
| `creator_fee_percentage` | `u8` |

### `PoolFeeParameters`

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

Struct `types::PoolFeeParameters`.

| Field         | Type                                                    | Description |
| ------------- | ------------------------------------------------------- | ----------- |
| `base_fee`    | [`BaseFeeParameters`](#basefeeparameters)               | Base fee    |
| `dynamic_fee` | [`Option<DynamicFeeParameters>`](#dynamicfeeparameters) | dynamic fee |

### `PoolFees`

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

Struct `types::PoolFees`.

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

### `PoolFeesConfig`

Struct `types::PoolFeesConfig`.

| Field         | Type                                    |
| ------------- | --------------------------------------- |
| `base_fee`    | [`BaseFeeConfig`](#basefeeconfig)       |
| `dynamic_fee` | [`DynamicFeeConfig`](#dynamicfeeconfig) |

### `PoolMetrics`

Struct `types::PoolMetrics`.

| Field                      | Type  |
| -------------------------- | ----- |
| `total_protocol_base_fee`  | `u64` |
| `total_protocol_quote_fee` | `u64` |
| `total_trading_base_fee`   | `u64` |
| `total_trading_quote_fee`  | `u64` |

### `SwapParameters`

Struct `types::SwapParameters`.

| Field                | Type  |
| -------------------- | ----- |
| `amount_in`          | `u64` |
| `minimum_amount_out` | `u64` |

### `SwapParameters2`

Struct `types::SwapParameters2`.

| Field       | Type  | Description                                                                                                            |
| ----------- | ----- | ---------------------------------------------------------------------------------------------------------------------- |
| `amount0`   | `u64` | When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out                 |
| `amount1`   | `u64` | When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in |
| `swap_mode` | `u8`  | Swap mode, refer \[SwapMode]                                                                                           |

### `SwapResult`

> _From the program's IDL:_
>
> Encodes all results of swapping

Struct `types::SwapResult`.

| Field                 | Type   |
| --------------------- | ------ |
| `actual_input_amount` | `u64`  |
| `output_amount`       | `u64`  |
| `next_sqrt_price`     | `u128` |
| `trading_fee`         | `u64`  |
| `protocol_fee`        | `u64`  |
| `referral_fee`        | `u64`  |

### `SwapResult2`

Struct `types::SwapResult2`.

| Field                       | Type   |
| --------------------------- | ------ |
| `included_fee_input_amount` | `u64`  |
| `excluded_fee_input_amount` | `u64`  |
| `amount_left`               | `u64`  |
| `output_amount`             | `u64`  |
| `next_sqrt_price`           | `u128` |
| `trading_fee`               | `u64`  |
| `protocol_fee`              | `u64`  |
| `referral_fee`              | `u64`  |

### `TokenSupplyParams`

Struct `types::TokenSupplyParams`.

| Field                         | Type  | Description                                                                                                                                                                                                                                                                                                  |
| ----------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pre_migration_token_supply`  | `u64` | pre migration token supply                                                                                                                                                                                                                                                                                   |
| `post_migration_token_supply` | `u64` | post migration token supply because DBC allow user to swap over the migration quote threshold, so in extreme case user may swap more than allowed buffer on curve that result the total supply in post migration may be increased a bit (between pre_migration_token_supply and post_migration_token_supply) |

### `VolatilityTracker`

Struct `types::VolatilityTracker`.

| Field                    | Type      |
| ------------------------ | --------- |
| `last_update_timestamp`  | `u64`     |
| `padding`                | `[u8; 8]` |
| `sqrt_price_reference`   | `u128`    |
| `volatility_accumulator` | `u128`    |
| `volatility_reference`   | `u128`    |

---

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