Meteora Pools decoder

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

On this page

carbon-meteora-pools-decoder decodes the instructions, accounts and events of the Meteora Pools program (Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB): 26 instructions, 3 account types, 18 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-meteora-pools-decoder 2.0.0
Installcargo add carbon-meteora-pools-decoder@2.0.0
Program IDEo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB (carbon_meteora_pools_decoder::PROGRAM_ID)
CategoryDEX & AMM
Decodercarbon_meteora_pools_decoder::MeteoraPoolsDecoder
Instruction enuminstructions::MeteoraPoolsInstruction
Account enumaccounts::MeteoraPoolsAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-meteora-pools-decoder/2.0.0
Sourcedecoders/meteora-pools-decoder

Other DEX and AMM decoders: BonkSwap, FluxBeam, Gavel, Heaven, Jupiter Limit Order, Jupiter Limit Order v2, Kamino Limit Order, Lifinity AMM v2, Meteora DAMM v2, Meteora DLMM, OpenBook v2, Orca Whirlpools, PancakeSwap, Phoenix v1, PumpSwap, Raydium AMM v4, Raydium CLMM, Raydium CPMM, Raydium Stable Swap, Stabble Stable Swap, Stabble Weighted Swap. To decode several in one pipeline, see dEX and AMM decoders.

The serde feature derives Serialize/Deserialize on every type, postgres adds tables and processors for Postgres, and graphql adds a schema for the GraphQL server.

Usage#

This program crawls recent Meteora Pools transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-meteora-pools-decoder@2.0.0 carbon-rpc-transaction-crawler-datasource@2.0.0 carbon-log-metrics@2.0.0 env_logger tokio --features tokio/full
src/main.rs
use {
    carbon_core::{
        error::CarbonResult, instruction::InstructionProcessorInputType, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_meteora_pools_decoder::{
        instructions::MeteoraPoolsInstruction, MeteoraPoolsDecoder, PROGRAM_ID,
    },
    carbon_rpc_transaction_crawler_datasource::{ConnectionConfig, Filters, RpcTransactionCrawler},
    std::sync::Arc,
};

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

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

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

struct InstructionLogger;

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

Events published with Anchor's emit_cpi! arrive as the CpiEvent instruction. Match them with MeteoraPoolsInstruction::CpiEvent { data: CpiEvent::AddLiquidity(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_log_events.

Decode accounts#

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

Terminal
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2
src/main.rs
use {
    carbon_core::{
        account::AccountProcessorInputType, error::CarbonResult, pipeline::Pipeline,
        processor::Processor,
    },
    carbon_log_metrics::LogMetrics,
    carbon_meteora_pools_decoder::{accounts::MeteoraPoolsAccount, MeteoraPoolsDecoder, PROGRAM_ID},
    carbon_rpc_program_subscribe_datasource::{Filters, RpcProgramSubscribe},
    solana_client::rpc_config::{RpcAccountInfoConfig, RpcProgramAccountsConfig, UiAccountEncoding},
    std::sync::Arc,
};

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

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

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

struct AccountLogger;

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

Each update to a Pool account prints its address and decoded fields; the program runs until you stop it. Cargo resolves solana-client to 4.2.2, the exact version the datasource pins, so both use the same RpcProgramAccountsConfig type. To load every existing account once instead of streaming changes, see load account state.

Instructions#

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

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

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

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

AddBalanceLiquidity#

From the program's IDL:

Deposit tokens to the pool in a balanced ratio.

Discriminator a8e3323ebdab54b0 · data AddBalanceLiquidity · accounts AddBalanceLiquidityInstructionAccounts.

FieldType
pool_token_amountu64
maximum_token_a_amountu64
maximum_token_b_amountu64

Required accounts: 16; extras go to remaining.

Fields of AddBalanceLiquidityInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2user_pool_lpPubkey
3a_vault_lpPubkey
4b_vault_lpPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_token_vaultPubkey
10b_token_vaultPubkey
11user_a_tokenPubkey
12user_b_tokenPubkey
13userPubkey
14vault_programPubkey
15token_programPubkey
16…remainingVec<AccountMeta>

AddImbalanceLiquidity#

From the program's IDL:

Deposit tokens to the pool in an imbalance ratio. Only supported by pool with stable swap curve.

Discriminator 4f237a54ad0f5dbf · data AddImbalanceLiquidity · accounts AddImbalanceLiquidityInstructionAccounts.

FieldType
minimum_pool_token_amountu64
token_a_amountu64
token_b_amountu64

Required accounts: 16; extras go to remaining.

Fields of AddImbalanceLiquidityInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2user_pool_lpPubkey
3a_vault_lpPubkey
4b_vault_lpPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_token_vaultPubkey
10b_token_vaultPubkey
11user_a_tokenPubkey
12user_b_tokenPubkey
13userPubkey
14vault_programPubkey
15token_programPubkey
16…remainingVec<AccountMeta>

BootstrapLiquidity#

From the program's IDL:

Bootstrap the pool when liquidity is depleted.

Discriminator 04e4d747e1fd77ce · data BootstrapLiquidity · accounts BootstrapLiquidityInstructionAccounts.

FieldType
token_a_amountu64
token_b_amountu64

Required accounts: 16; extras go to remaining.

Fields of BootstrapLiquidityInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2user_pool_lpPubkey
3a_vault_lpPubkey
4b_vault_lpPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_token_vaultPubkey
10b_token_vaultPubkey
11user_a_tokenPubkey
12user_b_tokenPubkey
13userPubkey
14vault_programPubkey
15token_programPubkey
16…remainingVec<AccountMeta>

ClaimFee#

From the program's IDL:

Claim fee

Discriminator a9204f8988e84689 · data ClaimFee · accounts ClaimFeeInstructionAccounts.

FieldType
max_amountu64

Required accounts: 18; extras go to remaining.

Fields of ClaimFeeInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2lock_escrowPubkey
3ownerPubkey
4source_tokensPubkey
5escrow_vaultPubkey
6token_programPubkey
7a_token_vaultPubkey
8b_token_vaultPubkey
9a_vaultPubkey
10b_vaultPubkey
11a_vault_lpPubkey
12b_vault_lpPubkey
13a_vault_lp_mintPubkey
14b_vault_lp_mintPubkey
15user_a_tokenPubkey
16user_b_tokenPubkey
17vault_programPubkey
18…remainingVec<AccountMeta>

CloseConfig#

From the program's IDL:

Close config

Discriminator 9109489d5f7d3d55 · data CloseConfig · accounts CloseConfigInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CloseConfigInstructionAccounts, in account order:

#FieldType
0configPubkey
1adminPubkey
2rent_receiverPubkey
3…remainingVec<AccountMeta>

CreateConfig#

From the program's IDL:

Create config

Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.

FieldType
config_parametersConfigParameters

Required accounts: 3; extras go to remaining.

Fields of CreateConfigInstructionAccounts, in account order:

#FieldType
0configPubkey
1adminPubkey
2system_programPubkey
3…remainingVec<AccountMeta>

CreateLockEscrow#

From the program's IDL:

Create lock account

Discriminator 3657a51345e3dae0 · data CreateLockEscrow · accounts CreateLockEscrowInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of CreateLockEscrowInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lock_escrowPubkey
2ownerPubkey
3lp_mintPubkey
4payerPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

CreateMintMetadata#

From the program's IDL:

Create mint metadata account for old pools

Discriminator 0d46a829fa64945a · data CreateMintMetadata · accounts CreateMintMetadataInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of CreateMintMetadataInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2a_vault_lpPubkey
3mint_metadataPubkey
4metadata_programPubkey
5system_programPubkey
6payerPubkey
7…remainingVec<AccountMeta>

EnableOrDisablePool#

From the program's IDL:

Enable or disable a pool. A disabled pool allow only remove balanced liquidity operation.

Discriminator 8006e48337a134a9 · data EnableOrDisablePool · accounts EnableOrDisablePoolInstructionAccounts.

FieldType
enablebool

Required accounts: 2; extras go to remaining.

Fields of EnableOrDisablePoolInstructionAccounts, in account order:

#FieldType
0poolPubkey
1adminPubkey
2…remainingVec<AccountMeta>

GetPoolInfo#

From the program's IDL:

Get the general information of the pool.

Discriminator 0930dc6516f04ec8 · data GetPoolInfo · accounts GetPoolInfoInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of GetPoolInfoInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2a_vault_lpPubkey
3b_vault_lpPubkey
4a_vaultPubkey
5b_vaultPubkey
6a_vault_lp_mintPubkey
7b_vault_lp_mintPubkey
8…remainingVec<AccountMeta>

InitializeCustomizablePermissionlessConstantProductPool#

From the program's IDL:

Initialize permissionless pool with customizable params

Discriminator 9118acc2db7d03be · data InitializeCustomizablePermissionlessConstantProductPool · accounts InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts.

FieldType
token_a_amountu64
token_b_amountu64
paramsCustomizableParams

Required accounts: 25; extras go to remaining.

Fields of InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2token_a_mintPubkey
3token_b_mintPubkey
4a_vaultPubkey
5b_vaultPubkey
6a_token_vaultPubkey
7b_token_vaultPubkey
8a_vault_lp_mintPubkey
9b_vault_lp_mintPubkey
10a_vault_lpPubkey
11b_vault_lpPubkey
12payer_token_aPubkey
13payer_token_bPubkey
14payer_pool_lpPubkey
15protocol_token_a_feePubkey
16protocol_token_b_feePubkey
17payerPubkey
18rentPubkey
19mint_metadataPubkey
20metadata_programPubkey
21vault_programPubkey
22token_programPubkey
23associated_token_programPubkey
24system_programPubkey
25…remainingVec<AccountMeta>

InitializePermissionedPool#

From the program's IDL:

Initialize a new permissioned pool.

Discriminator 4d55b29d3230d47e · data InitializePermissionedPool · accounts InitializePermissionedPoolInstructionAccounts.

FieldType
curve_typeCurveType

Required accounts: 24; extras go to remaining.

Fields of InitializePermissionedPoolInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2token_a_mintPubkey
3token_b_mintPubkey
4a_vaultPubkey
5b_vaultPubkey
6a_vault_lp_mintPubkey
7b_vault_lp_mintPubkey
8a_vault_lpPubkey
9b_vault_lpPubkey
10admin_token_aPubkey
11admin_token_bPubkey
12admin_pool_lpPubkey
13protocol_token_a_feePubkey
14protocol_token_b_feePubkey
15adminPubkey
16fee_ownerPubkey
17rentPubkey
18mint_metadataPubkey
19metadata_programPubkey
20vault_programPubkey
21token_programPubkey
22associated_token_programPubkey
23system_programPubkey
24…remainingVec<AccountMeta>

InitializePermissionlessConstantProductPoolWithConfig#

From the program's IDL:

Initialize permissionless pool with config

Discriminator 07a68aabceabecf4 · data InitializePermissionlessConstantProductPoolWithConfig · accounts InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts.

FieldType
token_a_amountu64
token_b_amountu64

Required accounts: 26; extras go to remaining.

Fields of InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts, in account order:

#FieldType
0poolPubkey
1configPubkey
2lp_mintPubkey
3token_a_mintPubkey
4token_b_mintPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_token_vaultPubkey
8b_token_vaultPubkey
9a_vault_lp_mintPubkey
10b_vault_lp_mintPubkey
11a_vault_lpPubkey
12b_vault_lpPubkey
13payer_token_aPubkey
14payer_token_bPubkey
15payer_pool_lpPubkey
16protocol_token_a_feePubkey
17protocol_token_b_feePubkey
18payerPubkey
19rentPubkey
20mint_metadataPubkey
21metadata_programPubkey
22vault_programPubkey
23token_programPubkey
24associated_token_programPubkey
25system_programPubkey
26…remainingVec<AccountMeta>

InitializePermissionlessConstantProductPoolWithConfig2#

From the program's IDL:

Initialize permissionless pool with config 2

Discriminator 3095dc823d0b09b2 · data InitializePermissionlessConstantProductPoolWithConfig2 · accounts InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts.

FieldType
token_a_amountu64
token_b_amountu64
activation_pointOption<u64>

Required accounts: 26; extras go to remaining.

Fields of InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts, in account order:

#FieldType
0poolPubkey
1configPubkey
2lp_mintPubkey
3token_a_mintPubkey
4token_b_mintPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_token_vaultPubkey
8b_token_vaultPubkey
9a_vault_lp_mintPubkey
10b_vault_lp_mintPubkey
11a_vault_lpPubkey
12b_vault_lpPubkey
13payer_token_aPubkey
14payer_token_bPubkey
15payer_pool_lpPubkey
16protocol_token_a_feePubkey
17protocol_token_b_feePubkey
18payerPubkey
19rentPubkey
20mint_metadataPubkey
21metadata_programPubkey
22vault_programPubkey
23token_programPubkey
24associated_token_programPubkey
25system_programPubkey
26…remainingVec<AccountMeta>

InitializePermissionlessPool#

From the program's IDL:

Initialize a new permissionless pool.

Discriminator 76ad299dad486167 · data InitializePermissionlessPool · accounts InitializePermissionlessPoolInstructionAccounts.

FieldType
curve_typeCurveType
token_a_amountu64
token_b_amountu64

Required accounts: 26; extras go to remaining.

Fields of InitializePermissionlessPoolInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2token_a_mintPubkey
3token_b_mintPubkey
4a_vaultPubkey
5b_vaultPubkey
6a_token_vaultPubkey
7b_token_vaultPubkey
8a_vault_lp_mintPubkey
9b_vault_lp_mintPubkey
10a_vault_lpPubkey
11b_vault_lpPubkey
12payer_token_aPubkey
13payer_token_bPubkey
14payer_pool_lpPubkey
15protocol_token_a_feePubkey
16protocol_token_b_feePubkey
17payerPubkey
18fee_ownerPubkey
19rentPubkey
20mint_metadataPubkey
21metadata_programPubkey
22vault_programPubkey
23token_programPubkey
24associated_token_programPubkey
25system_programPubkey
26…remainingVec<AccountMeta>

InitializePermissionlessPoolWithFeeTier#

From the program's IDL:

Initialize a new permissionless pool with customized fee tier

Discriminator 06874493e552a971 · data InitializePermissionlessPoolWithFeeTier · accounts InitializePermissionlessPoolWithFeeTierInstructionAccounts.

FieldType
curve_typeCurveType
trade_fee_bpsu64
token_a_amountu64
token_b_amountu64

Required accounts: 26; extras go to remaining.

Fields of InitializePermissionlessPoolWithFeeTierInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2token_a_mintPubkey
3token_b_mintPubkey
4a_vaultPubkey
5b_vaultPubkey
6a_token_vaultPubkey
7b_token_vaultPubkey
8a_vault_lp_mintPubkey
9b_vault_lp_mintPubkey
10a_vault_lpPubkey
11b_vault_lpPubkey
12payer_token_aPubkey
13payer_token_bPubkey
14payer_pool_lpPubkey
15protocol_token_a_feePubkey
16protocol_token_b_feePubkey
17payerPubkey
18fee_ownerPubkey
19rentPubkey
20mint_metadataPubkey
21metadata_programPubkey
22vault_programPubkey
23token_programPubkey
24associated_token_programPubkey
25system_programPubkey
26…remainingVec<AccountMeta>

Lock#

From the program's IDL:

Lock Lp token

Discriminator 1513d02bed3eff57 · data Lock · accounts LockInstructionAccounts.

FieldType
max_amountu64

Required accounts: 13; extras go to remaining.

Fields of LockInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2lock_escrowPubkey
3ownerPubkey
4source_tokensPubkey
5escrow_vaultPubkey
6token_programPubkey
7a_vaultPubkey
8b_vaultPubkey
9a_vault_lpPubkey
10b_vault_lpPubkey
11a_vault_lp_mintPubkey
12b_vault_lp_mintPubkey
13…remainingVec<AccountMeta>

OverrideCurveParam#

From the program's IDL:

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

Discriminator 6256cc335e4745bb · data OverrideCurveParam · accounts OverrideCurveParamInstructionAccounts.

FieldType
curve_typeCurveType

Required accounts: 2; extras go to remaining.

Fields of OverrideCurveParamInstructionAccounts, in account order:

#FieldType
0poolPubkey
1adminPubkey
2…remainingVec<AccountMeta>

PartnerClaimFee#

From the program's IDL:

Partner claim fee

Discriminator 3935b01e7b463440 · data PartnerClaimFee · accounts PartnerClaimFeeInstructionAccounts.

FieldType
max_amount_au64
max_amount_bu64

Required accounts: 8; extras go to remaining.

Fields of PartnerClaimFeeInstructionAccounts, in account order:

#FieldType
0poolPubkey
1a_vault_lpPubkey
2protocol_token_a_feePubkey
3protocol_token_b_feePubkey
4partner_token_aPubkey
5partner_token_bPubkey
6token_programPubkey
7partner_authorityPubkey
8…remainingVec<AccountMeta>

RemoveBalanceLiquidity#

From the program's IDL:

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

Discriminator 856d2cb338ee7221 · data RemoveBalanceLiquidity · accounts RemoveBalanceLiquidityInstructionAccounts.

FieldType
pool_token_amountu64
minimum_a_token_outu64
minimum_b_token_outu64

Required accounts: 16; extras go to remaining.

Fields of RemoveBalanceLiquidityInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2user_pool_lpPubkey
3a_vault_lpPubkey
4b_vault_lpPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_token_vaultPubkey
10b_token_vaultPubkey
11user_a_tokenPubkey
12user_b_tokenPubkey
13userPubkey
14vault_programPubkey
15token_programPubkey
16…remainingVec<AccountMeta>

RemoveLiquiditySingleSide#

From the program's IDL:

Withdraw only single token from the pool. Only supported by pool with stable swap curve.

Discriminator 5454b142feb90afb · data RemoveLiquiditySingleSide · accounts RemoveLiquiditySingleSideInstructionAccounts.

FieldType
pool_token_amountu64
minimum_out_amountu64

Required accounts: 15; extras go to remaining.

Fields of RemoveLiquiditySingleSideInstructionAccounts, in account order:

#FieldType
0poolPubkey
1lp_mintPubkey
2user_pool_lpPubkey
3a_vault_lpPubkey
4b_vault_lpPubkey
5a_vaultPubkey
6b_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_token_vaultPubkey
10b_token_vaultPubkey
11user_destination_tokenPubkey
12userPubkey
13vault_programPubkey
14token_programPubkey
15…remainingVec<AccountMeta>

SetPoolFees#

From the program's IDL:

Update trading fee charged for liquidity provider, and admin.

Discriminator 662c9e36cd257e4e · data SetPoolFees · accounts SetPoolFeesInstructionAccounts.

FieldType
feesPoolFees
new_partner_fee_numeratoru64

Required accounts: 2; extras go to remaining.

Fields of SetPoolFeesInstructionAccounts, in account order:

#FieldType
0poolPubkey
1fee_operatorPubkey
2…remainingVec<AccountMeta>

SetWhitelistedVault#

From the program's IDL:

Set whitelisted vault

Discriminator 0c945e2a373953f7 · data SetWhitelistedVault · accounts SetWhitelistedVaultInstructionAccounts.

FieldType
whitelisted_vaultPubkey

Required accounts: 2; extras go to remaining.

Fields of SetWhitelistedVaultInstructionAccounts, in account order:

#FieldType
0poolPubkey
1adminPubkey
2…remainingVec<AccountMeta>

Swap#

From the program's IDL:

Swap token A to B, or vice versa. An amount of trading fee will be charged for liquidity provider, and the admin of the pool.

Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.

FieldType
in_amountu64
minimum_out_amountu64

Required accounts: 15; extras go to remaining.

Fields of SwapInstructionAccounts, in account order:

#FieldType
0poolPubkey
1user_source_tokenPubkey
2user_destination_tokenPubkey
3a_vaultPubkey
4b_vaultPubkey
5a_token_vaultPubkey
6b_token_vaultPubkey
7a_vault_lp_mintPubkey
8b_vault_lp_mintPubkey
9a_vault_lpPubkey
10b_vault_lpPubkey
11protocol_token_feePubkey
12userPubkey
13vault_programPubkey
14token_programPubkey
15…remainingVec<AccountMeta>

UpdateActivationPoint#

From the program's IDL:

Update activation slot

Discriminator 963e7ddbabdc1aed · data UpdateActivationPoint · accounts UpdateActivationPointInstructionAccounts.

FieldType
new_activation_pointu64

Required accounts: 2; extras go to remaining.

Fields of UpdateActivationPointInstructionAccounts, in account order:

#FieldType
0poolPubkey
1adminPubkey
2…remainingVec<AccountMeta>

WithdrawProtocolFees#

From the program's IDL:

Withdraw protocol fee

Discriminator 0b44a56212d08649 · data WithdrawProtocolFees · accounts WithdrawProtocolFeesInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of WithdrawProtocolFeesInstructionAccounts, in account order:

#FieldType
0poolPubkey
1a_vault_lpPubkey
2protocol_token_a_feePubkey
3protocol_token_b_feePubkey
4treasury_token_aPubkey
5treasury_token_bPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

CpiEvent#

Anchor self-CPI that carries one of the program's 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:

#FieldType
0programPubkey
1event_authorityPubkey
2…remainingVec<AccountMeta>

Accounts#

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

Config#

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

FieldTypeDescription
pool_feesPoolFees
activation_durationu64
vault_config_keyPubkey
pool_creator_authorityPubkeyOnly pool_creator_authority can use the current config to initialize new pool. When it's Pubkey::default, it's a public config.
activation_typeu8Activation type
partner_fee_numeratoru64
padding[u8; 219]

LockEscrow#

From the program's IDL:

State of lock escrow account

Discriminator be6a7906c8b6154b · accounts::lock_escrow::LockEscrow.

FieldTypeDescription
poolPubkeyPool address
ownerPubkeyOwner address
escrow_vaultPubkeyVault address, store the lock user lock
bumpu8bump, used to sign
total_locked_amountu64Total locked amount
lp_per_tokenu128Lp per token, virtual price of lp token
unclaimed_fee_pendingu64Unclaimed fee pending
a_feeu64Total a fee claimed so far
b_feeu64Total b fee claimed so far

Pool#

From the program's IDL:

State of pool account

Discriminator f19a6d0411b16dbc · accounts::pool::Pool.

FieldTypeDescription
lp_mintPubkeyLP token mint of the pool
token_a_mintPubkeyToken A mint of the pool. Eg: USDT
token_b_mintPubkeyToken B mint of the pool. Eg: USDC
a_vaultPubkeyVault account for token A. Token A of the pool will be deposit / withdraw from this vault account.
b_vaultPubkeyVault account for token B. Token B of the pool will be deposit / withdraw from this vault account.
a_vault_lpPubkeyLP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault.
b_vault_lpPubkeyLP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault.
a_vault_lp_bumpu8"A" vault lp bump. Used to create signer seeds.
enabledboolFlag to determine whether the pool is enabled, or disabled.
protocol_token_a_feePubkeyProtocol fee token account for token A. Used to receive trading fee.
protocol_token_b_feePubkeyProtocol fee token account for token B. Used to receive trading fee.
fee_last_updated_atu64Fee last updated timestamp
padding0[u8; 24]
feesPoolFeesStore the fee charges setting.
pool_typePoolTypePool type
stakePubkeyStake pubkey of SPL stake pool
total_locked_lpu64Total locked lp token
bootstrappingBootstrappingbootstrapping config
partner_infoPartnerInfo
paddingPaddingPadding for future pool field
curve_typeCurveTypeThe type of the swap curve supported by the pool.

Events#

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

AddLiquidity#

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

FieldType
lp_mint_amountu64
token_a_amountu64
token_b_amountu64

RemoveLiquidity#

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

FieldType
lp_unmint_amountu64
token_a_out_amountu64
token_b_out_amountu64

BootstrapLiquidity#

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

FieldType
lp_mint_amountu64
token_a_amountu64
token_b_amountu64
poolPubkey

Swap#

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

FieldType
in_amountu64
out_amountu64
trade_feeu64
protocol_feeu64
host_feeu64

SetPoolFees#

Discriminator f51ac6a458124b09 · events::set_pool_fees::SetPoolFeesEvent.

FieldType
trade_fee_numeratoru64
trade_fee_denominatoru64
protocol_trade_fee_numeratoru64
protocol_trade_fee_denominatoru64
poolPubkey

PoolInfo#

Discriminator cf145761fbd4ea2d · events::pool_info::PoolInfoEvent.

FieldType
token_a_amountu64
token_b_amountu64
virtual_pricef64
current_timestampu64

TransferAdmin#

Discriminator e4a983f43d3841fe · events::transfer_admin::TransferAdminEvent.

FieldType
adminPubkey
new_adminPubkey
poolPubkey

OverrideCurveParam#

Discriminator f714a5f84b0536f6 · events::override_curve_param::OverrideCurveParamEvent.

FieldType
new_ampu64
updated_timestampu64
poolPubkey

PoolCreated#

Discriminator ca2c295868dc9d52 · events::pool_created::PoolCreatedEvent.

FieldType
lp_mintPubkey
token_a_mintPubkey
token_b_mintPubkey
pool_typePoolType
poolPubkey

PoolEnabled#

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

FieldType
poolPubkey
enabledbool

MigrateFeeAccount#

Discriminator dfeae81afc69b47d · events::migrate_fee_account::MigrateFeeAccountEvent.

FieldType
poolPubkey
new_admin_token_a_feePubkey
new_admin_token_b_feePubkey
token_a_amountu64
token_b_amountu64

CreateLockEscrow#

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

FieldType
poolPubkey
ownerPubkey

Lock#

Discriminator dcb743d799cf38ea · events::lock::LockEvent.

FieldType
poolPubkey
ownerPubkey
amountu64

ClaimFee#

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

FieldType
poolPubkey
ownerPubkey
amountu64
a_feeu64
b_feeu64

CreateConfig#

Discriminator c7980a1327279d68 · events::create_config::CreateConfigEvent.

FieldType
trade_fee_numeratoru64
protocol_trade_fee_numeratoru64
configPubkey

CloseConfig#

Discriminator f9b56c5904965aae · events::close_config::CloseConfigEvent.

FieldType
configPubkey

WithdrawProtocolFees#

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

FieldType
poolPubkey
protocol_a_feeu64
protocol_b_feeu64
protocol_a_fee_ownerPubkey
protocol_b_fee_ownerPubkey

PartnerClaimFees#

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

FieldType
poolPubkey
fee_au64
fee_bu64
partnerPubkey

Types#

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

ActivationType#

From the program's IDL:

Type of the activation

Enum types::ActivationType.

Variant
Slot
Timestamp

AddLiquidity#

Struct types::AddLiquidity. Same fields as the AddLiquidity event.

BootstrapLiquidity#

Struct types::BootstrapLiquidity. Same fields as the BootstrapLiquidity event.

Bootstrapping#

Struct types::Bootstrapping.

FieldTypeDescription
activation_pointu64Activation point, can be slot or timestamp
whitelisted_vaultPubkeyWhitelisted vault to be able to buy pool before activation_point
pool_creatorPubkeyNeed to store pool creator in lauch pool, so they can modify liquidity before activation_point
activation_typeu8Activation type, 0 means by slot, 1 means by timestamp

ClaimFee#

Struct types::ClaimFee. Same fields as the ClaimFee event.

CloseConfig#

Struct types::CloseConfig. Same fields as the CloseConfig event.

ConfigParameters#

Struct types::ConfigParameters.

FieldType
trade_fee_numeratoru64
protocol_trade_fee_numeratoru64
activation_durationu64
vault_config_keyPubkey
pool_creator_authorityPubkey
activation_typeu8
indexu64
partner_fee_numeratoru64

CreateConfig#

Struct types::CreateConfig. Same fields as the CreateConfig event.

CreateLockEscrow#

Struct types::CreateLockEscrow. Same fields as the CreateLockEscrow event.

CurveType#

From the program's IDL:

Type of the swap curve

Enum types::CurveType.

VariantFields
ConstantProduct
Stableamp: u64, token_multiplier: TokenMultiplier, depeg: Depeg, last_amp_updated_timestamp: u64

Stable fields:

FieldTypeDescription
ampu64Amplification coefficient
token_multiplierTokenMultiplierMultiplier for the pool token. Used to normalized token with different decimal into the same precision.
depegDepegDepeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price
last_amp_updated_timestampu64The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period

CustomizableParams#

Struct types::CustomizableParams.

FieldTypeDescription
trade_fee_numeratoru32Trading fee.
activation_pointOption<u64>The pool start trading.
has_alpha_vaultboolWhether the pool support alpha vault
activation_typeu8Activation type
padding[u8; 90]Padding

Depeg#

From the program's IDL:

Contains information for depeg pool

Struct types::Depeg.

FieldTypeDescription
base_virtual_priceu64The virtual price of staking / interest bearing token
base_cache_updatedu64The last time base_virtual_price is updated
depeg_typeDepegTypeType of the depeg pool

DepegType#

From the program's IDL:

Type of depeg pool

Enum types::DepegType.

Variant
None
Marinade
Lido
SplStake

Lock#

Struct types::Lock. Same fields as the Lock event.

MigrateFeeAccount#

Struct types::MigrateFeeAccount. Same fields as the MigrateFeeAccount event.

NewCurveType#

From the program's IDL:

Type of the swap curve

Enum types::NewCurveType.

VariantFields
ConstantProduct
Stableamp: u64, token_multiplier: TokenMultiplier, depeg: Depeg, last_amp_updated_timestamp: u64
NewCurvefield_one: u64, field_two: u64

Stable fields:

FieldTypeDescription
ampu64Amplification coefficient
token_multiplierTokenMultiplierMultiplier for the pool token. Used to normalized token with different decimal into the same precision.
depegDepegDepeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price
last_amp_updated_timestampu64The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period

OverrideCurveParam#

Struct types::OverrideCurveParam. Same fields as the OverrideCurveParam event.

Padding#

From the program's IDL:

Padding for future pool fields

Struct types::Padding.

FieldTypeDescription
padding0[u8; 6]Padding 0
padding1[u64; 21]Padding 1
padding2[u64; 21]Padding 2

PartnerClaimFees#

Struct types::PartnerClaimFees. Same fields as the PartnerClaimFees event.

PartnerInfo#

Struct types::PartnerInfo.

FieldType
fee_numeratoru64
partner_authorityPubkey
pending_fee_au64
pending_fee_bu64

PoolCreated#

Struct types::PoolCreated. Same fields as the PoolCreated event.

PoolEnabled#

Struct types::PoolEnabled. Same fields as the PoolEnabled event.

PoolFees#

From the program's IDL:

Information regarding fee charges

Struct types::PoolFees.

FieldTypeDescription
trade_fee_numeratoru64Trade fees are extra token amounts that are held inside the token accounts during a trade, making the value of liquidity tokens rise. Trade fee numerator
trade_fee_denominatoru64Trade fee denominator
protocol_trade_fee_numeratoru64Protocol trading fees are extra token amounts that are held inside the token accounts during a trade, with the equivalent in pool tokens minted to the protocol of the program. Protocol trade fee numerator
protocol_trade_fee_denominatoru64Protocol trade fee denominator

PoolInfo#

Struct types::PoolInfo. Same fields as the PoolInfo event.

PoolType#

From the program's IDL:

Pool type

Enum types::PoolType.

Variant
Permissioned
Permissionless

RemoveLiquidity#

Struct types::RemoveLiquidity. Same fields as the RemoveLiquidity event.

RoundDirection#

From the program's IDL:

Rounding direction

Enum types::RoundDirection.

Variant
Floor
Ceiling

Rounding#

From the program's IDL:

Round up, down

Enum types::Rounding.

Variant
Up
Down

SetPoolFees#

Struct types::SetPoolFees. Same fields as the SetPoolFees event.

Swap#

Struct types::Swap. Same fields as the Swap event.

TokenMultiplier#

From the program's IDL:

Multiplier for the pool token. Used to normalized token with different decimal into the same precision.

Struct types::TokenMultiplier.

FieldTypeDescription
token_a_multiplieru64Multiplier for token A of the pool.
token_b_multiplieru64Multiplier for token B of the pool.
precision_factoru8Record the highest token decimal in the pool. For example, Token A is 6 decimal, token B is 9 decimal. This will save value of 9.

TradeDirection#

From the program's IDL:

Trade (swap) direction

Enum types::TradeDirection.

Variant
AtoB
BtoA

TransferAdmin#

Struct types::TransferAdmin. Same fields as the TransferAdmin event.

WithdrawProtocolFees#

Struct types::WithdrawProtocolFees. Same fields as the WithdrawProtocolFees event.

Generated from the crate’s source at Carbon v2.0.0, so it always matches the published code. Spotted a problem? Report it; edits to this page itself are overwritten on the next release.

Your endpoints

Code samples use these instead of the placeholders, so you can copy and run them as they are. They’re stored only in this browser and never sent anywhere.