Kamino Vault decoder

Decode Kamino Vault instructions and accounts in Rust with carbon-kamino-vault-decoder 2.0.0. Program ID kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr.

On this page

carbon-kamino-vault-decoder decodes the instructions and accounts of the Kamino Vault program (kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr): 12 instructions, 2 account types. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-kamino-vault-decoder 2.0.0
Installcargo add carbon-kamino-vault-decoder@2.0.0
Program IDkvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr (carbon_kamino_vault_decoder::PROGRAM_ID)
CategoryLending
Decodercarbon_kamino_vault_decoder::KaminoVaultDecoder
Instruction enuminstructions::KaminoVaultInstruction
Account enumaccounts::KaminoVaultAccount
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-kamino-vault-decoder/2.0.0
Sourcedecoders/kamino-vault-decoder

Other lending decoders: Jupiter Lend, Kamino Lending, marginfi v2, Meteora Vault, Sharky. To decode several in one pipeline, see lending 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 Kamino Vault transactions from the public RPC and prints every decoded Deposit instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-kamino-vault-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_kamino_vault_decoder::{
        instructions::KaminoVaultInstruction, KaminoVaultDecoder, 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(KaminoVaultDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, KaminoVaultInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, KaminoVaultInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let KaminoVaultInstruction::Deposit { data, accounts, .. } = input.decoded_instruction {
            println!("deposit {signature}: {data:?} user={}", accounts.user);
        }
        Ok(())
    }
}
Terminal
RUST_LOG=info cargo run

Each Deposit instruction prints one line with the transaction signature and the decoded Deposit 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.

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 Reserve 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_kamino_vault_decoder::{accounts::KaminoVaultAccount, KaminoVaultDecoder, 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(KaminoVaultDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

Each update to a Reserve 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 KaminoVaultInstruction. Each is KaminoVaultInstruction::<Variant> { program_id, data, accounts }, where data and accounts are the types listed under the variant, exported from carbon_kamino_vault_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 kvauTFR8qm1dhniz6pYuBZkuene3Hfrs1VQhVRgCNrr.
  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.

Deposit#

Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.

FieldType
max_amountu64

Required accounts: 11; extras go to remaining.

Fields of DepositInstructionAccounts, in account order:

#FieldType
0userPubkey
1vault_statePubkey
2token_vaultPubkey
3token_mintPubkey
4base_vault_authorityPubkey
5shares_mintPubkey
6user_token_ataPubkey
7user_shares_ataPubkey
8klend_programPubkey
9token_programPubkey
10shares_token_programPubkey
11…remainingVec<AccountMeta>

GiveUpPendingFees#

Discriminator b1c878866ed99351 · data GiveUpPendingFees · accounts GiveUpPendingFeesInstructionAccounts.

FieldType
max_amount_to_give_upu64

Required accounts: 3; extras go to remaining.

Fields of GiveUpPendingFeesInstructionAccounts, in account order:

#FieldType
0vault_admin_authorityPubkey
1vault_statePubkey
2klend_programPubkey
3…remainingVec<AccountMeta>

InitializeSharesMetadata#

Discriminator 030fac72c8008320 · data InitializeSharesMetadata · accounts InitializeSharesMetadataInstructionAccounts.

FieldType
nameString
symbolString
uriString

Required accounts: 8; extras go to remaining.

Fields of InitializeSharesMetadataInstructionAccounts, in account order:

#FieldType
0vault_admin_authorityPubkey
1vault_statePubkey
2shares_mintPubkey
3base_vault_authorityPubkey
4shares_metadataPubkey
5system_programPubkey
6rentPubkey
7metadata_programPubkey
8…remainingVec<AccountMeta>

InitVault#

Discriminator 4d4f559621d9346a · data InitVault · accounts InitVaultInstructionAccounts.

No data fields.

Required accounts: 11; extras go to remaining.

Fields of InitVaultInstructionAccounts, in account order:

#FieldType
0admin_authorityPubkey
1vault_statePubkey
2base_vault_authorityPubkey
3token_vaultPubkey
4base_token_mintPubkey
5shares_mintPubkey
6admin_token_accountPubkey
7system_programPubkey
8rentPubkey
9token_programPubkey
10shares_token_programPubkey
11…remainingVec<AccountMeta>

Invest#

Discriminator 0df5b467feb67904 · data Invest · accounts InvestInstructionAccounts.

No data fields.

Required accounts: 16; extras go to remaining.

Fields of InvestInstructionAccounts, in account order:

#FieldType
0payerPubkey
1payer_token_accountPubkey
2vault_statePubkey
3token_vaultPubkey
4token_mintPubkey
5base_vault_authorityPubkey
6ctoken_vaultPubkey
7reservePubkey
8lending_marketPubkey
9lending_market_authorityPubkey
10reserve_liquidity_supplyPubkey
11reserve_collateral_mintPubkey
12klend_programPubkey
13reserve_collateral_token_programPubkey
14token_programPubkey
15instruction_sysvar_accountPubkey
16…remainingVec<AccountMeta>

UpdateAdmin#

Discriminator a1b028d53cb8b3e4 · data UpdateAdmin · accounts UpdateAdminInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of UpdateAdminInstructionAccounts, in account order:

#FieldType
0pending_adminPubkey
1vault_statePubkey
2…remainingVec<AccountMeta>

UpdateReserveAllocation#

Discriminator 0536d5704be87525 · data UpdateReserveAllocation · accounts UpdateReserveAllocationInstructionAccounts.

FieldType
weightu64
capu64

Required accounts: 9; extras go to remaining.

Fields of UpdateReserveAllocationInstructionAccounts, in account order:

#FieldType
0signerPubkey
1vault_statePubkey
2base_vault_authorityPubkey
3reserve_collateral_mintPubkey
4reservePubkey
5ctoken_vaultPubkey
6reserve_collateral_token_programPubkey
7system_programPubkey
8rentPubkey
9…remainingVec<AccountMeta>

UpdateSharesMetadata#

Discriminator 9b227aa5f589936b · data UpdateSharesMetadata · accounts UpdateSharesMetadataInstructionAccounts.

FieldType
nameString
symbolString
uriString

Required accounts: 5; extras go to remaining.

Fields of UpdateSharesMetadataInstructionAccounts, in account order:

#FieldType
0vault_admin_authorityPubkey
1vault_statePubkey
2base_vault_authorityPubkey
3shares_metadataPubkey
4metadata_programPubkey
5…remainingVec<AccountMeta>

UpdateVaultConfig#

Discriminator 7a0315de9effee9d · data UpdateVaultConfig · accounts UpdateVaultConfigInstructionAccounts.

FieldType
entryVaultConfigField
dataVec<u8>

Required accounts: 3; extras go to remaining.

Fields of UpdateVaultConfigInstructionAccounts, in account order:

#FieldType
0vault_admin_authorityPubkey
1vault_statePubkey
2klend_programPubkey
3…remainingVec<AccountMeta>

Withdraw#

Discriminator b712469c946da122 · data Withdraw · accounts WithdrawInstructionAccounts.

FieldType
shares_amountu64

Required accounts: 19; extras go to remaining.

Fields of WithdrawInstructionAccounts, in account order:

#FieldType
0userPubkey
1vault_statePubkey
2token_vaultPubkey
3base_vault_authorityPubkey
4user_token_ataPubkey
5token_mintPubkey
6user_shares_ataPubkey
7shares_mintPubkey
8token_programPubkey
9shares_token_programPubkey
10klend_programPubkey
11reservePubkey
12ctoken_vaultPubkey
13lending_marketPubkey
14lending_market_authorityPubkey
15reserve_liquidity_supplyPubkey
16reserve_collateral_mintPubkey
17reserve_collateral_token_programPubkey
18instruction_sysvar_accountPubkey
19…remainingVec<AccountMeta>

WithdrawFromAvailable#

Discriminator 1383709baadc2239 · data WithdrawFromAvailable · accounts WithdrawFromAvailableInstructionAccounts.

FieldType
shares_amountu64

Required accounts: 11; extras go to remaining.

Fields of WithdrawFromAvailableInstructionAccounts, in account order:

#FieldType
0userPubkey
1vault_statePubkey
2token_vaultPubkey
3base_vault_authorityPubkey
4user_token_ataPubkey
5token_mintPubkey
6user_shares_ataPubkey
7shares_mintPubkey
8token_programPubkey
9shares_token_programPubkey
10klend_programPubkey
11…remainingVec<AccountMeta>

WithdrawPendingFees#

Discriminator 83c2c88caff4d9b7 · data WithdrawPendingFees · accounts WithdrawPendingFeesInstructionAccounts.

No data fields.

Required accounts: 16; extras go to remaining.

Fields of WithdrawPendingFeesInstructionAccounts, in account order:

#FieldType
0vault_admin_authorityPubkey
1vault_statePubkey
2reservePubkey
3token_vaultPubkey
4ctoken_vaultPubkey
5base_vault_authorityPubkey
6token_ataPubkey
7token_mintPubkey
8lending_marketPubkey
9lending_market_authorityPubkey
10reserve_liquidity_supplyPubkey
11reserve_collateral_mintPubkey
12klend_programPubkey
13token_programPubkey
14reserve_collateral_token_programPubkey
15instruction_sysvar_accountPubkey
16…remainingVec<AccountMeta>

Accounts#

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

Reserve#

Discriminator 2bf2ccca1af73b7f · accounts::reserve::Reserve.

FieldTypeDescription
versionu64Version of the reserve
last_updateLastUpdateLast slot when supply and rates updated
lending_marketPubkeyLending market address
farm_collateralPubkey
farm_debtPubkey
liquidityReserveLiquidityReserve liquidity
reserve_liquidity_padding[u64; 150]
collateralReserveCollateralReserve collateral
reserve_collateral_padding[u64; 150]
configReserveConfigReserve configuration values
config_padding[u64; 116]
borrowed_amount_outside_elevation_groupu64
borrowed_amounts_against_this_reserve_in_elevation_groups[u64; 32]Amount of token borrowed in lamport of debt asset in the given elevation group when this reserve is part of the collaterals.
padding[u64; 207]

VaultState#

Discriminator e4c452a562d2eb98 · accounts::vault_state::VaultState.

FieldType
vault_admin_authorityPubkey
base_vault_authorityPubkey
base_vault_authority_bumpu64
token_mintPubkey
token_mint_decimalsu64
token_vaultPubkey
token_programPubkey
shares_mintPubkey
shares_mint_decimalsu64
token_availableu64
shares_issuedu64
available_crank_fundsu64
padding0u64
performance_fee_bpsu64
management_fee_bpsu64
last_fee_charge_timestampu64
prev_aum_sfu128
pending_fees_sfu128
vault_allocation_strategy[VaultAllocation; 10]
min_deposit_amountu64
min_withdraw_amountu64
min_invest_amountu64
min_invest_delay_slotsu64
crank_fund_fee_per_reserveu64
pending_adminPubkey
cumulative_earned_interest_sfu128
cumulative_mgmt_fees_sfu128
cumulative_perf_fees_sfu128
name[u8; 40]
vault_lookup_tablePubkey
vault_farmPubkey
creation_timestampu64
padding1u64
allocation_adminPubkey
padding2[u128; 242]

Types#

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

BigFractionBytes#

Struct types::BigFractionBytes.

FieldType
value[u64; 4]
padding[u64; 2]

BorrowRateCurve#

Struct types::BorrowRateCurve.

FieldType
points[CurvePoint; 11]

CurvePoint#

Struct types::CurvePoint.

FieldType
utilization_rate_bpsu32
borrow_rate_bpsu32

LastUpdate#

From the program's IDL:

Last update state

Struct types::LastUpdate.

FieldTypeDescription
slotu64Last slot when updated
staleu8True when marked stale, false when slot updated
price_statusu8Status of the prices used to calculate the last update
placeholder[u8; 6]

PriceHeuristic#

Struct types::PriceHeuristic.

FieldTypeDescription
loweru64Lower value of acceptable price
upperu64Upper value of acceptable price
expu64Number of decimals of the previously defined values

PythConfiguration#

Struct types::PythConfiguration.

FieldTypeDescription
pricePubkeyPubkey of the base price feed (disabled if null or default)

ReserveCollateral#

From the program's IDL:

Reserve collateral

Struct types::ReserveCollateral.

FieldTypeDescription
mint_pubkeyPubkeyReserve collateral mint address
mint_total_supplyu64Reserve collateral mint supply, used for exchange rate
supply_vaultPubkeyReserve collateral supply address
padding1[u128; 32]
padding2[u128; 32]

ReserveConfig#

From the program's IDL:

Reserve configuration values

Struct types::ReserveConfig.

FieldTypeDescription
statusu8Status of the reserve Active/Obsolete/Hidden
asset_tieru8Asset tier -> 0 - regular (collateral & debt), 1 - isolated collateral, 2 - isolated debt
host_fixed_interest_rate_bpsu16Flat rate that goes to the host
reserved2[u8; 2][DEPRECATED] Boost for side (debt or collateral)
reserved3[u8; 8][DEPRECATED] Reward points multiplier per obligation type
protocol_take_rate_pctu8Protocol take rate is the amount borrowed interest protocol receives, as a percentage
protocol_liquidation_fee_pctu8Cut of the liquidation bonus that the protocol receives, as a percentage
loan_to_value_pctu8Target ratio of the value of borrows to deposits, as a percentage 0 if use as collateral is disabled
liquidation_threshold_pctu8Loan to value ratio at which an obligation can be liquidated, as percentage
min_liquidation_bonus_bpsu16Minimum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps
max_liquidation_bonus_bpsu16Maximum bonus a liquidator receives when repaying part of an unhealthy obligation, as bps
bad_debt_liquidation_bonus_bpsu16Bad debt liquidation bonus for an undercollateralized obligation, as bps
deleveraging_margin_call_period_secsu64Time in seconds that must pass before redemptions are enabled after the deposit limit is crossed. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.
deleveraging_threshold_decrease_bps_per_dayu64The rate at which the deleveraging threshold decreases, in bps per day. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.
feesReserveFeesProgram owner fees assessed, separate from gains due to interest accrual
borrow_rate_curveBorrowRateCurveBorrow rate curve based on utilization
borrow_factor_pctu64Borrow factor in percentage - used for risk adjustment
deposit_limitu64Maximum deposit limit of liquidity in native units, u64::MAX for inf
borrow_limitu64Maximum amount borrowed, u64::MAX for inf, 0 to disable borrows (protected deposits)
token_infoTokenInfoToken id from TokenInfos struct
deposit_withdrawal_capWithdrawalCapsDeposit withdrawal caps - deposit & redeem
debt_withdrawal_capWithdrawalCapsDebt withdrawal caps - borrow & repay
elevation_groups[u8; 20]
disable_usage_as_coll_outside_emodeu8
utilization_limit_block_borrowing_above_pctu8Utilization (in percentage) above which borrowing is blocked. 0 to disable.
autodeleverage_enabledu8Whether this reserve should be subject to auto-deleveraging after deposit or borrow limit is crossed. Besides this flag, the lending market's flag also needs to be enabled (logical AND). NOTE: the manual "target LTV" deleveraging (enabled by the risk council for individual obligations) is NOT affected by this flag.
reserved1[u8; 1]
borrow_limit_outside_elevation_groupu64Maximum amount liquidity of this reserve borrowed outside all elevation groups - u64::MAX for inf - 0 to disable borrows outside elevation groups
borrow_limit_against_this_collateral_in_elevation_group[u64; 32]Defines the maximum amount (in lamports of elevation group debt asset) that can be borrowed when this reserve is used as collateral. - u64::MAX for inf - 0 to disable borrows in this elevation group (expected value for the debt asset)
deleveraging_bonus_increase_bps_per_dayu64The rate at which the deleveraging-related liquidation bonus increases, in bps per day. Only relevant when autodeleverage_enabled == 1, and must not be 0 in such case.

ReserveFees#

From the program's IDL:

Additional fee information on a reserve
These exist separately from interest accrual fees, and are specifically for the program owner and referral fee. The fees are paid out as a percentage of liquidity token amounts during repayments and liquidations.

Struct types::ReserveFees.

FieldTypeDescription
borrow_fee_sfu64Fee assessed on BorrowObligationLiquidity, as scaled fraction (60 bits fractional part) Must be between 0 and 2^60, such that 2^60 = 1. A few examples for clarity: 1% = (1 << 60) / 100 = 11529215046068470 0.01% (1 basis point) = 115292150460685 0.00001% (Aave borrow fee) = 115292150461
flash_loan_fee_sfu64Fee for flash loan, expressed as scaled fraction. 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
padding[u8; 8]Used for allignment

ReserveLiquidity#

From the program's IDL:

Reserve liquidity

Struct types::ReserveLiquidity.

FieldTypeDescription
mint_pubkeyPubkeyReserve liquidity mint address
supply_vaultPubkeyReserve liquidity supply address
fee_vaultPubkeyReserve liquidity fee collection address
available_amountu64Reserve liquidity available
borrowed_amount_sfu128Reserve liquidity borrowed (scaled fraction)
market_price_sfu128Reserve liquidity market price in quote currency (scaled fraction)
market_price_last_updated_tsu64Unix timestamp of the market price (from the oracle)
mint_decimalsu64Reserve liquidity mint decimals
deposit_limit_crossed_timestampu64Timestamp when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled. If the threshold is not crossed, then the timestamp is set to 0
borrow_limit_crossed_timestampu64Timestamp when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled. If the threshold is not crossed, then the timestamp is set to 0
cumulative_borrow_rate_bsfBigFractionBytesReserve liquidity cumulative borrow rate (scaled fraction)
accumulated_protocol_fees_sfu128Reserve cumulative protocol fees (scaled fraction)
accumulated_referrer_fees_sfu128Reserve cumulative referrer fees (scaled fraction)
pending_referrer_fees_sfu128Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction)
absolute_referral_rate_sfu128Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction)
token_programPubkeyToken program of the liquidity mint
padding2[u64; 51]
padding3[u128; 32]

ScopeConfiguration#

Struct types::ScopeConfiguration.

FieldTypeDescription
price_feedPubkeyPubkey of the scope price feed (disabled if null or default)
price_chain[u16; 4]This is the scope_id price chain that results in a price for the token
twap_chain[u16; 4]This is the scope_id price chain for the twap

SwitchboardConfiguration#

Struct types::SwitchboardConfiguration.

FieldTypeDescription
price_aggregatorPubkeyPubkey of the base price feed (disabled if null or default)
twap_aggregatorPubkey

TokenInfo#

Struct types::TokenInfo.

FieldTypeDescription
name[u8; 32]UTF-8 encoded name of the token (null-terminated)
heuristicPriceHeuristicHeuristics limits of acceptable price
max_twap_divergence_bpsu64Max divergence between twap and price in bps
max_age_price_secondsu64
max_age_twap_secondsu64
scope_configurationScopeConfigurationScope price configuration
switchboard_configurationSwitchboardConfigurationSwitchboard configuration
pyth_configurationPythConfigurationPyth configuration
block_price_usageu8
reserved[u8; 7]
padding[u64; 19]

VaultAllocation#

Struct types::VaultAllocation.

FieldTypeDescription
reservePubkey
ctoken_vaultPubkey
target_allocation_weightu64
token_allocation_capu64Maximum token invested in this reserve
ctoken_vault_bumpu64
config_padding[u64; 127]
ctoken_allocationu64
last_invest_slotu64
token_target_allocation_sfu128
state_padding[u64; 128]

VaultConfigField#

Enum types::VaultConfigField.

Variant
PerformanceFeeBps
ManagementFeeBps
MinDepositAmount
MinWithdrawAmount
MinInvestAmount
MinInvestDelaySlots
CrankFundFeePerReserve
PendingVaultAdmin
Name
LookupTable
Farm
AllocationAdmin

WithdrawalCaps#

From the program's IDL:

Reserve Withdrawal Caps State

Struct types::WithdrawalCaps.

FieldType
config_capacityi64
current_totali64
last_interval_start_timestampu64
config_interval_length_secondsu64

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.