Meteora DBC decoder

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

On this page

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 for how decoders plug into a pipeline.

Cratecarbon-meteora-dbc-decoder 2.0.0
Installcargo add carbon-meteora-dbc-decoder@2.0.0
Program IDdbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN (carbon_meteora_dbc_decoder::PROGRAM_ID)
CategoryLaunchpads
Decodercarbon_meteora_dbc_decoder::MeteoraDbcDecoder
Instruction enuminstructions::MeteoraDbcInstruction
Account enumaccounts::MeteoraDbcAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-meteora-dbc-decoder/2.0.0
Sourcedecoders/meteora-dbc-decoder

Other launchpad decoders: Boop, Moonshot, Pump.fun, Raydium Launchpad, Vertigo, Virtuals, Wavebreak. To decode several in one pipeline, see launchpad 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 DBC transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:

Terminal
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
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(())
    }
}
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 MeteoraDbcInstruction::CpiEvent { data: CpiEvent::EvtClaimCreatorTradingFee(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 Config 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_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(())
    }
}
Terminal
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.

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

ClaimCreatorTradingFee#

Discriminator 52dcfabd03556b2d · data ClaimCreatorTradingFee · accounts ClaimCreatorTradingFeeInstructionAccounts.

FieldType
max_base_amountu64
max_quote_amountu64

Required accounts: 13; extras go to remaining.

Fields of ClaimCreatorTradingFeeInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1poolPubkey
2token_a_accountPubkey
3token_b_accountPubkey
4base_vaultPubkey
5quote_vaultPubkey
6base_mintPubkey
7quote_mintPubkey
8creatorPubkey
9token_base_programPubkey
10token_quote_programPubkey
11event_authorityPubkey
12programPubkey
13…remainingVec<AccountMeta>

ClaimPartnerPoolCreationFee#

Discriminator faee1a048b0a65f8 · data ClaimPartnerPoolCreationFee · accounts ClaimPartnerPoolCreationFeeInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of ClaimPartnerPoolCreationFeeInstructionAccounts, in account order:

#FieldType
0configPubkey
1poolPubkey
2fee_claimerPubkey
3fee_receiverPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

ClaimProtocolFee#

Discriminator a5e4853063f9ff21 · data ClaimProtocolFee · accounts ClaimProtocolFeeInstructionAccounts.

FieldType
max_base_amountu64
max_quote_amountu64

Required accounts: 15; extras go to remaining.

Fields of ClaimProtocolFeeInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2poolPubkey
3base_vaultPubkey
4quote_vaultPubkey
5base_mintPubkey
6quote_mintPubkey
7token_base_accountPubkey
8token_quote_accountPubkey
9operatorPubkey
10signerPubkey
11token_base_programPubkey
12token_quote_programPubkey
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

ClaimProtocolPoolCreationFee#

Discriminator 72cd53bcf0991936 · data ClaimProtocolPoolCreationFee · accounts ClaimProtocolPoolCreationFeeInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of ClaimProtocolPoolCreationFeeInstructionAccounts, in account order:

#FieldType
0configPubkey
1poolPubkey
2operatorPubkey
3signerPubkey
4treasuryPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

ClaimTradingFee#

Discriminator 08ec5931987db151 · data ClaimTradingFee · accounts ClaimTradingFeeInstructionAccounts.

FieldType
max_amount_au64
max_amount_bu64

Required accounts: 14; extras go to remaining.

Fields of ClaimTradingFeeInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2poolPubkey
3token_a_accountPubkey
4token_b_accountPubkey
5base_vaultPubkey
6quote_vaultPubkey
7base_mintPubkey
8quote_mintPubkey
9fee_claimerPubkey
10token_base_programPubkey
11token_quote_programPubkey
12event_authorityPubkey
13programPubkey
14…remainingVec<AccountMeta>

CloseClaimProtocolFeeOperator#

Discriminator 082957235030791a · data CloseClaimProtocolFeeOperator · accounts CloseClaimProtocolFeeOperatorInstructionAccounts.

No data fields.

Required accounts: 5; extras go to remaining.

Fields of CloseClaimProtocolFeeOperatorInstructionAccounts, in account order:

#FieldType
0claim_fee_operatorPubkey
1rent_receiverPubkey
2signerPubkey
3event_authorityPubkey
4programPubkey
5…remainingVec<AccountMeta>

CloseOperatorAccount#

Discriminator ab09d54a7817031d · data CloseOperatorAccount · accounts CloseOperatorAccountInstructionAccounts.

No data fields.

Required accounts: 3; extras go to remaining.

Fields of CloseOperatorAccountInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1signerPubkey
2rent_receiverPubkey
3…remainingVec<AccountMeta>

CreateConfig#

Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.

FieldType
config_parametersConfigParameters

Required accounts: 8; extras go to remaining.

Fields of CreateConfigInstructionAccounts, in account order:

#FieldType
0configPubkey
1fee_claimerPubkey
2leftover_receiverPubkey
3quote_mintPubkey
4payerPubkey
5system_programPubkey
6event_authorityPubkey
7programPubkey
8…remainingVec<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:

#FieldType
0virtual_poolPubkey
1configPubkey
2pool_authorityPubkey
3base_vaultPubkey
4base_mintPubkey
5basePubkey
6creatorPubkey
7escrowPubkey
8escrow_tokenPubkey
9payerPubkey
10token_programPubkey
11locker_programPubkey
12locker_event_authorityPubkey
13system_programPubkey
14…remainingVec<AccountMeta>

CreateOperatorAccount#

Discriminator dd40f695f099e5a3 · data CreateOperatorAccount · accounts CreateOperatorAccountInstructionAccounts.

FieldType
permissionu128

Required accounts: 7; extras go to remaining.

Fields of CreateOperatorAccountInstructionAccounts, in account order:

#FieldType
0operatorPubkey
1whitelisted_addressPubkey
2signerPubkey
3payerPubkey
4system_programPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

CreatePartnerMetadata#

From the program's IDL:

PARTNER FUNCTIONS ///

Discriminator c0a8eabfbce2e3ff · data CreatePartnerMetadata · accounts CreatePartnerMetadataInstructionAccounts.

Required accounts: 6; extras go to remaining.

Fields of CreatePartnerMetadataInstructionAccounts, in account order:

#FieldType
0partner_metadataPubkey
1payerPubkey
2fee_claimerPubkey
3system_programPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

CreateVirtualPoolMetadata#

Discriminator 2d61bb67fe6d7c86 · data CreateVirtualPoolMetadata · accounts CreateVirtualPoolMetadataInstructionAccounts.

Required accounts: 7; extras go to remaining.

Fields of CreateVirtualPoolMetadataInstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1virtual_pool_metadataPubkey
2creatorPubkey
3payerPubkey
4system_programPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

CreatorWithdrawSurplus#

Discriminator a50389071c864c50 · data CreatorWithdrawSurplus · accounts CreatorWithdrawSurplusInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of CreatorWithdrawSurplusInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2virtual_poolPubkey
3token_quote_accountPubkey
4quote_vaultPubkey
5quote_mintPubkey
6creatorPubkey
7token_quote_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

InitializeVirtualPoolWithSplToken#

From the program's IDL:

POOL CREATOR FUNCTIONS ////

Discriminator 8c55d7b06636684f · data InitializeVirtualPoolWithSplToken · accounts InitializeVirtualPoolWithSplTokenInstructionAccounts.

Required accounts: 16; extras go to remaining.

Fields of InitializeVirtualPoolWithSplTokenInstructionAccounts, in account order:

#FieldType
0configPubkey
1pool_authorityPubkey
2creatorPubkey
3base_mintPubkey
4quote_mintPubkey
5poolPubkey
6base_vaultPubkey
7quote_vaultPubkey
8mint_metadataPubkey
9metadata_programPubkey
10payerPubkey
11token_quote_programPubkey
12token_programPubkey
13system_programPubkey
14event_authorityPubkey
15programPubkey
16…remainingVec<AccountMeta>

InitializeVirtualPoolWithToken2022#

Discriminator a976334e916edc9b · data InitializeVirtualPoolWithToken2022 · accounts InitializeVirtualPoolWithToken2022InstructionAccounts.

Required accounts: 14; extras go to remaining.

Fields of InitializeVirtualPoolWithToken2022InstructionAccounts, in account order:

#FieldType
0configPubkey
1pool_authorityPubkey
2creatorPubkey
3base_mintPubkey
4quote_mintPubkey
5poolPubkey
6base_vaultPubkey
7quote_vaultPubkey
8payerPubkey
9token_quote_programPubkey
10token_programPubkey
11system_programPubkey
12event_authorityPubkey
13programPubkey
14…remainingVec<AccountMeta>

MigrateMeteoraDamm#

Discriminator 1b013016b43f76d9 · data MigrateMeteoraDamm · accounts MigrateMeteoraDammInstructionAccounts.

No data fields.

Required accounts: 31; extras go to remaining.

Fields of MigrateMeteoraDammInstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1migration_metadataPubkey
2configPubkey
3pool_authorityPubkey
4poolPubkey
5damm_configPubkey
6lp_mintPubkey
7token_a_mintPubkey
8token_b_mintPubkey
9a_vaultPubkey
10b_vaultPubkey
11a_token_vaultPubkey
12b_token_vaultPubkey
13a_vault_lp_mintPubkey
14b_vault_lp_mintPubkey
15a_vault_lpPubkey
16b_vault_lpPubkey
17base_vaultPubkey
18quote_vaultPubkey
19virtual_pool_lpPubkey
20protocol_token_a_feePubkey
21protocol_token_b_feePubkey
22payerPubkey
23rentPubkey
24mint_metadataPubkey
25metadata_programPubkey
26amm_programPubkey
27vault_programPubkey
28token_programPubkey
29associated_token_programPubkey
30system_programPubkey
31…remainingVec<AccountMeta>

MigrateMeteoraDammClaimLpToken#

Discriminator 8b85021e5b917f9a · data MigrateMeteoraDammClaimLpToken · accounts MigrateMeteoraDammClaimLpTokenInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of MigrateMeteoraDammClaimLpTokenInstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1migration_metadataPubkey
2pool_authorityPubkey
3lp_mintPubkey
4source_tokenPubkey
5destination_tokenPubkey
6ownerPubkey
7senderPubkey
8token_programPubkey
9…remainingVec<AccountMeta>

MigrateMeteoraDammLockLpToken#

Discriminator b137ee9dfb58a52a · data MigrateMeteoraDammLockLpToken · accounts MigrateMeteoraDammLockLpTokenInstructionAccounts.

No data fields.

Required accounts: 17; extras go to remaining.

Fields of MigrateMeteoraDammLockLpTokenInstructionAccounts, in account order:

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

MigrationDammV2#

Discriminator 9ca9e66735e45040 · data MigrationDammV2 · accounts MigrationDammV2InstructionAccounts.

No data fields.

Required accounts: 25; extras go to remaining.

Fields of MigrationDammV2InstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1migration_metadataPubkey
2configPubkey
3pool_authorityPubkey
4poolPubkey
5first_position_nft_mintPubkey
6first_position_nft_accountPubkey
7first_positionPubkey
8second_position_nft_mintOption<Pubkey>
9second_position_nft_accountOption<Pubkey>
10second_positionOption<Pubkey>
11damm_pool_authorityPubkey
12amm_programPubkey
13base_mintPubkey
14quote_mintPubkey
15token_a_vaultPubkey
16token_b_vaultPubkey
17base_vaultPubkey
18quote_vaultPubkey
19payerPubkey
20token_base_programPubkey
21token_quote_programPubkey
22token2022_programPubkey
23damm_event_authorityPubkey
24system_programPubkey
25…remainingVec<AccountMeta>

MigrationDammV2CreateMetadata#

Discriminator 6dbd1324c3b7de52 · data MigrationDammV2CreateMetadata · accounts MigrationDammV2CreateMetadataInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of MigrationDammV2CreateMetadataInstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1configPubkey
2migration_metadataPubkey
3payerPubkey
4system_programPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<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:

#FieldType
0virtual_poolPubkey
1configPubkey
2migration_metadataPubkey
3payerPubkey
4system_programPubkey
5event_authorityPubkey
6programPubkey
7…remainingVec<AccountMeta>

PartnerWithdrawSurplus#

Discriminator a8ad4864c962265c · data PartnerWithdrawSurplus · accounts PartnerWithdrawSurplusInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of PartnerWithdrawSurplusInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2virtual_poolPubkey
3token_quote_accountPubkey
4quote_vaultPubkey
5quote_mintPubkey
6fee_claimerPubkey
7token_quote_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

Swap#

From the program's IDL:

TRADING BOTS FUNCTIONS ////

Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.

FieldType
paramsSwapParameters

Required accounts: 15; extras go to remaining.

Fields of SwapInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2poolPubkey
3input_token_accountPubkey
4output_token_accountPubkey
5base_vaultPubkey
6quote_vaultPubkey
7base_mintPubkey
8quote_mintPubkey
9payerPubkey
10token_base_programPubkey
11token_quote_programPubkey
12referral_token_accountOption<Pubkey>
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

Swap2#

Discriminator 414b3f4ceb5b5b88 · data Swap2 · accounts Swap2InstructionAccounts.

FieldType
paramsSwapParameters2

Required accounts: 15; extras go to remaining.

Fields of Swap2InstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2poolPubkey
3input_token_accountPubkey
4output_token_accountPubkey
5base_vaultPubkey
6quote_vaultPubkey
7base_mintPubkey
8quote_mintPubkey
9payerPubkey
10token_base_programPubkey
11token_quote_programPubkey
12referral_token_accountOption<Pubkey>
13event_authorityPubkey
14programPubkey
15…remainingVec<AccountMeta>

TransferPoolCreator#

Discriminator 1407a9213a93a621 · data TransferPoolCreator · accounts TransferPoolCreatorInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of TransferPoolCreatorInstructionAccounts, in account order:

#FieldType
0virtual_poolPubkey
1configPubkey
2creatorPubkey
3new_creatorPubkey
4event_authorityPubkey
5programPubkey
6…remainingVec<AccountMeta>

WithdrawLeftover#

Discriminator 14c6caedebf3b742 · data WithdrawLeftover · accounts WithdrawLeftoverInstructionAccounts.

No data fields.

Required accounts: 10; extras go to remaining.

Fields of WithdrawLeftoverInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2virtual_poolPubkey
3token_base_accountPubkey
4base_vaultPubkey
5base_mintPubkey
6leftover_receiverPubkey
7token_base_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

WithdrawMigrationFee#

From the program's IDL:

BOTH partner and creator FUNCTIONS ///

Discriminator ed8e2d178106dea2 · data WithdrawMigrationFee · accounts WithdrawMigrationFeeInstructionAccounts.

FieldType
flagu8

Required accounts: 10; extras go to remaining.

Fields of WithdrawMigrationFeeInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2virtual_poolPubkey
3token_quote_accountPubkey
4quote_vaultPubkey
5quote_mintPubkey
6senderPubkey
7token_quote_programPubkey
8event_authorityPubkey
9programPubkey
10…remainingVec<AccountMeta>

ZapProtocolFee#

Discriminator d59bbb2238b65bf0 · data ZapProtocolFee · accounts ZapProtocolFeeInstructionAccounts.

FieldType
max_amountu64

Required accounts: 10; extras go to remaining.

Fields of ZapProtocolFeeInstructionAccounts, in account order:

#FieldType
0pool_authorityPubkey
1configPubkey
2poolPubkey
3token_vaultPubkey
4token_mintPubkey
5receiver_tokenPubkey
6operatorPubkey
7signerPubkey
8token_programPubkey
9sysvar_instructionsPubkey
10…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 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.

FieldTypeDescription
operatorPubkeyoperator
padding[u8; 128]Reserve

Config#

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

FieldType
pool_feesPoolFees
activation_durationu64
vault_config_keyPubkey
pool_creator_authorityPubkey
activation_typeu8
partner_fee_numeratoru64
padding[u8; 219]

LockEscrow#

Discriminator be6a7906c8b6154b · accounts::lock_escrow::LockEscrow.

FieldType
poolPubkey
ownerPubkey
escrow_vaultPubkey
bumpu8
total_locked_amountu64
lp_per_tokenu128
unclaimed_fee_pendingu64
a_feeu64
b_feeu64

MeteoraDammMigrationMetadata#

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

FieldTypeDescription
virtual_poolPubkeypool
_padding0[u8; 32]!!! BE CAREFUL to use tombstone field, previous is pool creator
partnerPubkeypartner
lp_mintPubkeylp mint
partner_locked_liquidityu64partner locked liquidity
partner_liquidityu64partner liquidity
creator_locked_liquidityu64creator locked liquidity
creator_liquidityu64creator liquidity
padding0u8padding
creator_locked_statusu8flag to check whether liquidity token is locked for creator
partner_locked_statusu8flag to check whether liquidity token is locked for partner
creator_claim_statusu8flag to check whether creator has claimed liquidity token
partner_claim_statusu8flag to check whether partner has claimed liquidity token
padding[u8; 107]Reserve

Operator#

Discriminator db1fbc91458bcc75 · accounts::operator::Operator.

FieldType
whitelisted_addressPubkey
permissionu128
padding[u64; 2]

PartnerMetadata#

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

FieldTypeDescription
fee_claimerPubkeyfee claimer
padding[u128; 6]padding for future use
nameStringName of partner.
websiteStringWebsite of partner.
logoStringLogo of partner

PoolConfig#

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

FieldTypeDescription
quote_mintPubkeyquote mint
fee_claimerPubkeyAddress to get the fee
leftover_receiverPubkeyAddress to receive extra base token after migration, in case token is fixed supply
pool_feesPoolFeesConfigPool fee
partner_liquidity_vesting_infoLiquidityVestingInfo
creator_liquidity_vesting_infoLiquidityVestingInfo
padding0[u8; 14]Padding for future use
padding1u16Previously was protocol and referral fee percent. Beware of tombstone.
collect_fee_modeu8Collect fee mode
migration_optionu8migration option
activation_typeu8whether mode slot or timestamp
token_decimalu8token decimals
versionu8version
token_typeu8token type of base token
quote_token_flagu8quote token flag
partner_permanent_locked_liquidity_percentageu8partner locked liquidity percentage
partner_liquidity_percentageu8partner liquidity percentage
creator_permanent_locked_liquidity_percentageu8creator post migration fee percentage
creator_liquidity_percentageu8creator liquidity percentage
migration_fee_optionu8migration fee option
fixed_token_supply_flagu8flag to indicate whether token is dynamic supply (0) or fixed supply (1)
creator_trading_fee_percentageu8creator trading fee percentage
token_update_authorityu8token update authority
migration_fee_percentageu8migration fee percentage
creator_migration_fee_percentageu8creator migration fee percentage
padding2[u8; 7]
swap_base_amountu64swap base amount
migration_quote_thresholdu64migration quote threshold (in quote token)
migration_base_thresholdu64migration base threshold (in base token)
migration_sqrt_priceu128migration sqrt price
locked_vesting_configLockedVestingConfiglocked vesting config
pre_migration_token_supplyu64pre migration token supply
post_migration_token_supplyu64post migration token supply
migrated_collect_fee_modeu8migrated pool collect fee mode
migrated_dynamic_feeu8migrated dynamic fee option.
migrated_pool_fee_bpsu16migrated pool fee in bps
migrated_pool_base_fee_modeu8
enable_first_swap_with_min_feeu8
migrated_compounding_fee_bpsu16compounding fee bps for migrated DAMM v2 pool, should only be non-zero if migrated_collect_fee_mode is 2 (Compounding)
pool_creation_feeu64pool 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_priceu128minimum price
curve[LiquidityDistributionConfig; 20]curve, only use 20 point firstly, we can extend that latter

VirtualPool#

Discriminator d5e005d16245775c · accounts::virtual_pool::VirtualPool.

FieldTypeDescription
volatility_trackerVolatilityTrackervolatility tracker
configPubkeyconfig key
creatorPubkeycreator
base_mintPubkeybase mint
base_vaultPubkeybase vault
quote_vaultPubkeyquote vault
base_reserveu64base reserve
quote_reserveu64quote reserve
protocol_base_feeu64protocol base fee
protocol_quote_feeu64protocol quote fee
partner_base_feeu64partner base fee
partner_quote_feeu64trading quote fee
sqrt_priceu128current price
activation_pointu64Activation point
pool_typeu8pool type, spl token or token2022
is_migratedu8is migrated
is_partner_withdraw_surplusu8is partner withdraw surplus
is_protocol_withdraw_surplusu8is protocol withdraw surplus
migration_progressu8migration progress
is_withdraw_leftoveru8is withdraw leftover
is_creator_withdraw_surplusu8is creator withdraw surplus
migration_fee_withdraw_statusu8migration fee withdraw status bit 1 (0b010) creator bit 2 (0b100) partner
metricsPoolMetricspool metrics
finish_curve_timestampu64The time curve is finished
creator_base_feeu64creator base fee
creator_quote_feeu64creator quote fee
legacy_creation_fee_bitsu8legacy creation fee bits, we dont use this now
creation_fee_bitsu8pool creation fee claim status
has_swapu8Cached flag
padding0[u8; 5]Padding for further use
protocol_liquidity_migration_fee_bpsu16
padding1[u8; 6]
protocol_migration_base_fee_amountu64
protocol_migration_quote_fee_amountu64
padding2[u64; 3]Padding for further use

VirtualPoolMetadata#

Discriminator d92552fa2b2fe4fe · accounts::virtual_pool_metadata::VirtualPoolMetadata.

FieldTypeDescription
virtual_poolPubkeyvirtual pool
padding[u128; 6]padding for future use
nameStringName of project.
websiteStringWebsite of project.
logoStringLogo 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.

FieldType
poolPubkey
token_base_amountu64
token_quote_amountu64

EvtClaimPoolCreationFee#

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

FieldType
poolPubkey
receiverPubkey
creation_feeu64

EvtClaimProtocolFee#

Discriminator baf44bfbbc0d1921 · events::evt_claim_protocol_fee::EvtClaimProtocolFeeEvent.

FieldType
poolPubkey
token_base_amountu64
token_quote_amountu64

EvtClaimProtocolLiquidityMigrationFee#

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

FieldType
poolPubkey
token_base_amountu64
token_quote_amountu64

EvtClaimTradingFee#

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

FieldType
poolPubkey
token_base_amountu64
token_quote_amountu64

EvtCloseClaimFeeOperator#

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

FieldType
claim_fee_operatorPubkey
operatorPubkey

EvtCreateClaimFeeOperator#

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

FieldType
operatorPubkey

EvtCreateConfig#

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

FieldType
configPubkey
quote_mintPubkey
fee_claimerPubkey
ownerPubkey
pool_feesPoolFeeParameters
collect_fee_modeu8
migration_optionu8
activation_typeu8
token_decimalu8
token_typeu8
partner_permanent_locked_liquidity_percentageu8
partner_liquidity_percentageu8
creator_permanent_locked_liquidity_percentageu8
creator_liquidity_percentageu8
swap_base_amountu64
migration_quote_thresholdu64
migration_base_amountu64
sqrt_start_priceu128
locked_vestingLockedVestingParams
migration_fee_optionu8
fixed_token_supply_flagu8
pre_migration_token_supplyu64
post_migration_token_supplyu64
curveVec<LiquidityDistributionParameters>

EvtCreateConfigV2#

Discriminator a34a42bb77c31a90 · events::evt_create_config_v2::EvtCreateConfigV2Event.

FieldType
configPubkey
quote_mintPubkey
fee_claimerPubkey
leftover_receiverPubkey
config_parametersConfigParameters

EvtCreateMeteoraMigrationMetadata#

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

FieldType
virtual_poolPubkey

EvtCreatorWithdrawSurplus#

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

FieldType
poolPubkey
surplus_amountu64

EvtCurveComplete#

Discriminator e5e756549c864b18 · events::evt_curve_complete::EvtCurveCompleteEvent.

FieldType
poolPubkey
configPubkey
base_reserveu64
quote_reserveu64

EvtInitializePool#

Discriminator e432f655cb428625 · events::evt_initialize_pool::EvtInitializePoolEvent.

FieldType
poolPubkey
configPubkey
creatorPubkey
base_mintPubkey
pool_typeu8
activation_pointu64

EvtPartnerClaimPoolCreationFee#

Discriminator aedf2c96916259c3 · events::evt_partner_claim_pool_creation_fee::EvtPartnerClaimPoolCreationFeeEvent.

FieldType
poolPubkey
partnerPubkey
creation_feeu64
fee_receiverPubkey

EvtPartnerMetadata#

Discriminator c87f06370d200896 · events::evt_partner_metadata::EvtPartnerMetadataEvent.

FieldType
partner_metadataPubkey
fee_claimerPubkey

EvtPartnerWithdrawMigrationFee#

Discriminator b5697f4308bb7839 · events::evt_partner_withdraw_migration_fee::EvtPartnerWithdrawMigrationFeeEvent.

FieldType
poolPubkey
feeu64

EvtPartnerWithdrawSurplus#

Discriminator c3389809e8482316 · events::evt_partner_withdraw_surplus::EvtPartnerWithdrawSurplusEvent.

FieldType
poolPubkey
surplus_amountu64

EvtSwap#

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

FieldType
poolPubkey
configPubkey
trade_directionu8
has_referralbool
paramsSwapParameters
swap_resultSwapResult
amount_inu64
current_timestampu64

EvtSwap2#

Discriminator bd4233a826507599 · events::evt_swap2::EvtSwap2Event.

FieldType
poolPubkey
configPubkey
trade_directionu8
has_referralbool
swap_parametersSwapParameters2
swap_resultSwapResult2
quote_reserve_amountu64
migration_thresholdu64
current_timestampu64

EvtUpdatePoolCreator#

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

FieldType
poolPubkey
creatorPubkey
new_creatorPubkey

EvtVirtualPoolMetadata#

Discriminator bc12484cc35b264a · events::evt_virtual_pool_metadata::EvtVirtualPoolMetadataEvent.

FieldType
virtual_pool_metadataPubkey
virtual_poolPubkey

EvtWithdrawLeftover#

Discriminator bfbd688f6f9c5ee5 · events::evt_withdraw_leftover::EvtWithdrawLeftoverEvent.

FieldType
poolPubkey
leftover_receiverPubkey
leftover_amountu64

EvtWithdrawMigrationFee#

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

FieldType
poolPubkey
feeu64
flagu8

Types#

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

BaseFeeConfig#

Struct types::BaseFeeConfig.

FieldType
cliff_fee_numeratoru64
second_factoru64
third_factoru64
first_factoru16
base_fee_modeu8
padding0[u8; 5]

BaseFeeParameters#

Struct types::BaseFeeParameters.

FieldType
cliff_fee_numeratoru64
first_factoru16
second_factoru64
third_factoru64
base_fee_modeu8

ConfigParameters#

Struct types::ConfigParameters.

FieldTypeDescription
pool_feesPoolFeeParameters
collect_fee_modeu8
migration_optionu8
activation_typeu8
token_typeu8
token_decimalu8
partner_liquidity_percentageu8
partner_permanent_locked_liquidity_percentageu8
creator_liquidity_percentageu8
creator_permanent_locked_liquidity_percentageu8
migration_quote_thresholdu64
sqrt_start_priceu128
locked_vestingLockedVestingParams
migration_fee_optionu8
token_supplyOption<TokenSupplyParams>
creator_trading_fee_percentageu8
token_update_authorityu8
migration_feeMigrationFee
migrated_pool_feeMigratedPoolFee
pool_creation_feeu64pool creation fee in SOL lamports value
partner_liquidity_vesting_infoLiquidityVestingInfoParams
creator_liquidity_vesting_infoLiquidityVestingInfoParams
migrated_pool_base_fee_modeu8
migrated_pool_market_cap_fee_scheduler_paramsMigratedPoolMarketCapFeeSchedulerParams
enable_first_swap_with_min_feebool
compounding_fee_bpsu16
padding[u8; 2]padding for future use
curveVec<LiquidityDistributionParameters>

CreatePartnerMetadataParameters#

Struct types::CreatePartnerMetadataParameters.

FieldType
padding[u8; 96]
nameString
websiteString
logoString

CreateVirtualPoolMetadataParameters#

Struct types::CreateVirtualPoolMetadataParameters.

FieldType
padding[u8; 96]
nameString
websiteString
logoString

DynamicFeeConfig#

Struct types::DynamicFeeConfig.

FieldType
initializedu8
padding[u8; 7]
max_volatility_accumulatoru32
variable_fee_controlu32
bin_stepu16
filter_periodu16
decay_periodu16
reduction_factoru16
padding2[u8; 8]
bin_step_u128u128

DynamicFeeParameters#

Struct types::DynamicFeeParameters.

FieldType
bin_stepu16
bin_step_u128u128
filter_periodu16
decay_periodu16
reduction_factoru16
max_volatility_accumulatoru32
variable_fee_controlu32

EvtClaimCreatorTradingFee#

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

EvtClaimPoolCreationFee#

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

EvtClaimProtocolFee#

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

EvtClaimProtocolLiquidityMigrationFee#

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

EvtClaimTradingFee#

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

EvtCloseClaimFeeOperator#

From the program's IDL:

Close claim fee operator

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

EvtCreateClaimFeeOperator#

From the program's IDL:

Create claim fee operator

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

EvtCreateConfig#

From the program's IDL:

Create config

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

EvtCreateConfigV2#

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

EvtCreateMeteoraMigrationMetadata#

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

EvtCreatorWithdrawSurplus#

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

EvtCurveComplete#

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

EvtInitializePool#

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

EvtPartnerClaimPoolCreationFee#

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

EvtPartnerMetadata#

From the program's IDL:

Create partner metadata

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

EvtPartnerWithdrawMigrationFee#

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

EvtPartnerWithdrawSurplus#

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

EvtSwap#

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

EvtSwap2#

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

EvtUpdatePoolCreator#

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

EvtVirtualPoolMetadata#

From the program's IDL:

Create virtual pool metadata

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

EvtWithdrawLeftover#

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

EvtWithdrawMigrationFee#

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

InitializePoolParameters#

Struct types::InitializePoolParameters.

FieldType
nameString
symbolString
uriString

LiquidityDistributionConfig#

Struct types::LiquidityDistributionConfig.

FieldType
sqrt_priceu128
liquidityu128

LiquidityDistributionParameters#

Struct types::LiquidityDistributionParameters.

FieldType
sqrt_priceu128
liquidityu128

LiquidityVestingInfo#

Struct types::LiquidityVestingInfo.

FieldType
is_initializedu8
vesting_percentageu8
padding[u8; 2]
bps_per_periodu16
number_of_periodsu16
frequencyu32
cliff_duration_from_migration_timeu32

LiquidityVestingInfoParams#

Struct types::LiquidityVestingInfoParams.

FieldType
vesting_percentageu8
bps_per_periodu16
number_of_periodsu16
cliff_duration_from_migration_timeu32
frequencyu32

LockedVestingConfig#

Struct types::LockedVestingConfig.

FieldType
amount_per_periodu64
cliff_duration_from_migration_timeu64
frequencyu64
number_of_periodu64
cliff_unlock_amountu64
paddingu64

LockedVestingParams#

Struct types::LockedVestingParams.

FieldType
amount_per_periodu64
cliff_duration_from_migration_timeu64
frequencyu64
number_of_periodu64
cliff_unlock_amountu64

MigratedPoolFee#

Struct types::MigratedPoolFee.

FieldType
collect_fee_modeu8
dynamic_feeu8
pool_fee_bpsu16

MigratedPoolMarketCapFeeSchedulerParams#

Struct types::MigratedPoolMarketCapFeeSchedulerParams.

FieldType
number_of_periodu16
sqrt_price_step_bpsu16
scheduler_expiration_durationu32
reduction_factoru64

MigrationFee#

Struct types::MigrationFee.

FieldType
fee_percentageu8
creator_fee_percentageu8

PoolFeeParameters#

From the program's IDL:

Information regarding fee charges

Struct types::PoolFeeParameters.

FieldTypeDescription
base_feeBaseFeeParametersBase fee
dynamic_feeOption<DynamicFeeParameters>dynamic fee

PoolFees#

From the program's IDL:

Information regarding fee charges

Struct types::PoolFees.

FieldType
trade_fee_numeratoru64
trade_fee_denominatoru64
protocol_trade_fee_numeratoru64
protocol_trade_fee_denominatoru64

PoolFeesConfig#

Struct types::PoolFeesConfig.

FieldType
base_feeBaseFeeConfig
dynamic_feeDynamicFeeConfig

PoolMetrics#

Struct types::PoolMetrics.

FieldType
total_protocol_base_feeu64
total_protocol_quote_feeu64
total_trading_base_feeu64
total_trading_quote_feeu64

SwapParameters#

Struct types::SwapParameters.

FieldType
amount_inu64
minimum_amount_outu64

SwapParameters2#

Struct types::SwapParameters2.

FieldTypeDescription
amount0u64When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out
amount1u64When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in
swap_modeu8Swap mode, refer [SwapMode]

SwapResult#

From the program's IDL:

Encodes all results of swapping

Struct types::SwapResult.

FieldType
actual_input_amountu64
output_amountu64
next_sqrt_priceu128
trading_feeu64
protocol_feeu64
referral_feeu64

SwapResult2#

Struct types::SwapResult2.

FieldType
included_fee_input_amountu64
excluded_fee_input_amountu64
amount_leftu64
output_amountu64
next_sqrt_priceu128
trading_feeu64
protocol_feeu64
referral_feeu64

TokenSupplyParams#

Struct types::TokenSupplyParams.

FieldTypeDescription
pre_migration_token_supplyu64pre migration token supply
post_migration_token_supplyu64post 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.

FieldType
last_update_timestampu64
padding[u8; 8]
sqrt_price_referenceu128
volatility_accumulatoru128
volatility_referenceu128

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.