Meteora DAMM v2 decoder
Decode Meteora DAMM v2 instructions, accounts and events in Rust with the carbon-meteora-damm-v2-decoder crate.
On this page
carbon-meteora-damm-v2-decoder decodes the instructions, accounts and events of the Meteora DAMM v2 program (cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG): 38 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.
| Crate | carbon-meteora-damm-v2-decoder 2.0.0 |
| Install | cargo add carbon-meteora-damm-v2-decoder@2. |
| Program ID | cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG (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-damm-v2-decoder/2.0.0 |
| Source | decoders/meteora-damm-v2-decoder |
Other DEX and AMM decoders: BonkSwap, FluxBeam, Gavel, Heaven, Jupiter Limit Order, Jupiter Limit Order v2, Kamino Limit Order, Lifinity AMM v2, Meteora DLMM, Meteora Pools, 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 DAMM v2 transactions from the public RPC and prints every decoded Swap instruction. Add the dependencies:
cargo add carbon-core@2.0.0 carbon-meteora-damm-v2-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_damm_v2_decoder::{
instructions::MeteoraDammV2Instruction, MeteoraDammV2Decoder, 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(MeteoraDammV2Decoder, InstructionLogger)
.build()?
.run()
.await
}
struct InstructionLogger;
impl Processor<InstructionProcessorInputType<'_, MeteoraDammV2Instruction>> for InstructionLogger {
async fn process(
&mut self,
input: &InstructionProcessorInputType<'_, MeteoraDammV2Instruction>,
) -> CarbonResult<()> {
let signature = input.metadata.transaction_metadata.signature;
if let MeteoraDammV2Instruction::Swap { data, accounts, .. } = input.decoded_instruction {
println!("swap {signature}: {data:?} pool_authority={}", accounts.pool_authority);
}
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 MeteoraDammV2Instruction:: (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_damm_v2_decoder::{
accounts::MeteoraDammV2Account, MeteoraDammV2Decoder, 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(MeteoraDammV2Decoder, AccountLogger)
.build()?
.run()
.await
}
struct AccountLogger;
impl Processor<AccountProcessorInputType<'_, MeteoraDammV2Account>> for AccountLogger {
async fn process(
&mut self,
input: &AccountProcessorInputType<'_, MeteoraDammV2Account>,
) -> CarbonResult<()> {
if let MeteoraDammV2Account::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 MeteoraDammV2Instruction. Each is MeteoraDammV2Instruction::, 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
cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG. - 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.
AddLiquidity#
Discriminator b59d59438fb63448 · data AddLiquidity · accounts AddLiquidityInstructionAccounts.
| Field | Type |
|---|---|
params | AddLiquidityParameters |
Required accounts: 14; extras go to remaining.
Fields of AddLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | position | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | position_ | Pubkey |
| 9 | owner | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | event_ | Pubkey |
| 13 | program | Pubkey |
| 14… | remaining | Vec< |
ClaimPositionFee#
Discriminator b4269a118521a2d3 · data ClaimPositionFee · accounts ClaimPositionFeeInstructionAccounts.
No data fields.
Required accounts: 15; extras go to remaining.
Fields of ClaimPositionFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | position | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | position_ | Pubkey |
| 10 | owner | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | event_ | Pubkey |
| 14 | program | Pubkey |
| 15… | remaining | Vec< |
ClaimProtocolFee#
Discriminator a5e4853063f9ff21 · data ClaimProtocolFee · accounts ClaimProtocolFeeInstructionAccounts.
| Field | Type |
|---|---|
max_ | u64 |
max_ | u64 |
Required accounts: 14; extras go to remaining.
Fields of ClaimProtocolFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_ | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | operator | Pubkey |
| 9 | signer | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | event_ | Pubkey |
| 13 | program | Pubkey |
| 14… | remaining | Vec< |
ClaimReward#
Discriminator 955fb5f25e5a9ea2 · data ClaimReward · accounts ClaimRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
skip_reward | u8 |
Required accounts: 11; extras go to remaining.
Fields of ClaimRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | position | Pubkey |
| 3 | reward_ | Pubkey |
| 4 | reward_mint | Pubkey |
| 5 | user_ | Pubkey |
| 6 | position_ | Pubkey |
| 7 | owner | Pubkey |
| 8 | token_ | Pubkey |
| 9 | event_ | Pubkey |
| 10 | program | Pubkey |
| 11… | remaining | Vec< |
CloseConfig#
Discriminator 9109489d5f7d3d55 · data CloseConfig · accounts CloseConfigInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of CloseConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | rent_ | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
CloseOperatorAccount#
Discriminator ab09d54a7817031d · data CloseOperatorAccount · accounts CloseOperatorAccountInstructionAccounts.
No data fields.
Required accounts: 5; extras go to remaining.
Fields of CloseOperatorAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | operator | Pubkey |
| 1 | signer | Pubkey |
| 2 | rent_ | Pubkey |
| 3 | event_ | Pubkey |
| 4 | program | Pubkey |
| 5… | remaining | Vec< |
ClosePosition#
Discriminator 7b86510031446262 · data ClosePosition · accounts ClosePositionInstructionAccounts.
No data fields.
Required accounts: 10; extras go to remaining.
Fields of ClosePositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | position_ | Pubkey |
| 1 | position_ | Pubkey |
| 2 | pool | Pubkey |
| 3 | position | Pubkey |
| 4 | pool_ | Pubkey |
| 5 | rent_ | Pubkey |
| 6 | owner | Pubkey |
| 7 | token_ | Pubkey |
| 8 | event_ | Pubkey |
| 9 | program | Pubkey |
| 10… | remaining | Vec< |
CloseTokenBadge#
Discriminator 6c92566eb3fe0a68 · data CloseTokenBadge · accounts CloseTokenBadgeInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of CloseTokenBadgeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_badge | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | rent_ | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
CreateConfig#
From the program's IDL:
OPERATOR FUNCTIONS /////
Discriminator c9cff3724b6f2fbd · data CreateConfig · accounts CreateConfigInstructionAccounts.
| Field | Type |
|---|---|
index | u64 |
config_ | StaticConfigParameters |
Required accounts: 7; extras go to remaining.
Fields of CreateConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | payer | Pubkey |
| 4 | system_ | Pubkey |
| 5 | event_ | Pubkey |
| 6 | program | Pubkey |
| 7… | remaining | Vec< |
CreateDynamicConfig#
Discriminator 51fb7a4e4239d052 · data CreateDynamicConfig · accounts CreateDynamicConfigInstructionAccounts.
| Field | Type |
|---|---|
index | u64 |
config_ | DynamicConfigParameters |
Required accounts: 7; extras go to remaining.
Fields of CreateDynamicConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | payer | Pubkey |
| 4 | system_ | Pubkey |
| 5 | event_ | Pubkey |
| 6 | program | Pubkey |
| 7… | remaining | Vec< |
CreateOperatorAccount#
From the program's IDL:
ADMIN FUNCTIONS /////
Discriminator dd40f695f099e5a3 · data CreateOperatorAccount · accounts CreateOperatorAccountInstructionAccounts.
| Field | Type |
|---|---|
permission | u128 |
Required accounts: 7; extras go to remaining.
Fields of CreateOperatorAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | operator | Pubkey |
| 1 | whitelisted_ | Pubkey |
| 2 | signer | Pubkey |
| 3 | payer | Pubkey |
| 4 | system_ | Pubkey |
| 5 | event_ | Pubkey |
| 6 | program | Pubkey |
| 7… | remaining | Vec< |
CreatePosition#
Discriminator 30d7c59960cbb485 · data CreatePosition · accounts CreatePositionInstructionAccounts.
No data fields.
Required accounts: 11; extras go to remaining.
Fields of CreatePositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | owner | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | pool | Pubkey |
| 4 | position | Pubkey |
| 5 | pool_ | Pubkey |
| 6 | payer | Pubkey |
| 7 | token_ | Pubkey |
| 8 | system_ | Pubkey |
| 9 | event_ | Pubkey |
| 10 | program | Pubkey |
| 11… | remaining | Vec< |
CreateTokenBadge#
Discriminator 58ce005b3caf9776 · data CreateTokenBadge · accounts CreateTokenBadgeInstructionAccounts.
No data fields.
Required accounts: 8; extras go to remaining.
Fields of CreateTokenBadgeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | token_badge | Pubkey |
| 1 | token_mint | Pubkey |
| 2 | operator | Pubkey |
| 3 | signer | Pubkey |
| 4 | payer | Pubkey |
| 5 | system_ | Pubkey |
| 6 | event_ | Pubkey |
| 7 | program | Pubkey |
| 8… | remaining | Vec< |
DummyIx#
Discriminator ea5fb0b9072a239f · data DummyIx · accounts DummyIxInstructionAccounts.
| Field | Type |
|---|---|
ixs | DummyParams |
Required accounts: 3; extras go to remaining.
Fields of DummyIxInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pod_ | Pubkey |
| 1 | pod_ | Pubkey |
| 2 | pod_ | Pubkey |
| 3… | remaining | Vec< |
FixConfigFeeParams#
Discriminator 261ed851fab1f3fe · data FixConfigFeeParams · accounts FixConfigFeeParamsInstructionAccounts.
| Field | Type |
|---|---|
params | BaseFeeParameters |
Required accounts: 3; extras go to remaining.
Fields of FixConfigFeeParamsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | config | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3… | remaining | Vec< |
FixPoolFeeParams#
Discriminator 846251c42c3a78c1 · data FixPoolFeeParams · accounts FixPoolFeeParamsInstructionAccounts.
| Field | Type |
|---|---|
params | BaseFeeParameters |
Required accounts: 3; extras go to remaining.
Fields of FixPoolFeeParamsInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3… | remaining | Vec< |
FixPoolLayoutVersion#
Discriminator a69e452351a7c8d7 · data FixPoolLayoutVersion · accounts FixPoolLayoutVersionInstructionAccounts.
No data fields.
Required accounts: 3; extras go to remaining.
Fields of FixPoolLayoutVersionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3… | remaining | Vec< |
FundReward#
Discriminator bc32f9a55d97263f · data FundReward · accounts FundRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
amount | u64 |
carry_ | bool |
Required accounts: 8; extras go to remaining.
Fields of FundRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | reward_ | Pubkey |
| 2 | reward_mint | Pubkey |
| 3 | funder_ | Pubkey |
| 4 | funder | Pubkey |
| 5 | token_ | Pubkey |
| 6 | event_ | Pubkey |
| 7 | program | Pubkey |
| 8… | remaining | Vec< |
InitializeCustomizablePool#
Discriminator 14a1f118bdddb402 · data InitializeCustomizablePool · accounts InitializeCustomizablePoolInstructionAccounts.
| Field | Type |
|---|---|
params | InitializeCustomizablePoolParameters |
Required accounts: 19; extras go to remaining.
Fields of InitializeCustomizablePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | creator | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | payer | Pubkey |
| 4 | pool_ | Pubkey |
| 5 | pool | Pubkey |
| 6 | position | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | payer_ | Pubkey |
| 12 | payer_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | token2022_ | Pubkey |
| 16 | system_ | Pubkey |
| 17 | event_ | Pubkey |
| 18 | program | Pubkey |
| 19… | remaining | Vec< |
InitializePool#
From the program's IDL:
USER FUNCTIONS ////
Discriminator 5fb40aac54aee828 · data InitializePool · accounts InitializePoolInstructionAccounts.
| Field | Type |
|---|---|
params | InitializePoolParameters |
Required accounts: 20; extras go to remaining.
Fields of InitializePoolInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | creator | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | payer | Pubkey |
| 4 | config | Pubkey |
| 5 | pool_ | Pubkey |
| 6 | pool | Pubkey |
| 7 | position | Pubkey |
| 8 | token_ | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | payer_ | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | token_ | Pubkey |
| 16 | token2022_ | Pubkey |
| 17 | system_ | Pubkey |
| 18 | event_ | Pubkey |
| 19 | program | Pubkey |
| 20… | remaining | Vec< |
InitializePoolWithDynamicConfig#
Discriminator 955248c5fdfc440f · data InitializePoolWithDynamicConfig · accounts InitializePoolWithDynamicConfigInstructionAccounts.
| Field | Type |
|---|---|
params | InitializeCustomizablePoolParameters |
Required accounts: 21; extras go to remaining.
Fields of InitializePoolWithDynamicConfigInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | creator | Pubkey |
| 1 | position_ | Pubkey |
| 2 | position_ | Pubkey |
| 3 | payer | Pubkey |
| 4 | pool_ | Pubkey |
| 5 | config | Pubkey |
| 6 | pool_ | Pubkey |
| 7 | pool | Pubkey |
| 8 | position | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | payer_ | Pubkey |
| 14 | payer_ | Pubkey |
| 15 | token_ | Pubkey |
| 16 | token_ | Pubkey |
| 17 | token2022_ | Pubkey |
| 18 | system_ | Pubkey |
| 19 | event_ | Pubkey |
| 20 | program | Pubkey |
| 21… | remaining | Vec< |
InitializeReward#
Discriminator 5f87c0c4f281e644 · data InitializeReward · accounts InitializeRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
reward_ | u64 |
funder | Pubkey |
Required accounts: 10; extras go to remaining.
Fields of InitializeRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | reward_ | Pubkey |
| 3 | reward_mint | Pubkey |
| 4 | signer | Pubkey |
| 5 | payer | Pubkey |
| 6 | token_ | Pubkey |
| 7 | system_ | Pubkey |
| 8 | event_ | Pubkey |
| 9 | program | Pubkey |
| 10… | remaining | Vec< |
LockInnerPosition#
Discriminator 481331cc127a175a · data LockInnerPosition · accounts LockInnerPositionInstructionAccounts.
| Field | Type |
|---|---|
params | VestingParameters |
Required accounts: 6; extras go to remaining.
Fields of LockInnerPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | position | Pubkey |
| 2 | position_ | Pubkey |
| 3 | owner | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
LockPosition#
Discriminator e33e02fcf70aabb9 · data LockPosition · accounts LockPositionInstructionAccounts.
| Field | Type |
|---|---|
params | VestingParameters |
Required accounts: 9; extras go to remaining.
Fields of LockPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | position | Pubkey |
| 2 | vesting | Pubkey |
| 3 | position_ | Pubkey |
| 4 | owner | Pubkey |
| 5 | payer | Pubkey |
| 6 | system_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
PermanentLockPosition#
Discriminator a5b07d06e7abbad5 · data PermanentLockPosition · accounts PermanentLockPositionInstructionAccounts.
| Field | Type |
|---|---|
permanent_ | u128 |
Required accounts: 6; extras go to remaining.
Fields of PermanentLockPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | position | Pubkey |
| 2 | position_ | Pubkey |
| 3 | owner | Pubkey |
| 4 | event_ | Pubkey |
| 5 | program | Pubkey |
| 6… | remaining | Vec< |
RefreshVesting#
Discriminator 095ed80e74ccf700 · data RefreshVesting · accounts RefreshVestingInstructionAccounts.
No data fields.
Required accounts: 4; extras go to remaining.
Fields of RefreshVestingInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | position | Pubkey |
| 2 | position_ | Pubkey |
| 3 | owner | Pubkey |
| 4… | remaining | Vec< |
RemoveAllLiquidity#
Discriminator 0a333d2370691855 · data RemoveAllLiquidity · accounts RemoveAllLiquidityInstructionAccounts.
| Field | Type |
|---|---|
token_ | u64 |
token_ | u64 |
Required accounts: 15; extras go to remaining.
Fields of RemoveAllLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | position | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | position_ | Pubkey |
| 10 | owner | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | event_ | Pubkey |
| 14 | program | Pubkey |
| 15… | remaining | Vec< |
RemoveLiquidity#
Discriminator 5055d14818ceb16c · data RemoveLiquidity · accounts RemoveLiquidityInstructionAccounts.
| Field | Type |
|---|---|
params | RemoveLiquidityParameters |
Required accounts: 15; extras go to remaining.
Fields of RemoveLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | position | Pubkey |
| 3 | token_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | token_ | Pubkey |
| 9 | position_ | Pubkey |
| 10 | owner | Pubkey |
| 11 | token_ | Pubkey |
| 12 | token_ | Pubkey |
| 13 | event_ | Pubkey |
| 14 | program | Pubkey |
| 15… | remaining | Vec< |
SetPoolStatus#
Discriminator 705787df53cc8435 · data SetPoolStatus · accounts SetPoolStatusInstructionAccounts.
| Field | Type |
|---|---|
status | u8 |
Required accounts: 5; extras go to remaining.
Fields of SetPoolStatusInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | event_ | Pubkey |
| 4 | program | Pubkey |
| 5… | remaining | Vec< |
SplitPosition#
Discriminator acf1dd8aa11dfd2a · data SplitPosition · accounts SplitPositionInstructionAccounts.
| Field | Type |
|---|---|
params | SplitPositionParameters |
Required accounts: 9; extras go to remaining.
Fields of SplitPositionInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | first_ | Pubkey |
| 2 | first_ | Pubkey |
| 3 | second_ | Pubkey |
| 4 | second_ | Pubkey |
| 5 | first_owner | Pubkey |
| 6 | second_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
SplitPosition2#
Discriminator dd93e4cf8cd41177 · data SplitPosition2 · accounts SplitPosition2InstructionAccounts.
| Field | Type |
|---|---|
numerator | u32 |
Required accounts: 9; extras go to remaining.
Fields of SplitPosition2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | first_ | Pubkey |
| 2 | first_ | Pubkey |
| 3 | second_ | Pubkey |
| 4 | second_ | Pubkey |
| 5 | first_owner | Pubkey |
| 6 | second_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
Swap#
Discriminator f8c69e91e17587c8 · data Swap · accounts SwapInstructionAccounts.
| Field | Type |
|---|---|
params | SwapParameters |
Required accounts: 14; extras go to remaining.
Fields of SwapInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | input_ | Pubkey |
| 3 | output_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | payer | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | referral_ | Option< |
| 12 | event_ | Pubkey |
| 13 | program | Pubkey |
| 14… | remaining | Vec< |
Swap2#
Discriminator 414b3f4ceb5b5b88 · data Swap2 · accounts Swap2InstructionAccounts.
| Field | Type |
|---|---|
params | SwapParameters2 |
Required accounts: 14; extras go to remaining.
Fields of Swap2InstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | input_ | Pubkey |
| 3 | output_ | Pubkey |
| 4 | token_ | Pubkey |
| 5 | token_ | Pubkey |
| 6 | token_ | Pubkey |
| 7 | token_ | Pubkey |
| 8 | payer | Pubkey |
| 9 | token_ | Pubkey |
| 10 | token_ | Pubkey |
| 11 | referral_ | Option< |
| 12 | event_ | Pubkey |
| 13 | program | Pubkey |
| 14… | remaining | Vec< |
UpdatePoolFees#
Discriminator 76d9cbb33c084659 · data UpdatePoolFees · accounts UpdatePoolFeesInstructionAccounts.
| Field | Type |
|---|---|
params | UpdatePoolFeesParameters |
Required accounts: 5; extras go to remaining.
Fields of UpdatePoolFeesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | operator | Pubkey |
| 2 | signer | Pubkey |
| 3 | event_ | Pubkey |
| 4 | program | Pubkey |
| 5… | remaining | Vec< |
UpdateRewardDuration#
Discriminator 8aaec4a9d5ebfe6b · data UpdateRewardDuration · accounts UpdateRewardDurationInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
new_ | u64 |
Required accounts: 4; extras go to remaining.
Fields of UpdateRewardDurationInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | signer | Pubkey |
| 2 | event_ | Pubkey |
| 3 | program | Pubkey |
| 4… | remaining | Vec< |
UpdateRewardFunder#
Discriminator d31c3020d7a02317 · data UpdateRewardFunder · accounts UpdateRewardFunderInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
new_funder | Pubkey |
Required accounts: 4; extras go to remaining.
Fields of UpdateRewardFunderInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool | Pubkey |
| 1 | signer | Pubkey |
| 2 | event_ | Pubkey |
| 3 | program | Pubkey |
| 4… | remaining | Vec< |
WithdrawIneligibleReward#
Discriminator 94ce2ac3f7316708 · data WithdrawIneligibleReward · accounts WithdrawIneligibleRewardInstructionAccounts.
| Field | Type |
|---|---|
reward_ | u8 |
Required accounts: 9; extras go to remaining.
Fields of WithdrawIneligibleRewardInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | reward_ | Pubkey |
| 3 | reward_mint | Pubkey |
| 4 | funder_ | Pubkey |
| 5 | funder | Pubkey |
| 6 | token_ | Pubkey |
| 7 | event_ | Pubkey |
| 8 | program | Pubkey |
| 9… | remaining | Vec< |
ZapProtocolFee#
Discriminator d59bbb2238b65bf0 · data ZapProtocolFee · accounts ZapProtocolFeeInstructionAccounts.
| Field | Type |
|---|---|
max_amount | u64 |
Required accounts: 9; extras go to remaining.
Fields of ZapProtocolFeeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | pool_ | Pubkey |
| 1 | pool | Pubkey |
| 2 | token_vault | Pubkey |
| 3 | token_mint | Pubkey |
| 4 | receiver_ | Pubkey |
| 5 | operator | Pubkey |
| 6 | signer | Pubkey |
| 7 | token_ | Pubkey |
| 8 | sysvar_ | Pubkey |
| 9… | 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 MeteoraDammV2Account. 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 |
|---|---|---|
vault_ | Pubkey | Vault config key |
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. |
pool_fees | PoolFeesConfig | Pool fee |
activation_ | u8 | Activation type |
collect_ | u8 | Collect fee mode |
config_type | u8 | Config type mode, 0 for static, 1 for dynamic |
padding0 | [u8; 5] | padding 0 |
index | u64 | config index |
sqrt_ | u128 | sqrt min price |
sqrt_ | u128 | sqrt max price |
padding1 | [u64; 10] | Fee curve point Padding for further use |
Operator#
Discriminator db1fbc91458bcc75 · accounts::.
| Field | Type |
|---|---|
whitelisted_ | Pubkey |
permission | u128 |
padding | [u64; 2] |
PodAlignedFeeMarketCapScheduler#
Discriminator fb82d0fdf51b91cb · accounts::.
| Field | Type |
|---|---|
cliff_ | u64 |
base_ | u8 |
padding | [u8; 5] |
number_ | u16 |
sqrt_ | u32 |
scheduler_ | u32 |
reduction_ | u64 |
PodAlignedFeeRateLimiter#
Discriminator a0db08fbb3071075 · accounts::.
| Field | Type |
|---|---|
cliff_ | u64 |
base_ | u8 |
padding | [u8; 5] |
fee_ | u16 |
max_ | u32 |
max_fee_bps | u32 |
reference_ | u64 |
PodAlignedFeeTimeScheduler#
Discriminator ef848ad5439a8246 · accounts::.
| Field | Type |
|---|---|
cliff_ | u64 |
base_ | u8 |
padding | [u8; 5] |
number_ | u16 |
period_ | u64 |
reduction_ | u64 |
Pool#
Discriminator f19a6d0411b16dbc · accounts::.
| Field | Type | Description |
|---|---|---|
pool_fees | PoolFeesStruct | Pool fee |
token_ | Pubkey | token a mint |
token_ | Pubkey | token b mint |
token_ | Pubkey | token a vault |
token_ | Pubkey | token b vault |
whitelisted_ | Pubkey | Whitelisted vault to be able to buy pool before activation_point |
padding0 | [u8; 32] | padding, previously partner pubkey, be careful when using this field |
liquidity | u128 | liquidity share |
padding1 | u128 | padding, previous reserve amount, be careful to use that field |
protocol_ | u64 | protocol a fee |
protocol_ | u64 | protocol b fee |
padding2 | u128 | |
sqrt_ | u128 | min price |
sqrt_ | u128 | max price |
sqrt_price | u128 | current price |
activation_ | u64 | Activation point, can be slot or timestamp |
activation_ | u8 | Activation type, 0 means by slot, 1 means by timestamp |
pool_status | u8 | pool status, 0: enable, 1 disable |
token_ | u8 | token a flag |
token_ | u8 | token b flag |
collect_ | u8 | 0 is collect fee in both token, 1 only collect fee only in token b |
pool_type | u8 | pool type |
fee_version | u8 | pool fee version, 0: max_fee is still capped at 50%, 1: max_fee is capped at 99% |
padding3 | u8 | padding |
fee_ | [u8; 32] | cumulative |
fee_ | [u8; 32] | cumulative |
permanent_ | u128 | |
metrics | PoolMetrics | metrics |
creator | Pubkey | pool creator |
token_ | u64 | token a amount |
token_ | u64 | token b amount |
layout_ | u8 | layout version: version 0: haven't track token_a_amount and token_b_amount, version 1: track token_a_amount and token_b_amount |
padding4 | [u8; 7] | Padding for further use |
padding5 | [u64; 3] | Padding for further use |
reward_ | [RewardInfo; 2] | Farming reward information |
Position#
Discriminator aabc8fe47a40f7d0 · accounts::.
| Field | Type | Description |
|---|---|---|
pool | Pubkey | |
nft_mint | Pubkey | nft mint |
fee_ | [u8; 32] | fee a checkpoint |
fee_ | [u8; 32] | fee b checkpoint |
fee_ | u64 | fee a pending |
fee_ | u64 | fee b pending |
unlocked_ | u128 | unlock liquidity |
vested_ | u128 | vesting liquidity |
permanent_ | u128 | permanent locked liquidity |
metrics | PositionMetrics | metrics |
reward_ | [UserRewardInfo; 2] | Farming reward information |
inner_ | InnerVesting | inner vesting info |
padding | u128 | padding for future usage |
TokenBadge#
Discriminator 74dbcce5f974ff96 · accounts::.
| Field | Type | Description |
|---|---|---|
token_mint | Pubkey | token mint |
padding | [u8; 128] | Reserve |
Vesting#
Discriminator 6495428a5fc880f1 · accounts::.
| Field | Type |
|---|---|
position | Pubkey |
inner_ | InnerVesting |
padding2 | [u128; 4] |
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.
EvtClaimPositionFee#
Discriminator c6b6b734610c3138 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
position | Pubkey |
owner | Pubkey |
fee_ | u64 |
fee_ | u64 |
EvtClaimProtocolFee#
Discriminator baf44bfbbc0d1921 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
token_ | u64 |
token_ | u64 |
EvtClaimReward#
Discriminator da5693c8ebbcd7e7 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
position | Pubkey |
owner | Pubkey |
mint_reward | Pubkey |
reward_ | u8 |
total_ | u64 |
EvtCloseConfig#
Discriminator 241eef2d3a840e05 · events::.
| Field | Type | Description |
|---|---|---|
config | Pubkey | Config pubkey |
admin | Pubkey | admin pk |
EvtClosePosition#
Discriminator 149190448f8ed6b2 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
owner | Pubkey |
position | Pubkey |
position_ | Pubkey |
EvtCreateConfig#
Discriminator 83cfb4aeb449a536 · events::.
| Field | Type |
|---|---|
pool_fees | PoolFeeParameters |
vault_ | Pubkey |
pool_ | Pubkey |
activation_ | u8 |
sqrt_ | u128 |
sqrt_ | u128 |
collect_ | u8 |
index | u64 |
config | Pubkey |
EvtCreateDynamicConfig#
Discriminator e7c50da4f8d58598 · events::.
| Field | Type |
|---|---|
config | Pubkey |
pool_ | Pubkey |
index | u64 |
EvtCreatePosition#
Discriminator 9c0f77c61db5dd37 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
owner | Pubkey |
position | Pubkey |
position_ | Pubkey |
EvtCreateTokenBadge#
Discriminator 8d788674221c72a0 · events::.
| Field | Type |
|---|---|
token_mint | Pubkey |
EvtFundReward#
Discriminator 68e9ed7ac7bf7955 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
funder | Pubkey |
mint_reward | Pubkey |
reward_ | u8 |
amount | u64 |
transfer_ | u64 |
reward_ | u64 |
pre_ | u128 |
post_ | u128 |
EvtInitializePool#
Discriminator e432f655cb428625 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
token_ | Pubkey |
token_ | Pubkey |
creator | Pubkey |
payer | Pubkey |
alpha_vault | Pubkey |
pool_fees | PoolFeeParameters |
sqrt_ | u128 |
sqrt_ | u128 |
activation_ | u8 |
collect_ | u8 |
liquidity | u128 |
sqrt_price | u128 |
activation_ | u64 |
token_ | u8 |
token_ | u8 |
token_ | u64 |
token_ | u64 |
total_ | u64 |
total_ | u64 |
pool_type | u8 |
EvtInitializeReward#
Discriminator 815bbc03f634b9f9 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
reward_mint | Pubkey |
funder | Pubkey |
creator | Pubkey |
reward_ | u8 |
reward_ | u64 |
EvtLiquidityChange#
Discriminator c5ab4e7fe0d3570d · events::.
| Field | Type |
|---|---|
pool | Pubkey |
position | Pubkey |
owner | Pubkey |
token_ | u64 |
token_ | u64 |
transfer_ | u64 |
transfer_ | u64 |
reserve_ | u64 |
reserve_ | u64 |
liquidity_ | u128 |
token_ | u64 |
token_ | u64 |
change_type | u8 |
EvtLockPosition#
Discriminator a83f6c53db5202c8 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
position | Pubkey |
owner | Pubkey |
vesting | Pubkey |
cliff_point | u64 |
period_ | u64 |
cliff_ | u128 |
liquidity_ | u128 |
number_ | u16 |
EvtPermanentLockPosition#
Discriminator 918fa2dada50430b · events::.
| Field | Type |
|---|---|
pool | Pubkey |
position | Pubkey |
lock_ | u128 |
total_ | u128 |
EvtSetPoolStatus#
Discriminator 64d54a035f5be492 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
status | u8 |
EvtSplitPosition2#
Discriminator a520cbae4864e967 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
first_owner | Pubkey |
second_ | Pubkey |
first_ | Pubkey |
second_ | Pubkey |
current_ | u128 |
amount_ | SplitAmountInfo |
first_ | SplitPositionInfo |
second_ | SplitPositionInfo |
split_ | SplitPositionParameters2 |
EvtSplitPosition3#
Discriminator e875beda55a2cf4e · events::.
| Field | Type |
|---|---|
pool | Pubkey |
first_owner | Pubkey |
second_ | Pubkey |
first_ | Pubkey |
second_ | Pubkey |
current_ | u128 |
amount_ | SplitAmountInfo2 |
first_ | SplitPositionInfo2 |
second_ | SplitPositionInfo2 |
split_ | SplitPositionParameters3 |
EvtSwap2#
Discriminator bd4233a826507599 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
trade_ | u8 |
collect_ | u8 |
has_ | bool |
params | SwapParameters2 |
swap_result | SwapResult2 |
included_ | u64 |
included_ | u64 |
excluded_ | u64 |
current_ | u64 |
reserve_ | u64 |
reserve_ | u64 |
EvtUpdatePoolFees#
Discriminator 4ca5f66666d99c2c · events::.
| Field | Type |
|---|---|
pool | Pubkey |
operator | Pubkey |
params | UpdatePoolFeesParameters |
EvtUpdateRewardDuration#
Discriminator 958741e781994139 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
reward_ | u8 |
old_ | u64 |
new_ | u64 |
EvtUpdateRewardFunder#
Discriminator 4c9ad00d2873f692 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
reward_ | u8 |
old_funder | Pubkey |
new_funder | Pubkey |
EvtWithdrawIneligibleReward#
Discriminator f8d7b84e1fb4b3a8 · events::.
| Field | Type |
|---|---|
pool | Pubkey |
reward_mint | Pubkey |
amount | u64 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AddLiquidityParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
liquidity_ | u128 | delta liquidity |
token_ | u64 | maximum token a amount |
token_ | u64 | maximum token b amount |
BaseFeeInfo#
Struct types::.
| Field | Type |
|---|---|
data | [u8; 32] |
BaseFeeParameters#
Struct types::.
| Field | Type |
|---|---|
data | [u8; 27] |
BaseFeeStruct#
Struct types::.
| Field | Type |
|---|---|
base_ | BaseFeeInfo |
padding1 | u64 |
BorshFeeMarketCapScheduler#
Struct types::.
| Field | Type |
|---|---|
cliff_ | u64 |
number_ | u16 |
sqrt_ | u32 |
scheduler_ | u32 |
reduction_ | u64 |
base_ | u8 |
BorshFeeRateLimiter#
From the program's IDL:
we denote reference_amount = x0, cliff_fee_numerator = c, fee_increment = i if input_amount <= x0, then fee = input_amount * c if input_amount > x0, then input_amount = x0 + (a * x0 + b) if a < max_index then fee = x0 * c + x0 * (c + i) + .... + x0 * (c + ia) + b * (c + i * (a+1)) then fee = x0 * (c + ca + ia(a+1)/2) + b * (c + i * (a+1)) if a >= max_index if a = max_index + d, input_amount = x0 + max_index * x0 + (d * x0 + b) then fee = x0 * (c + cmax_index + imax_index*(max_index+1)/2) + (d * x0 + b) * MAX_FEE
Struct types::.
| Field | Type |
|---|---|
cliff_ | u64 |
fee_ | u16 |
max_ | u32 |
max_fee_bps | u32 |
reference_ | u64 |
base_ | u8 |
BorshFeeTimeScheduler#
Struct types::.
| Field | Type |
|---|---|
cliff_ | u64 |
number_ | u16 |
period_ | u64 |
reduction_ | u64 |
base_ | u8 |
DummyParams#
Struct types::.
| Field | Type |
|---|---|
borsh_ | BorshFeeTimeScheduler |
borsh_ | BorshFeeRateLimiter |
borsh_ | BorshFeeMarketCapScheduler |
DynamicConfigParameters#
Struct types::.
| Field | Type |
|---|---|
pool_ | Pubkey |
DynamicFeeConfig#
Struct types::.
| Field | Type |
|---|---|
initialized | u8 |
padding | [u8; 7] |
max_ | u32 |
variable_ | u32 |
bin_step | u16 |
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
padding1 | [u8; 8] |
bin_ | u128 |
DynamicFeeParameters#
Struct types::.
| Field | Type |
|---|---|
bin_step | u16 |
bin_ | u128 |
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
max_ | u32 |
variable_ | u32 |
DynamicFeeStruct#
Struct types::.
| Field | Type |
|---|---|
initialized | u8 |
padding | [u8; 7] |
max_ | u32 |
variable_ | u32 |
bin_step | u16 |
filter_ | u16 |
decay_ | u16 |
reduction_ | u16 |
last_ | u64 |
bin_ | u128 |
sqrt_ | u128 |
volatility_ | u128 |
volatility_ | u128 |
EvtClaimPositionFee#
Struct types::. Same fields as the EvtClaimPositionFee event.
EvtClaimProtocolFee#
Struct types::. Same fields as the EvtClaimProtocolFee event.
EvtClaimReward#
Struct types::. Same fields as the EvtClaimReward event.
EvtCloseConfig#
From the program's IDL:
Close config
Struct types::. Same fields as the EvtCloseConfig event.
EvtClosePosition#
Struct types::. Same fields as the EvtClosePosition event.
EvtCreateConfig#
From the program's IDL:
Create static config
Struct types::. Same fields as the EvtCreateConfig event.
EvtCreateDynamicConfig#
From the program's IDL:
Create dynamic config
Struct types::. Same fields as the EvtCreateDynamicConfig event.
EvtCreatePosition#
Struct types::. Same fields as the EvtCreatePosition event.
EvtCreateTokenBadge#
From the program's IDL:
Create token badge
Struct types::. Same fields as the EvtCreateTokenBadge event.
EvtFundReward#
Struct types::. Same fields as the EvtFundReward event.
EvtInitializePool#
Struct types::. Same fields as the EvtInitializePool event.
EvtInitializeReward#
Struct types::. Same fields as the EvtInitializeReward event.
EvtLiquidityChange#
Struct types::. Same fields as the EvtLiquidityChange event.
EvtLockPosition#
Struct types::. Same fields as the EvtLockPosition event.
EvtPermanentLockPosition#
Struct types::. Same fields as the EvtPermanentLockPosition event.
EvtSetPoolStatus#
Struct types::. Same fields as the EvtSetPoolStatus event.
EvtSplitPosition2#
Struct types::. Same fields as the EvtSplitPosition2 event.
EvtSplitPosition3#
Struct types::. Same fields as the EvtSplitPosition3 event.
EvtSwap2#
Struct types::. Same fields as the EvtSwap2 event.
EvtUpdatePoolFees#
Struct types::. Same fields as the EvtUpdatePoolFees event.
EvtUpdateRewardDuration#
Struct types::. Same fields as the EvtUpdateRewardDuration event.
EvtUpdateRewardFunder#
Struct types::. Same fields as the EvtUpdateRewardFunder event.
EvtWithdrawIneligibleReward#
Struct types::. Same fields as the EvtWithdrawIneligibleReward event.
InitializeCustomizablePoolParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
pool_fees | PoolFeeParameters | pool fees |
sqrt_ | u128 | sqrt min price |
sqrt_ | u128 | sqrt max price |
has_ | bool | has alpha vault |
liquidity | u128 | initialize liquidity |
sqrt_price | u128 | The init price of the pool as a sqrt(token_b/token_a) Q64.64 value. Market cap fee scheduler minimum price will be derived from this value |
activation_ | u8 | activation type |
collect_ | u8 | collect fee mode |
activation_ | Option<u64> | activation point |
InitializePoolParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
liquidity | u128 | initialize liquidity |
sqrt_price | u128 | The init price of the pool as a sqrt(token_b/token_a) Q64.64 value |
activation_ | Option<u64> | activation point |
InnerVesting#
Struct types::.
| Field | Type |
|---|---|
cliff_point | u64 |
period_ | u64 |
cliff_ | u128 |
liquidity_ | u128 |
total_ | u128 |
number_ | u16 |
padding | [u8; 14] |
PoolFeeParameters#
From the program's IDL:
Information regarding fee charges
Struct types::.
| Field | Type | Description |
|---|---|---|
base_fee | BaseFeeParameters | Base fee |
compounding_ | u16 | compounding fee bps, only have value if CollectFeeMode::Compounding |
padding | u8 | padding for future use |
dynamic_fee | Option< | dynamic fee |
PoolFeesConfig#
Struct types::.
| Field | Type | Description |
|---|---|---|
base_fee | BaseFeeInfo | |
dynamic_fee | DynamicFeeConfig | |
protocol_ | u8 | |
padding0 | u8 | |
referral_ | u8 | |
padding1 | [u8; 3] | |
compounding_ | u16 | Compounding fee bps, only non-zero if collect_fee_mode is compounding |
padding2 | [u64; 5] |
PoolFeesStruct#
From the program's IDL:
Information regarding fee charges trading_fee = amount * trade_fee_numerator / denominator protocol_fee = trading_fee * protocol_fee_percentage / 100 referral_fee = protocol_fee * referral_percentage / 100
Struct types::.
| Field | Type | Description |
|---|---|---|
base_fee | BaseFeeStruct | 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 |
protocol_ | u8 | 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 |
padding0 | u8 | padding for future use |
referral_ | u8 | referral fee |
padding1 | [u8; 3] | padding |
compounding_ | u16 | compounding fee bps, only non-zero in CollectFeeMode::Compounding |
dynamic_fee | DynamicFeeStruct | dynamic fee |
init_ | u128 |
PoolMetrics#
Struct types::.
| Field | Type |
|---|---|
total_ | u128 |
total_ | u128 |
total_ | u64 |
total_ | u64 |
padding0 | [u64; 2] |
total_ | u64 |
padding | u64 |
PositionMetrics#
Struct types::.
| Field | Type |
|---|---|
total_ | u64 |
total_ | u64 |
RemoveLiquidityParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
liquidity_ | u128 | delta liquidity |
token_ | u64 | minimum token a amount |
token_ | u64 | minimum token b amount |
RewardInfo#
From the program's IDL:
Stores the state relevant for tracking liquidity mining rewards
Struct types::.
| Field | Type | Description |
|---|---|---|
initialized | u8 | Indicates if the reward has been initialized |
reward_ | u8 | reward token flag |
padding0 | [u8; 6] | padding |
padding1 | [u8; 8] | Padding to ensure reward_ is 16-byte aligned |
mint | Pubkey | Reward token mint. |
vault | Pubkey | Reward vault token account. |
funder | Pubkey | Authority account that allows to fund rewards |
reward_ | u64 | reward duration |
reward_ | u64 | reward duration end |
reward_rate | u128 | reward rate |
reward_ | [u8; 32] | Reward per token stored |
last_ | u64 | The last time reward states were updated. |
cumulative_ | u64 | Accumulated seconds when the farm distributed rewards but the bin was empty. These rewards will be carried over to the next reward time window. |
SplitAmountInfo#
Struct types::.
| Field | Type |
|---|---|
permanent_ | u128 |
unlocked_ | u128 |
fee_a | u64 |
fee_b | u64 |
reward0 | u64 |
reward1 | u64 |
SplitAmountInfo2#
Struct types::.
| Field | Type |
|---|---|
permanent_ | u128 |
unlocked_ | u128 |
vested_ | u128 |
fee_a | u64 |
fee_b | u64 |
reward0 | u64 |
reward1 | u64 |
SplitPositionInfo#
Struct types::.
| Field | Type |
|---|---|
liquidity | u128 |
fee_a | u64 |
fee_b | u64 |
reward0 | u64 |
reward1 | u64 |
SplitPositionInfo2#
Struct types::.
| Field | Type |
|---|---|
unlocked_ | u128 |
permanent_ | u128 |
vested_ | u128 |
fee_a | u64 |
fee_b | u64 |
reward0 | u64 |
reward1 | u64 |
SplitPositionParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
unlocked_ | u8 | Percentage of unlocked liquidity to split to the second position |
permanent_ | u8 | Percentage of permanent locked liquidity to split to the second position |
fee_ | u8 | Percentage of fee A pending to split to the second position |
fee_ | u8 | Percentage of fee B pending to split to the second position |
reward0_ | u8 | Percentage of reward 0 pending to split to the second position |
reward1_ | u8 | Percentage of reward 1 pending to split to the second position |
inner_ | u8 | Percentage of inner vesting liquidity |
padding | [u8; 15] | padding for future |
SplitPositionParameters2#
Struct types::.
| Field | Type |
|---|---|
unlocked_ | u32 |
permanent_ | u32 |
fee_ | u32 |
fee_ | u32 |
reward0_ | u32 |
reward1_ | u32 |
SplitPositionParameters3#
Struct types::.
| Field | Type |
|---|---|
unlocked_ | u32 |
permanent_ | u32 |
fee_ | u32 |
fee_ | u32 |
reward0_ | u32 |
reward1_ | u32 |
inner_ | u32 |
StaticConfigParameters#
Struct types::.
| Field | Type |
|---|---|
pool_fees | PoolFeeParameters |
sqrt_ | u128 |
sqrt_ | u128 |
vault_ | Pubkey |
pool_ | Pubkey |
activation_ | u8 |
collect_ | u8 |
SwapParameters#
Struct types::.
| Field | Type |
|---|---|
amount_in | u64 |
minimum_ | u64 |
SwapParameters2#
Struct types::.
| Field | Type | Description |
|---|---|---|
amount0 | u64 | When it's exact in, partial fill, this will be amount_in. When it's exact out, this will be amount_out |
amount1 | u64 | When it's exact in, partial fill, this will be minimum_amount_out. When it's exact out, this will be maximum_amount_in |
swap_mode | u8 | Swap mode, refer [SwapMode] |
SwapResult2#
Struct types::.
| Field | Type |
|---|---|
included_ | u64 |
excluded_ | u64 |
amount_left | u64 |
output_ | u64 |
next_ | u128 |
claiming_ | u64 |
protocol_ | u64 |
compounding_ | u64 |
referral_ | u64 |
UpdatePoolFeesParameters#
Struct types::.
| Field | Type | Description |
|---|---|---|
cliff_ | Option<u64> | Base fee update mode: - None: skip base fee update - Some: update new cliff_fee_numerator if base fee is static |
dynamic_fee | Option< | Dynamic fee update mode: - None: skip dynamic fee update - Some(with default value): disable dynamic fee - Some(with non default value): enable dynamic fee if disabled or update dynamic fee if enabled |
UserRewardInfo#
Struct types::.
| Field | Type | Description |
|---|---|---|
reward_ | [u8; 32] | The latest update reward checkpoint |
reward_ | u64 | Current pending rewards |
total_ | u64 | Total claimed rewards |
VestingParameters#
Struct types::.
| Field | Type |
|---|---|
cliff_point | Option<u64> |
period_ | u64 |
cliff_ | u128 |
liquidity_ | u128 |
number_ | u16 |