1. Decoders
  2. Other

Kamino Farms decoder

Decode Kamino Farms instructions and accounts in Rust with carbon-kamino-farms-decoder 2.0.0. Program ID FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr.

On this page

carbon-kamino-farms-decoder decodes the instructions and accounts of the Kamino Farms program (FarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr): 26 instructions, 4 account types. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-kamino-farms-decoder 2.0.0
Installcargo add carbon-kamino-farms-decoder@2.0.0
Program IDFarmsPZpWu9i7Kky8tPN37rs2TpmMrAZrC7S7vJa91Hr (carbon_kamino_farms_decoder::PROGRAM_ID)
CategoryOther
Decodercarbon_kamino_farms_decoder::KaminoFarmsDecoder
Instruction enuminstructions::KaminoFarmsInstruction
Account enumaccounts::KaminoFarmsAccount
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-kamino-farms-decoder/2.0.0
Sourcedecoders/kamino-farms-decoder

More program decoders without a category: Jupiter DCA, Pump Fees, Raydium Liquidity Locking, Swig. To decode several in one pipeline, see other program 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 Farms transactions from the public RPC and prints every decoded AddRewards instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-kamino-farms-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_farms_decoder::{
        instructions::KaminoFarmsInstruction, KaminoFarmsDecoder, 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(KaminoFarmsDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

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

Each AddRewards instruction prints one line with the transaction signature and the decoded AddRewards 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 GlobalConfig 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_farms_decoder::{accounts::KaminoFarmsAccount, KaminoFarmsDecoder, 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(KaminoFarmsDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

AddRewards#

Discriminator 58ba19e326895117 · data AddRewards · accounts AddRewardsInstructionAccounts.

FieldType
amountu64
reward_indexu64

Required accounts: 8; extras go to remaining.

Fields of AddRewardsInstructionAccounts, in account order:

#FieldType
0payerPubkey
1farm_statePubkey
2reward_mintPubkey
3reward_vaultPubkey
4farm_vaults_authorityPubkey
5payer_reward_token_ataPubkey
6scope_pricesOption<Pubkey>
7token_programPubkey
8…remainingVec<AccountMeta>

DepositToFarmVault#

Discriminator 83a6405e6cd572b7 · data DepositToFarmVault · accounts DepositToFarmVaultInstructionAccounts.

FieldType
amountu64

Required accounts: 5; extras go to remaining.

Fields of DepositToFarmVaultInstructionAccounts, in account order:

#FieldType
0depositorPubkey
1farm_statePubkey
2farm_vaultPubkey
3depositor_ataPubkey
4token_programPubkey
5…remainingVec<AccountMeta>

HarvestReward#

Discriminator 44c8e4e9b820e2bc · data HarvestReward · accounts HarvestRewardInstructionAccounts.

FieldType
reward_indexu64

Required accounts: 11; extras go to remaining.

Fields of HarvestRewardInstructionAccounts, in account order:

#FieldType
0payerPubkey
1user_statePubkey
2farm_statePubkey
3global_configPubkey
4reward_mintPubkey
5user_reward_token_accountPubkey
6rewards_vaultPubkey
7rewards_treasury_vaultPubkey
8farm_vaults_authorityPubkey
9scope_pricesOption<Pubkey>
10token_programPubkey
11…remainingVec<AccountMeta>

IdlMissingTypes#

Discriminator 8250269950d4b6fd · data IdlMissingTypes · accounts IdlMissingTypesInstructionAccounts.

FieldType
global_config_option_kindGlobalConfigOption
farm_config_option_kindFarmConfigOption
time_unitTimeUnit
locking_modeLockingMode
reward_typeRewardType

Required accounts: 2; extras go to remaining.

Fields of IdlMissingTypesInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

InitializeFarm#

Discriminator fc1cb9acf44a75a5 · data InitializeFarm · accounts InitializeFarmInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of InitializeFarmInstructionAccounts, in account order:

#FieldType
0farm_adminPubkey
1farm_statePubkey
2global_configPubkey
3farm_vaultPubkey
4farm_vaults_authorityPubkey
5token_mintPubkey
6token_programPubkey
7system_programPubkey
8rentPubkey
9…remainingVec<AccountMeta>

InitializeFarmDelegated#

Discriminator fa546519334dcc5b · data InitializeFarmDelegated · accounts InitializeFarmDelegatedInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of InitializeFarmDelegatedInstructionAccounts, in account order:

#FieldType
0farm_adminPubkey
1farm_delegatePubkey
2farm_statePubkey
3global_configPubkey
4farm_vaults_authorityPubkey
5system_programPubkey
6rentPubkey
7…remainingVec<AccountMeta>

InitializeGlobalConfig#

Discriminator 71d87a83e1d11637 · data InitializeGlobalConfig · accounts InitializeGlobalConfigInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of InitializeGlobalConfigInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2treasury_vaults_authorityPubkey
3system_programPubkey
4…remainingVec<AccountMeta>

InitializeReward#

Discriminator 5f87c0c4f281e644 · data InitializeReward · accounts InitializeRewardInstructionAccounts.

No data fields.

Required accounts: 11; extras go to remaining.

Fields of InitializeRewardInstructionAccounts, in account order:

#FieldType
0farm_adminPubkey
1farm_statePubkey
2global_configPubkey
3reward_mintPubkey
4reward_vaultPubkey
5reward_treasury_vaultPubkey
6farm_vaults_authorityPubkey
7treasury_vaults_authorityPubkey
8token_programPubkey
9system_programPubkey
10rentPubkey
11…remainingVec<AccountMeta>

InitializeUser#

Discriminator 6f11b9fa3c7a26fe · data InitializeUser · accounts InitializeUserInstructionAccounts.

No data fields.

Required accounts: 8; extras go to remaining.

Fields of InitializeUserInstructionAccounts, in account order:

#FieldType
0authorityPubkey
1payerPubkey
2ownerPubkey
3delegateePubkey
4user_statePubkey
5farm_statePubkey
6system_programPubkey
7rentPubkey
8…remainingVec<AccountMeta>

RefreshFarm#

Discriminator d6838ab790c2ac2a · data RefreshFarm · accounts RefreshFarmInstructionAccounts.

No data fields.

Required accounts: 1 (2 listed); extras go to remaining.

Fields of RefreshFarmInstructionAccounts, in account order:

#FieldType
0farm_statePubkey
1scope_pricesOption<Pubkey>
2…remainingVec<AccountMeta>

RefreshUserState#

Discriminator 01870c3ef38c4d6c · data RefreshUserState · accounts RefreshUserStateInstructionAccounts.

No data fields.

Required accounts: 2 (3 listed); extras go to remaining.

Fields of RefreshUserStateInstructionAccounts, in account order:

#FieldType
0user_statePubkey
1farm_statePubkey
2scope_pricesOption<Pubkey>
3…remainingVec<AccountMeta>

RewardUserOnce#

Discriminator db8939165eba6072 · data RewardUserOnce · accounts RewardUserOnceInstructionAccounts.

FieldType
reward_indexu64
amountu64
expected_reward_issued_unclaimedu64

Required accounts: 3; extras go to remaining.

Fields of RewardUserOnceInstructionAccounts, in account order:

#FieldType
0delegate_authorityPubkey
1farm_statePubkey
2user_statePubkey
3…remainingVec<AccountMeta>

SetStakeDelegated#

Discriminator 49abb84b1e38c6df · data SetStakeDelegated · accounts SetStakeDelegatedInstructionAccounts.

FieldType
new_amountu64

Required accounts: 3; extras go to remaining.

Fields of SetStakeDelegatedInstructionAccounts, in account order:

#FieldType
0delegate_authorityPubkey
1user_statePubkey
2farm_statePubkey
3…remainingVec<AccountMeta>

Stake#

Discriminator ceb0ca12c8d1b36c · data Stake · accounts StakeInstructionAccounts.

FieldType
amountu64

Required accounts: 8; extras go to remaining.

Fields of StakeInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1user_statePubkey
2farm_statePubkey
3farm_vaultPubkey
4user_ataPubkey
5token_mintPubkey
6scope_pricesOption<Pubkey>
7token_programPubkey
8…remainingVec<AccountMeta>

TransferOwnership#

Discriminator 41b1d749352d632f · data TransferOwnership · accounts TransferOwnershipInstructionAccounts.

No data fields.

Required accounts: 9; extras go to remaining.

Fields of TransferOwnershipInstructionAccounts, in account order:

#FieldType
0old_ownerPubkey
1payerPubkey
2new_ownerPubkey
3old_user_statePubkey
4new_user_statePubkey
5farm_statePubkey
6scope_pricesOption<Pubkey>
7system_programPubkey
8rentPubkey
9…remainingVec<AccountMeta>

Unstake#

Discriminator 5a5f6b2acd7c32e1 · data Unstake · accounts UnstakeInstructionAccounts.

FieldType
stake_shares_scaledu128

Required accounts: 3 (4 listed); extras go to remaining.

Fields of UnstakeInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1user_statePubkey
2farm_statePubkey
3scope_pricesOption<Pubkey>
4…remainingVec<AccountMeta>

UpdateFarmAdmin#

Discriminator 142588137aef2482 · data UpdateFarmAdmin · accounts UpdateFarmAdminInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of UpdateFarmAdminInstructionAccounts, in account order:

#FieldType
0pending_farm_adminPubkey
1farm_statePubkey
2…remainingVec<AccountMeta>

UpdateFarmConfig#

Discriminator d6b0bcf4cb3be6cf · data UpdateFarmConfig · accounts UpdateFarmConfigInstructionAccounts.

FieldType
modeu16
dataVec<u8>

Required accounts: 2 (3 listed); extras go to remaining.

Fields of UpdateFarmConfigInstructionAccounts, in account order:

#FieldType
0signerPubkey
1farm_statePubkey
2scope_pricesOption<Pubkey>
3…remainingVec<AccountMeta>

UpdateGlobalConfig#

Discriminator a45482bd6f3afac8 · data UpdateGlobalConfig · accounts UpdateGlobalConfigInstructionAccounts.

FieldType
modeu8
value[u8; 32]

Required accounts: 2; extras go to remaining.

Fields of UpdateGlobalConfigInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

UpdateGlobalConfigAdmin#

Discriminator b85717c19ceeaf77 · data UpdateGlobalConfigAdmin · accounts UpdateGlobalConfigAdminInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of UpdateGlobalConfigAdminInstructionAccounts, in account order:

#FieldType
0pending_global_adminPubkey
1global_configPubkey
2…remainingVec<AccountMeta>

UpdateSecondDelegatedAuthority#

Discriminator 7f1a06b5cbf87540 · data UpdateSecondDelegatedAuthority · accounts UpdateSecondDelegatedAuthorityInstructionAccounts.

No data fields.

Required accounts: 4; extras go to remaining.

Fields of UpdateSecondDelegatedAuthorityInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1farm_statePubkey
2global_configPubkey
3new_second_delegated_authorityPubkey
4…remainingVec<AccountMeta>

WithdrawFromFarmVault#

Discriminator 165280fa564f7c4e · data WithdrawFromFarmVault · accounts WithdrawFromFarmVaultInstructionAccounts.

FieldType
amountu64

Required accounts: 6; extras go to remaining.

Fields of WithdrawFromFarmVaultInstructionAccounts, in account order:

#FieldType
0withdraw_authorityPubkey
1farm_statePubkey
2withdrawer_token_accountPubkey
3farm_vaultPubkey
4farm_vaults_authorityPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

WithdrawReward#

Discriminator bfbbb0890919bbf4 · data WithdrawReward · accounts WithdrawRewardInstructionAccounts.

FieldType
amountu64
reward_indexu64

Required accounts: 8; extras go to remaining.

Fields of WithdrawRewardInstructionAccounts, in account order:

#FieldType
0farm_adminPubkey
1farm_statePubkey
2reward_mintPubkey
3reward_vaultPubkey
4farm_vaults_authorityPubkey
5admin_reward_token_ataPubkey
6scope_pricesOption<Pubkey>
7token_programPubkey
8…remainingVec<AccountMeta>

WithdrawSlashedAmount#

Discriminator cad9434aac168cd8 · data WithdrawSlashedAmount · accounts WithdrawSlashedAmountInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of WithdrawSlashedAmountInstructionAccounts, in account order:

#FieldType
0crankPubkey
1farm_statePubkey
2slashed_amount_spill_addressPubkey
3farm_vaultPubkey
4farm_vaults_authorityPubkey
5token_programPubkey
6…remainingVec<AccountMeta>

WithdrawTreasury#

Discriminator 283f7a9e90d85360 · data WithdrawTreasury · accounts WithdrawTreasuryInstructionAccounts.

FieldType
amountu64

Required accounts: 7; extras go to remaining.

Fields of WithdrawTreasuryInstructionAccounts, in account order:

#FieldType
0global_adminPubkey
1global_configPubkey
2reward_mintPubkey
3reward_treasury_vaultPubkey
4treasury_vault_authorityPubkey
5withdraw_destination_token_accountPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

WithdrawUnstakedDeposits#

Discriminator 2466bb31dc248443 · data WithdrawUnstakedDeposits · accounts WithdrawUnstakedDepositsInstructionAccounts.

No data fields.

Required accounts: 7; extras go to remaining.

Fields of WithdrawUnstakedDepositsInstructionAccounts, in account order:

#FieldType
0ownerPubkey
1user_statePubkey
2farm_statePubkey
3user_ataPubkey
4farm_vaultPubkey
5farm_vaults_authorityPubkey
6token_programPubkey
7…remainingVec<AccountMeta>

Accounts#

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

FarmState#

Discriminator c666d84a3f42a3be · accounts::farm_state::FarmState.

FieldTypeDescription
farm_adminPubkey
global_configPubkey
tokenTokenInfo
reward_infos[RewardInfo; 10]
num_reward_tokensu64
num_usersu64Data used to calculate the rewards of the user
total_staked_amountu64The number of token in the farm_vault staked (getting rewards and fees) Set such as farm_vault.amount = total_staked_amount + total_pending_amount
farm_vaultPubkey
farm_vaults_authorityPubkey
farm_vaults_authority_bumpu64
delegate_authorityPubkeyOnly used for delegate farms Set to default() otherwise
time_unitu8Raw representation of a TimeUnit Seconds = 0, Slots = 1
is_farm_frozenu8Automatically set to true in case of a full authority withdrawal If true, the farm is frozen and no more deposits are allowed
is_farm_delegatedu8Indicates if the farm is a delegate farm If true, the farm is a delegate farm and the delegate_authority is set*
is_reward_user_once_enabledu8If set to 1, indicates that the "reward user once" feature is enabled
is_harvesting_permissionlessu8
padding0[u8; 3]
withdraw_authorityPubkeyWithdraw authority for the farm, allowed to lock deposited funds and withdraw them Set to default() if unused (only the depositors can withdraw their funds)
deposit_warmup_periodu32Delay between a user deposit and the moment it is considered as staked 0 if unused
withdrawal_cooldown_periodu32Delay between a user unstake and the ability to withdraw his deposit.
total_active_stake_scaledu128Total active stake of tokens in the farm (scaled from Decimal representation).
total_pending_stake_scaledu128Total pending stake of tokens in the farm (scaled from Decimal representation). (can be used by withdraw_authority but don't get rewards or fees)
total_pending_amountu64Total pending amount of tokens in the farm
slashed_amount_currentu64Slashed amounts from early withdrawal
slashed_amount_cumulativeu64
slashed_amount_spill_addressPubkey
locking_modeu64Locking stake
locking_start_timestampu64
locking_durationu64
locking_early_withdrawal_penalty_bpsu64
deposit_cap_amountu64
scope_pricesPubkey
scope_oracle_price_idu64
scope_oracle_max_ageu64
pending_farm_adminPubkey
strategy_idPubkey
delegated_rps_adminPubkey
vault_idPubkey
second_delegated_authorityPubkey
padding[u64; 74]

GlobalConfig#

Discriminator 95089ccaa0fcb0d9 · accounts::global_config::GlobalConfig.

FieldType
global_adminPubkey
treasury_fee_bpsu64
treasury_vaults_authorityPubkey
treasury_vaults_authority_bumpu64
pending_global_adminPubkey
padding1[u128; 126]

OraclePrices#

Discriminator 598076dd0648b492 · accounts::oracle_prices::OraclePrices.

FieldType
oracle_mappingsPubkey
prices[DatedPrice; 512]

UserState#

Discriminator 48b155f94ca7ba7e · accounts::user_state::UserState.

FieldTypeDescription
user_idu64
farm_statePubkey
ownerPubkey
is_farm_delegatedu8Indicate if this user state is part of a delegated farm
padding0[u8; 7]
rewards_tally_scaled[u128; 10]Rewards tally used for computation of gained rewards (scaled from Decimal representation).
rewards_issued_unclaimed[u64; 10]Number of reward tokens ready for claim
last_claim_ts[u64; 10]
active_stake_scaledu128User stake deposited and usable, generating rewards and fees. (scaled from Decimal representation).
pending_deposit_stake_scaledu128User stake deposited but not usable and not generating rewards yet. (scaled from Decimal representation).
pending_deposit_stake_tsu64After this timestamp, pending user stake can be moved to user stake Initialized to now() + delayed user stake period
pending_withdrawal_unstake_scaledu128User deposits unstaked, pending for withdrawal, not usable and not generating rewards. (scaled from Decimal representation).
pending_withdrawal_unstake_tsu64After this timestamp, user can withdraw their deposit.
bumpu64User bump used for account address validation
delegateePubkeyDelegatee used for initialisation - useful to check against
last_stake_tsu64
rewards_issued_cumulative[u64; 10]Cumulative rewards issued to the user - ONLY used for stats/analytics DO NOT USE IN ANY CALCULATIONS Old userStates will have this field populated only from the point of release not reflecting any historical data before this was released
padding1[u64; 40]

Types#

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

DatedPrice#

Struct types::DatedPrice.

FieldType
pricePrice
last_updated_slotu64
unix_timestampu64
reserved[u64; 2]
reserved2[u16; 3]
indexu16

FarmConfigOption#

Enum types::FarmConfigOption.

Variant
UpdateRewardRps
UpdateRewardMinClaimDuration
WithdrawAuthority
DepositWarmupPeriod
WithdrawCooldownPeriod
RewardType
RpsDecimals
LockingMode
LockingStartTimestamp
LockingDuration
LockingEarlyWithdrawalPenaltyBps
DepositCapAmount
SlashedAmountSpillAddress
ScopePricesAccount
ScopeOraclePriceId
ScopeOracleMaxAge
UpdateRewardScheduleCurvePoints
UpdatePendingFarmAdmin
UpdateStrategyId
UpdateDelegatedRpsAdmin
UpdateVaultId
UpdateExtraDelegatedAuthority
UpdateIsRewardUserOnceEnabled
UpdateDelegatedAuthority
UpdateIsHarvestingPermissionless

GlobalConfigOption#

Enum types::GlobalConfigOption.

Variant
SetPendingGlobalAdmin
SetTreasuryFeeBps

LockingMode#

Enum types::LockingMode.

Variant
None
Continuous
WithExpiry

Price#

Struct types::Price.

FieldType
valueu64
expu64

RewardInfo#

Struct types::RewardInfo.

FieldType
tokenTokenInfo
rewards_vaultPubkey
rewards_availableu64
reward_schedule_curveRewardScheduleCurve
min_claim_duration_secondsu64
last_issuance_tsu64
rewards_issued_unclaimedu64
rewards_issued_cumulativeu64
reward_per_share_scaledu128
placeholder0u64
reward_typeu8
rewards_per_second_decimalsu8
padding0[u8; 6]
padding1[u64; 20]

RewardPerTimeUnitPoint#

Struct types::RewardPerTimeUnitPoint.

FieldType
ts_startu64
reward_per_time_unitu64

RewardScheduleCurve#

Struct types::RewardScheduleCurve.

FieldTypeDescription
points[RewardPerTimeUnitPoint; 20]This is a stepwise function, meaning that each point represents how many rewards are issued per time unit since the beginning of that point until the beginning of the next point. This is not a linear curve, there is no interpolation going on. A curve can be [[t0, 100], [t1, 50], [t2, 0]] meaning that from t0 to t1, 100 rewards are issued per time unit, from t1 to t2, 50 rewards are issued per time unit, and after t2 it stops Another curve, can be [[t0, 100], [u64::max, 0]] meaning that from t0 to u64::max, 100 rewards are issued per time unit

RewardType#

Enum types::RewardType.

Variant
Proportional
Constant

TimeUnit#

Enum types::TimeUnit.

Variant
Seconds
Slots

TokenInfo#

Struct types::TokenInfo.

FieldType
mintPubkey
decimalsu64
token_programPubkey
padding[u64; 6]

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.