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.
| Crate | carbon-meteora-pools-decoder 2.0.0 |
| Install | cargo add carbon-meteora-pools-decoder@2. |
| Program ID | Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB (carbon_) |
| Category | DEX & AMM |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Event enum | instructions:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-meteora-pools-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (import instructions::); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_.
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:
cargo add carbon-rpc-program-subscribe-datasource@2.0.0 solana-client@4.2.2use {
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(())
}
}RUST_LOG=info cargo runEach 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::, where data and accounts are the types listed under the variant, exported from carbon_. 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:
- The instruction's program ID is
Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB. - The data starts with the variant's discriminator, and the rest deserializes into its data type.
- 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_ too. Accounts after the listed ones are in accounts. as AccountMetas. The decoder doesn't record whether an account signed or was writable: read that from input. and ., which follow the same order. It doesn't check signer, writable, owner or PDA constraints either; the program enforced those when the transaction executed, so a decoded instruction from a successful transaction already satisfied them.
AddBalanceLiquidity#
From the program's IDL:
Deposit tokens to the pool in a balanced ratio.
Discriminator a8e3323ebdab54b0 · data AddBalanceLiquidity · accounts AddBalanceLiquidityInstructionAccounts.
| Field | Type |
|---|---|
pool_ | u64 |
maximum_ | u64 |
maximum_ | u64 |
Required accounts: 16; extras go to remaining.
Fields of AddBalanceLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault_lp | Pubkey |
| 4 | b_vault_lp | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | user_ | Pubkey |
| 12 | user_ | Pubkey |
| 13 | user | Pubkey |
| 14 | vault_ | Pubkey |
| 15 | token_ | Pubkey |
| 16… | remaining | Vec< |
AddImbalanceLiquidity#
From the program's IDL:
Deposit tokens to the pool in an imbalance ratio. Only supported by pool with stable swap curve.
Discriminator 4f237a54ad0f5dbf · data AddImbalanceLiquidity · accounts AddImbalanceLiquidityInstructionAccounts.
| Field | Type |
|---|---|
minimum_ | u64 |
token_ | u64 |
token_ | u64 |
Required accounts: 16; extras go to remaining.
Fields of AddImbalanceLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault_lp | Pubkey |
| 4 | b_vault_lp | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | user_ | Pubkey |
| 12 | user_ | Pubkey |
| 13 | user | Pubkey |
| 14 | vault_ | Pubkey |
| 15 | token_ | Pubkey |
| 16… | remaining | Vec< |
BootstrapLiquidity#
From the program's IDL:
Bootstrap the pool when liquidity is depleted.
Discriminator 04e4d747e1fd77ce · data BootstrapLiquidity · accounts BootstrapLiquidityInstructionAccounts.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
Required accounts: 16; extras go to remaining.
Fields of BootstrapLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault_lp | Pubkey |
| 4 | b_vault_lp | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | user_ | Pubkey |
| 12 | user_ | Pubkey |
| 13 | user | Pubkey |
| 14 | vault_ | Pubkey |
| 15 | token_ | Pubkey |
| 16… | remaining | Vec< |
ClaimFee#
From the program's IDL:
Claim fee
Discriminator a9204f8988e84689 · data ClaimFee · accounts ClaimFeeInstructionAccounts.
| Field | Type |
|---|---|
max_amount | u64 |
Required accounts: 18; extras go to remaining.
Fields of ClaimFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | lock_escrow | Pubkey |
| 3 | owner | Pubkey |
| 4 | source_ | Pubkey |
| 5 | escrow_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_vault | Pubkey |
| 10 | b_vault | Pubkey |
| 11 | a_vault_lp | Pubkey |
| 12 | b_vault_lp | Pubkey |
| 13 | a_ | Pubkey |
| 14 | b_ | Pubkey |
| 15 | user_ | Pubkey |
| 16 | user_ | Pubkey |
| 17 | vault_ | Pubkey |
| 18… | remaining | Vec< |
CloseConfig#
From the program's IDL:
Close config
Discriminator 9109489d5f7d3d55 · data CloseConfig · accounts CloseConfigInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of CloseConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | admin | Pubkey |
| 2 | rent_ | Pubkey |
| 3… | remaining | Vec< |
CreateConfig#
From the program's IDL:
Create config
Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.
| Field | Type |
|---|---|
config_ | ConfigParameters |
Required accounts: 3; extras go to remaining.
Fields of CreateConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | admin | Pubkey |
| 2 | system_ | Pubkey |
| 3… | remaining | Vec< |
CreateLockEscrow#
From the program's IDL:
Create lock account
Discriminator 3657a51345e3dae0 · data CreateLockEscrow · accounts CreateLockEscrowInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of CreateLockEscrowInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lock_escrow | Pubkey |
| 2 | owner | Pubkey |
| 3 | lp_mint | Pubkey |
| 4 | payer | Pubkey |
| 5 | system_ | Pubkey |
| 6… | remaining | Vec< |
CreateMintMetadata#
From the program's IDL:
Create mint metadata account for old pools
Discriminator 0d46a829fa64945a · data CreateMintMetadata · accounts CreateMintMetadataInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of CreateMintMetadataInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | a_vault_lp | Pubkey |
| 3 | mint_ | Pubkey |
| 4 | metadata_ | Pubkey |
| 5 | system_ | Pubkey |
| 6 | payer | Pubkey |
| 7… | remaining | Vec< |
EnableOrDisablePool#
From the program's IDL:
Enable or disable a pool. A disabled pool allow only remove balanced liquidity operation.
Discriminator 8006e48337a134a9 · data EnableOrDisablePool · accounts EnableOrDisablePoolInstructionAccounts.
| Field | Type |
|---|---|
enable | bool |
Required accounts: 2; extras go to remaining.
Fields of EnableOrDisablePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | admin | Pubkey |
| 2… | remaining | Vec< |
GetPoolInfo#
From the program's IDL:
Get the general information of the pool.
Discriminator 0930dc6516f04ec8 · data GetPoolInfo · accounts GetPoolInfoInstructionAccounts.
No data fields.
Required accounts: 8; extras go to remaining.
Fields of GetPoolInfoInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | a_vault_lp | Pubkey |
| 3 | b_vault_lp | Pubkey |
| 4 | a_vault | Pubkey |
| 5 | b_vault | Pubkey |
| 6 | a_ | Pubkey |
| 7 | b_ | Pubkey |
| 8… | remaining | Vec< |
InitializeCustomizablePermissionlessConstantProductPool#
From the program's IDL:
Initialize permissionless pool with customizable params
Discriminator 9118acc2db7d03be · data InitializeCustomizablePermissionlessConstantProductPool · accounts InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
params | CustomizableParams |
Required accounts: 25; extras go to remaining.
Fields of InitializeCustomizablePermissionlessConstantProductPoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | a_vault | Pubkey |
| 5 | b_vault | Pubkey |
| 6 | a_ | Pubkey |
| 7 | b_ | Pubkey |
| 8 | a_ | Pubkey |
| 9 | b_ | Pubkey |
| 10 | a_vault_lp | Pubkey |
| 11 | b_vault_lp | Pubkey |
| 12 | payer_ | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | protocol_ | Pubkey |
| 16 | protocol_ | Pubkey |
| 17 | payer | Pubkey |
| 18 | rent | Pubkey |
| 19 | mint_ | Pubkey |
| 20 | metadata_ | Pubkey |
| 21 | vault_ | Pubkey |
| 22 | token_ | Pubkey |
| 23 | associated_ | Pubkey |
| 24 | system_ | Pubkey |
| 25… | remaining | Vec< |
InitializePermissionedPool#
From the program's IDL:
Initialize a new permissioned pool.
Discriminator 4d55b29d3230d47e · data InitializePermissionedPool · accounts InitializePermissionedPoolInstructionAccounts.
| Field | Type |
|---|---|
curve_type | CurveType |
Required accounts: 24; extras go to remaining.
Fields of InitializePermissionedPoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | a_vault | Pubkey |
| 5 | b_vault | Pubkey |
| 6 | a_ | Pubkey |
| 7 | b_ | Pubkey |
| 8 | a_vault_lp | Pubkey |
| 9 | b_vault_lp | Pubkey |
| 10 | admin_ | Pubkey |
| 11 | admin_ | Pubkey |
| 12 | admin_ | Pubkey |
| 13 | protocol_ | Pubkey |
| 14 | protocol_ | Pubkey |
| 15 | admin | Pubkey |
| 16 | fee_owner | Pubkey |
| 17 | rent | Pubkey |
| 18 | mint_ | Pubkey |
| 19 | metadata_ | Pubkey |
| 20 | vault_ | Pubkey |
| 21 | token_ | Pubkey |
| 22 | associated_ | Pubkey |
| 23 | system_ | Pubkey |
| 24… | remaining | Vec< |
InitializePermissionlessConstantProductPoolWithConfig#
From the program's IDL:
Initialize permissionless pool with config
Discriminator 07a68aabceabecf4 · data InitializePermissionlessConstantProductPoolWithConfig · accounts InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
Required accounts: 26; extras go to remaining.
Fields of InitializePermissionlessConstantProductPoolWithConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | config | Pubkey |
| 2 | lp_mint | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | a_vault_lp | Pubkey |
| 12 | b_vault_lp | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | payer_ | Pubkey |
| 16 | protocol_ | Pubkey |
| 17 | protocol_ | Pubkey |
| 18 | payer | Pubkey |
| 19 | rent | Pubkey |
| 20 | mint_ | Pubkey |
| 21 | metadata_ | Pubkey |
| 22 | vault_ | Pubkey |
| 23 | token_ | Pubkey |
| 24 | associated_ | Pubkey |
| 25 | system_ | Pubkey |
| 26… | remaining | Vec< |
InitializePermissionlessConstantProductPoolWithConfig2#
From the program's IDL:
Initialize permissionless pool with config 2
Discriminator 3095dc823d0b09b2 · data InitializePermissionlessConstantProductPoolWithConfig2 · accounts InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
activation_ | Option<u64> |
Required accounts: 26; extras go to remaining.
Fields of InitializePermissionlessConstantProductPoolWithConfig2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | config | Pubkey |
| 2 | lp_mint | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | a_vault_lp | Pubkey |
| 12 | b_vault_lp | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | payer_ | Pubkey |
| 16 | protocol_ | Pubkey |
| 17 | protocol_ | Pubkey |
| 18 | payer | Pubkey |
| 19 | rent | Pubkey |
| 20 | mint_ | Pubkey |
| 21 | metadata_ | Pubkey |
| 22 | vault_ | Pubkey |
| 23 | token_ | Pubkey |
| 24 | associated_ | Pubkey |
| 25 | system_ | Pubkey |
| 26… | remaining | Vec< |
InitializePermissionlessPool#
From the program's IDL:
Initialize a new permissionless pool.
Discriminator 76ad299dad486167 · data InitializePermissionlessPool · accounts InitializePermissionlessPoolInstructionAccounts.
| Field | Type |
|---|---|
curve_type | CurveType |
token_ | u64 |
token_ | u64 |
Required accounts: 26; extras go to remaining.
Fields of InitializePermissionlessPoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | a_vault | Pubkey |
| 5 | b_vault | Pubkey |
| 6 | a_ | Pubkey |
| 7 | b_ | Pubkey |
| 8 | a_ | Pubkey |
| 9 | b_ | Pubkey |
| 10 | a_vault_lp | Pubkey |
| 11 | b_vault_lp | Pubkey |
| 12 | payer_ | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | protocol_ | Pubkey |
| 16 | protocol_ | Pubkey |
| 17 | payer | Pubkey |
| 18 | fee_owner | Pubkey |
| 19 | rent | Pubkey |
| 20 | mint_ | Pubkey |
| 21 | metadata_ | Pubkey |
| 22 | vault_ | Pubkey |
| 23 | token_ | Pubkey |
| 24 | associated_ | Pubkey |
| 25 | system_ | Pubkey |
| 26… | remaining | Vec< |
InitializePermissionlessPoolWithFeeTier#
From the program's IDL:
Initialize a new permissionless pool with customized fee tier
Discriminator 06874493e552a971 · data InitializePermissionlessPoolWithFeeTier · accounts InitializePermissionlessPoolWithFeeTierInstructionAccounts.
| Field | Type |
|---|---|
curve_type | CurveType |
trade_ | u64 |
token_ | u64 |
token_ | u64 |
Required accounts: 26; extras go to remaining.
Fields of InitializePermissionlessPoolWithFeeTierInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | a_vault | Pubkey |
| 5 | b_vault | Pubkey |
| 6 | a_ | Pubkey |
| 7 | b_ | Pubkey |
| 8 | a_ | Pubkey |
| 9 | b_ | Pubkey |
| 10 | a_vault_lp | Pubkey |
| 11 | b_vault_lp | Pubkey |
| 12 | payer_ | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | protocol_ | Pubkey |
| 16 | protocol_ | Pubkey |
| 17 | payer | Pubkey |
| 18 | fee_owner | Pubkey |
| 19 | rent | Pubkey |
| 20 | mint_ | Pubkey |
| 21 | metadata_ | Pubkey |
| 22 | vault_ | Pubkey |
| 23 | token_ | Pubkey |
| 24 | associated_ | Pubkey |
| 25 | system_ | Pubkey |
| 26… | remaining | Vec< |
Lock#
From the program's IDL:
Lock Lp token
Discriminator 1513d02bed3eff57 · data Lock · accounts LockInstructionAccounts.
| Field | Type |
|---|---|
max_amount | u64 |
Required accounts: 13; extras go to remaining.
Fields of LockInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | lock_escrow | Pubkey |
| 3 | owner | Pubkey |
| 4 | source_ | Pubkey |
| 5 | escrow_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | a_vault | Pubkey |
| 8 | b_vault | Pubkey |
| 9 | a_vault_lp | Pubkey |
| 10 | b_vault_lp | Pubkey |
| 11 | a_ | Pubkey |
| 12 | b_ | Pubkey |
| 13… | remaining | Vec< |
OverrideCurveParam#
From the program's IDL:
Update swap curve parameters. This function do not allow update of curve type. For example: stable swap curve to constant product curve. Only supported by pool with stable swap curve. Only amp is allowed to be override. The other attributes of stable swap curve will be ignored.
Discriminator 6256cc335e4745bb · data OverrideCurveParam · accounts OverrideCurveParamInstructionAccounts.
| Field | Type |
|---|---|
curve_type | CurveType |
Required accounts: 2; extras go to remaining.
Fields of OverrideCurveParamInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | admin | Pubkey |
| 2… | remaining | Vec< |
PartnerClaimFee#
From the program's IDL:
Partner claim fee
Discriminator 3935b01e7b463440 · data PartnerClaimFee · accounts PartnerClaimFeeInstructionAccounts.
| Field | Type |
|---|---|
max_ | u64 |
max_ | u64 |
Required accounts: 8; extras go to remaining.
Fields of PartnerClaimFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | a_vault_lp | Pubkey |
| 2 | protocol_ | Pubkey |
| 3 | protocol_ | Pubkey |
| 4 | partner_ | Pubkey |
| 5 | partner_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | partner_ | Pubkey |
| 8… | remaining | Vec< |
RemoveBalanceLiquidity#
From the program's IDL:
Withdraw tokens from the pool in a balanced ratio. User will still able to withdraw from pool even the pool is disabled. This allow user to exit their liquidity when there's some unforeseen event happen.
Discriminator 856d2cb338ee7221 · data RemoveBalanceLiquidity · accounts RemoveBalanceLiquidityInstructionAccounts.
| Field | Type |
|---|---|
pool_ | u64 |
minimum_ | u64 |
minimum_ | u64 |
Required accounts: 16; extras go to remaining.
Fields of RemoveBalanceLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault_lp | Pubkey |
| 4 | b_vault_lp | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | user_ | Pubkey |
| 12 | user_ | Pubkey |
| 13 | user | Pubkey |
| 14 | vault_ | Pubkey |
| 15 | token_ | Pubkey |
| 16… | remaining | Vec< |
RemoveLiquiditySingleSide#
From the program's IDL:
Withdraw only single token from the pool. Only supported by pool with stable swap curve.
Discriminator 5454b142feb90afb · data RemoveLiquiditySingleSide · accounts RemoveLiquiditySingleSideInstructionAccounts.
| Field | Type |
|---|---|
pool_ | u64 |
minimum_ | u64 |
Required accounts: 15; extras go to remaining.
Fields of RemoveLiquiditySingleSideInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault_lp | Pubkey |
| 4 | b_vault_lp | Pubkey |
| 5 | a_vault | Pubkey |
| 6 | b_vault | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_ | Pubkey |
| 10 | b_ | Pubkey |
| 11 | user_ | Pubkey |
| 12 | user | Pubkey |
| 13 | vault_ | Pubkey |
| 14 | token_ | Pubkey |
| 15… | remaining | Vec< |
SetPoolFees#
From the program's IDL:
Update trading fee charged for liquidity provider, and admin.
Discriminator 662c9e36cd257e4e · data SetPoolFees · accounts SetPoolFeesInstructionAccounts.
| Field | Type |
|---|---|
fees | PoolFees |
new_ | u64 |
Required accounts: 2; extras go to remaining.
Fields of SetPoolFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | fee_ | Pubkey |
| 2… | remaining | Vec< |
SetWhitelistedVault#
From the program's IDL:
Set whitelisted vault
Discriminator 0c945e2a373953f7 · data SetWhitelistedVault · accounts SetWhitelistedVaultInstructionAccounts.
| Field | Type |
|---|---|
whitelisted_ | Pubkey |
Required accounts: 2; extras go to remaining.
Fields of SetWhitelistedVaultInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | admin | Pubkey |
| 2… | remaining | Vec< |
Swap#
From the program's IDL:
Swap token A to B, or vice versa. An amount of trading fee will be charged for liquidity provider, and the admin of the pool.
Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.
| Field | Type |
|---|---|
in_amount | u64 |
minimum_ | u64 |
Required accounts: 15; extras go to remaining.
Fields of SwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | user_ | Pubkey |
| 2 | user_ | Pubkey |
| 3 | a_vault | Pubkey |
| 4 | b_vault | Pubkey |
| 5 | a_ | Pubkey |
| 6 | b_ | Pubkey |
| 7 | a_ | Pubkey |
| 8 | b_ | Pubkey |
| 9 | a_vault_lp | Pubkey |
| 10 | b_vault_lp | Pubkey |
| 11 | protocol_ | Pubkey |
| 12 | user | Pubkey |
| 13 | vault_ | Pubkey |
| 14 | token_ | Pubkey |
| 15… | remaining | Vec< |
UpdateActivationPoint#
From the program's IDL:
Update activation slot
Discriminator 963e7ddbabdc1aed · data UpdateActivationPoint · accounts UpdateActivationPointInstructionAccounts.
| Field | Type |
|---|---|
new_ | u64 |
Required accounts: 2; extras go to remaining.
Fields of UpdateActivationPointInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | admin | Pubkey |
| 2… | remaining | Vec< |
WithdrawProtocolFees#
From the program's IDL:
Withdraw protocol fee
Discriminator 0b44a56212d08649 · data WithdrawProtocolFees · accounts WithdrawProtocolFeesInstructionAccounts.
No data fields.
Required accounts: 7; extras go to remaining.
Fields of WithdrawProtocolFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | a_vault_lp | Pubkey |
| 2 | protocol_ | Pubkey |
| 3 | protocol_ | Pubkey |
| 4 | treasury_ | Pubkey |
| 5 | treasury_ | Pubkey |
| 6 | token_ | Pubkey |
| 7… | remaining | Vec< |
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:
| # | Field | Type |
|---|---|---|
| 0 | program | Pubkey |
| 1 | event_ | Pubkey |
| 2… | remaining | Vec< |
Accounts#
Variants of MeteoraPoolsAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
Config#
Discriminator 9b0caae01efacc82 · accounts::.
| Field | Type | Description |
|---|---|---|
pool_fees | PoolFees | |
activation_ | u64 | |
vault_ | Pubkey | |
pool_ | Pubkey | Only pool_creator_authority can use the current config to initialize new pool. When it's Pubkey::default, it's a public config. |
activation_ | u8 | Activation type |
partner_ | u64 | |
padding | [u8; 219] |
LockEscrow#
From the program's IDL:
State of lock escrow account
Discriminator be6a7906c8b6154b · accounts::.
| Field | Type | Description |
|---|---|---|
pool | Pubkey | Pool address |
owner | Pubkey | Owner address |
escrow_ | Pubkey | Vault address, store the lock user lock |
bump | u8 | bump, used to sign |
total_ | u64 | Total locked amount |
lp_ | u128 | Lp per token, virtual price of lp token |
unclaimed_ | u64 | Unclaimed fee pending |
a_fee | u64 | Total a fee claimed so far |
b_fee | u64 | Total b fee claimed so far |
Pool#
From the program's IDL:
State of pool account
Discriminator f19a6d0411b16dbc · accounts::.
| Field | Type | Description |
|---|---|---|
lp_mint | Pubkey | LP token mint of the pool |
token_ | Pubkey | Token A mint of the pool. Eg: USDT |
token_ | Pubkey | Token B mint of the pool. Eg: USDC |
a_vault | Pubkey | Vault account for token A. Token A of the pool will be deposit / withdraw from this vault account. |
b_vault | Pubkey | Vault account for token B. Token B of the pool will be deposit / withdraw from this vault account. |
a_vault_lp | Pubkey | LP token account of vault A. Used to receive/burn the vault LP upon deposit/withdraw from the vault. |
b_vault_lp | Pubkey | LP token account of vault B. Used to receive/burn the vault LP upon deposit/withdraw from the vault. |
a_ | u8 | "A" vault lp bump. Used to create signer seeds. |
enabled | bool | Flag to determine whether the pool is enabled, or disabled. |
protocol_ | Pubkey | Protocol fee token account for token A. Used to receive trading fee. |
protocol_ | Pubkey | Protocol fee token account for token B. Used to receive trading fee. |
fee_ | u64 | Fee last updated timestamp |
padding0 | [u8; 24] | |
fees | PoolFees | Store the fee charges setting. |
pool_type | PoolType | Pool type |
stake | Pubkey | Stake pubkey of SPL stake pool |
total_ | u64 | Total locked lp token |
bootstrapping | Bootstrapping | bootstrapping config |
partner_ | PartnerInfo | |
padding | Padding | Padding for future pool field |
curve_type | CurveType | The type of the swap curve supported by the pool. |
Events#
Variants of instructions::, decoded from the CpiEvent instruction. Each wraps a struct from carbon_. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.
AddLiquidity#
Discriminator 1f5e7d5ae3343dba · events::.
| Field | Type |
|---|---|
lp_ | u64 |
token_ | u64 |
token_ | u64 |
RemoveLiquidity#
Discriminator 74f461e8671f983a · events::.
| Field | Type |
|---|---|
lp_ | u64 |
token_ | u64 |
token_ | u64 |
BootstrapLiquidity#
Discriminator 797f26885c370ef7 · events::.
| Field | Type |
|---|---|
lp_ | u64 |
token_ | u64 |
token_ | u64 |
pool | Pubkey |
Swap#
Discriminator 516ce3becdd00ac4 · events::.
| Field | Type |
|---|---|
in_amount | u64 |
out_amount | u64 |
trade_fee | u64 |
protocol_ | u64 |
host_fee | u64 |
SetPoolFees#
Discriminator f51ac6a458124b09 · events::.
| Field | Type |
|---|---|
trade_ | u64 |
trade_ | u64 |
protocol_ | u64 |
protocol_ | u64 |
pool | Pubkey |
PoolInfo#
Discriminator cf145761fbd4ea2d · events::.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
virtual_ | f64 |
current_ | u64 |
TransferAdmin#
Discriminator e4a983f43d3841fe · events::.
| Field | Type |
|---|---|
admin | Pubkey |
new_admin | Pubkey |
pool | Pubkey |
OverrideCurveParam#
Discriminator f714a5f84b0536f6 · events::.
| Field | Type |
|---|---|
new_amp | u64 |
updated_ | u64 |
pool | Pubkey |
PoolCreated#
Discriminator ca2c295868dc9d52 · events::.
| Field | Type |
|---|---|
lp_mint | Pubkey |
token_ | Pubkey |
token_ | Pubkey |
pool_type | PoolType |
pool | Pubkey |
PoolEnabled#
Discriminator 02971253cc865cbf · events::.
| Field | Type |
|---|---|
pool | Pubkey |
enabled | bool |
MigrateFeeAccount#
Discriminator dfeae81afc69b47d · events::.
| Field | Type |
|---|---|
pool | Pubkey |
new_ | Pubkey |
new_ | Pubkey |
token_ | u64 |
token_ | u64 |
CreateLockEscrow#
Discriminator 4a5e6a8d3111626d · events::.
| Field | Type |
|---|---|
pool | Pubkey |
owner | Pubkey |
Lock#
Discriminator dcb743d799cf38ea · events::.
| Field | Type |
|---|---|
pool | Pubkey |
owner | Pubkey |
amount | u64 |
ClaimFee#
Discriminator 4b7a9a308c4a7ba3 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
owner | Pubkey |
amount | u64 |
a_fee | u64 |
b_fee | u64 |
CreateConfig#
Discriminator c7980a1327279d68 · events::.
| Field | Type |
|---|---|
trade_ | u64 |
protocol_ | u64 |
config | Pubkey |
CloseConfig#
Discriminator f9b56c5904965aae · events::.
| Field | Type |
|---|---|
config | Pubkey |
WithdrawProtocolFees#
Discriminator 1ef0cfc48bef4f1c · events::.
| Field | Type |
|---|---|
pool | Pubkey |
protocol_ | u64 |
protocol_ | u64 |
protocol_ | Pubkey |
protocol_ | Pubkey |
PartnerClaimFees#
Discriminator 87830a5e77d1ca30 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
fee_a | u64 |
fee_b | u64 |
partner | Pubkey |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
ActivationType#
From the program's IDL:
Type of the activation
Enum types::.
| Variant |
|---|
Slot |
Timestamp |
AddLiquidity#
Struct types::. Same fields as the AddLiquidity event.
BootstrapLiquidity#
Struct types::. Same fields as the BootstrapLiquidity event.
Bootstrapping#
Struct types::.
| Field | Type | Description |
|---|---|---|
activation_ | u64 | Activation point, can be slot or timestamp |
whitelisted_ | Pubkey | Whitelisted vault to be able to buy pool before activation_point |
pool_ | Pubkey | Need to store pool creator in lauch pool, so they can modify liquidity before activation_point |
activation_ | u8 | Activation type, 0 means by slot, 1 means by timestamp |
ClaimFee#
Struct types::. Same fields as the ClaimFee event.
CloseConfig#
Struct types::. Same fields as the CloseConfig event.
ConfigParameters#
Struct types::.
| Field | Type |
|---|---|
trade_ | u64 |
protocol_ | u64 |
activation_ | u64 |
vault_ | Pubkey |
pool_ | Pubkey |
activation_ | u8 |
index | u64 |
partner_ | u64 |
CreateConfig#
Struct types::. Same fields as the CreateConfig event.
CreateLockEscrow#
Struct types::. Same fields as the CreateLockEscrow event.
CurveType#
From the program's IDL:
Type of the swap curve
Enum types::.
| Variant | Fields |
|---|---|
ConstantProduct | |
Stable | amp: u64, token_: TokenMultiplier, depeg: Depeg, last_: u64 |
Stable fields:
| Field | Type | Description |
|---|---|---|
amp | u64 | Amplification coefficient |
token_ | TokenMultiplier | Multiplier for the pool token. Used to normalized token with different decimal into the same precision. |
depeg | Depeg | Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price |
last_ | u64 | The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period |
CustomizableParams#
Struct types::.
| Field | Type | Description |
|---|---|---|
trade_ | u32 | Trading fee. |
activation_ | Option<u64> | The pool start trading. |
has_ | bool | Whether the pool support alpha vault |
activation_ | u8 | Activation type |
padding | [u8; 90] | Padding |
Depeg#
From the program's IDL:
Contains information for depeg pool
Struct types::.
| Field | Type | Description |
|---|---|---|
base_ | u64 | The virtual price of staking / interest bearing token |
base_ | u64 | The last time base_virtual_price is updated |
depeg_type | DepegType | Type of the depeg pool |
DepegType#
From the program's IDL:
Type of depeg pool
Enum types::.
| Variant |
|---|
None |
Marinade |
Lido |
SplStake |
Lock#
Struct types::Lock. Same fields as the Lock event.
MigrateFeeAccount#
Struct types::. Same fields as the MigrateFeeAccount event.
NewCurveType#
From the program's IDL:
Type of the swap curve
Enum types::.
| Variant | Fields |
|---|---|
ConstantProduct | |
Stable | amp: u64, token_: TokenMultiplier, depeg: Depeg, last_: u64 |
NewCurve | field_one: u64, field_two: u64 |
Stable fields:
| Field | Type | Description |
|---|---|---|
amp | u64 | Amplification coefficient |
token_ | TokenMultiplier | Multiplier for the pool token. Used to normalized token with different decimal into the same precision. |
depeg | Depeg | Depeg pool information. Contains functions to allow token amount to be repeg using stake / interest bearing token virtual price |
last_ | u64 | The last amp updated timestamp. Used to prevent update_curve_info called infinitely many times within a short period |
OverrideCurveParam#
Struct types::. Same fields as the OverrideCurveParam event.
Padding#
From the program's IDL:
Padding for future pool fields
Struct types::.
| Field | Type | Description |
|---|---|---|
padding0 | [u8; 6] | Padding 0 |
padding1 | [u64; 21] | Padding 1 |
padding2 | [u64; 21] | Padding 2 |
PartnerClaimFees#
Struct types::. Same fields as the PartnerClaimFees event.
PartnerInfo#
Struct types::.
| Field | Type |
|---|---|
fee_ | u64 |
partner_ | Pubkey |
pending_ | u64 |
pending_ | u64 |
PoolCreated#
Struct types::. Same fields as the PoolCreated event.
PoolEnabled#
Struct types::. Same fields as the PoolEnabled event.
PoolFees#
From the program's IDL:
Information regarding fee charges
Struct types::.
| Field | Type | Description |
|---|---|---|
trade_ | u64 | Trade fees are extra token amounts that are held inside the token accounts during a trade, making the value of liquidity tokens rise. Trade fee numerator |
trade_ | u64 | Trade fee denominator |
protocol_ | u64 | Protocol trading fees are extra token amounts that are held inside the token accounts during a trade, with the equivalent in pool tokens minted to the protocol of the program. Protocol trade fee numerator |
protocol_ | u64 | Protocol trade fee denominator |
PoolInfo#
Struct types::. Same fields as the PoolInfo event.
PoolType#
From the program's IDL:
Pool type
Enum types::.
| Variant |
|---|
Permissioned |
Permissionless |
RemoveLiquidity#
Struct types::. Same fields as the RemoveLiquidity event.
RoundDirection#
From the program's IDL:
Rounding direction
Enum types::.
| Variant |
|---|
Floor |
Ceiling |
Rounding#
From the program's IDL:
Round up, down
Enum types::.
| Variant |
|---|
Up |
Down |
SetPoolFees#
Struct types::. 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::.
| Field | Type | Description |
|---|---|---|
token_ | u64 | Multiplier for token A of the pool. |
token_ | u64 | Multiplier for token B of the pool. |
precision_ | u8 | Record the highest token decimal in the pool. For example, Token A is 6 decimal, token B is 9 decimal. This will save value of 9. |
TradeDirection#
From the program's IDL:
Trade (swap) direction
Enum types::.
| Variant |
|---|
AtoB |
BtoA |
TransferAdmin#
Struct types::. Same fields as the TransferAdmin event.
WithdrawProtocolFees#
Struct types::. Same fields as the WithdrawProtocolFees event.