Marinade Finance decoder

Decode Marinade Finance instructions, accounts and events in Rust with the carbon-marinade-finance-decoder crate.

On this page

carbon-marinade-finance-decoder decodes the instructions, accounts and events of the Marinade Finance program (MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD): 28 instructions, 2 account types, 25 events. It is generated with Codama from the program's IDL; see decoders for how decoders plug into a pipeline.

Cratecarbon-marinade-finance-decoder 2.0.0
Installcargo add carbon-marinade-finance-decoder@2.0.0
Program IDMarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD (carbon_marinade_finance_decoder::PROGRAM_ID)
CategoryLiquid staking & restaking
Decodercarbon_marinade_finance_decoder::MarinadeFinanceDecoder
Instruction enuminstructions::MarinadeFinanceInstruction
Account enumaccounts::MarinadeFinanceAccount
Event enuminstructions::CpiEvent
Featuresserde, postgres, graphql (none enabled by default)
API docsdocs.rs/carbon-marinade-finance-decoder/2.0.0
Sourcedecoders/marinade-finance-decoder

Other liquid staking and restaking decoders: Solayer Restaking. To decode several in one pipeline, see liquid staking and restaking 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 Marinade Finance transactions from the public RPC and prints every decoded Deposit instruction. Add the dependencies:

Terminal
cargo add carbon-core@2.0.0 carbon-marinade-finance-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_marinade_finance_decoder::{
        instructions::MarinadeFinanceInstruction, MarinadeFinanceDecoder, 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(MarinadeFinanceDecoder, InstructionLogger)
        .build()?
        .run()
        .await
}

struct InstructionLogger;

impl Processor<InstructionProcessorInputType<'_, MarinadeFinanceInstruction>> for InstructionLogger {
    async fn process(
        &mut self,
        input: &InstructionProcessorInputType<'_, MarinadeFinanceInstruction>,
    ) -> CarbonResult<()> {
        let signature = input.metadata.transaction_metadata.signature;
        if let MarinadeFinanceInstruction::Deposit { data, accounts, .. } = input.decoded_instruction {
            println!("deposit {signature}: {data:?} state={}", accounts.state);
        }
        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.

Events published with Anchor's emit_cpi! arrive as the CpiEvent instruction. Match them with MarinadeFinanceInstruction::CpiEvent { data: CpiEvent::ChangeAuthorityEvent(event), .. } (import instructions::CpiEvent); see Events. If CpiEvent never arrives, the program logs its events with emit! instead: decode them with decode_log_events.

Decode accounts#

The transaction crawler emits transactions only. To decode accounts, use a datasource that emits account updates. This program subscribes to the program's accounts with programSubscribe on the public WebSocket endpoint and prints every decoded State 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_marinade_finance_decoder::{
        accounts::MarinadeFinanceAccount, MarinadeFinanceDecoder, 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(MarinadeFinanceDecoder, AccountLogger)
        .build()?
        .run()
        .await
}

struct AccountLogger;

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

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

AddLiquidity#

Discriminator b59d59438fb63448 · data AddLiquidity · accounts AddLiquidityInstructionAccounts.

FieldType
lamportsu64

Required accounts: 9; extras go to remaining.

Fields of AddLiquidityInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_mintPubkey
2lp_mint_authorityPubkey
3liq_pool_msol_legPubkey
4liq_pool_sol_leg_pdaPubkey
5transfer_fromPubkey
6mint_toPubkey
7system_programPubkey
8token_programPubkey
9…remainingVec<AccountMeta>

AddValidator#

Discriminator fa7135368d75d7b9 · data AddValidator · accounts AddValidatorInstructionAccounts.

FieldType
scoreu32

Required accounts: 9; extras go to remaining.

Fields of AddValidatorInstructionAccounts, in account order:

#FieldType
0statePubkey
1manager_authorityPubkey
2validator_listPubkey
3validator_votePubkey
4duplication_flagPubkey
5rent_payerPubkey
6clockPubkey
7rentPubkey
8system_programPubkey
9…remainingVec<AccountMeta>

ChangeAuthority#

Discriminator 326a426863769158 · data ChangeAuthority · accounts ChangeAuthorityInstructionAccounts.

FieldType
dataChangeAuthorityData

Required accounts: 2; extras go to remaining.

Fields of ChangeAuthorityInstructionAccounts, in account order:

#FieldType
0statePubkey
1admin_authorityPubkey
2…remainingVec<AccountMeta>

Claim#

Discriminator 3ec6d6c1d59f6cd2 · data Claim · accounts ClaimInstructionAccounts.

No data fields.

Required accounts: 6; extras go to remaining.

Fields of ClaimInstructionAccounts, in account order:

#FieldType
0statePubkey
1reserve_pdaPubkey
2ticket_accountPubkey
3transfer_sol_toPubkey
4clockPubkey
5system_programPubkey
6…remainingVec<AccountMeta>

ConfigLp#

Discriminator 0a18a8775630e111 · data ConfigLp · accounts ConfigLpInstructionAccounts.

FieldType
paramsConfigLpParams

Required accounts: 2; extras go to remaining.

Fields of ConfigLpInstructionAccounts, in account order:

#FieldType
0statePubkey
1admin_authorityPubkey
2…remainingVec<AccountMeta>

ConfigMarinade#

Discriminator 43032272beb9113e · data ConfigMarinade · accounts ConfigMarinadeInstructionAccounts.

FieldType
paramsConfigMarinadeParams

Required accounts: 2; extras go to remaining.

Fields of ConfigMarinadeInstructionAccounts, in account order:

#FieldType
0statePubkey
1admin_authorityPubkey
2…remainingVec<AccountMeta>

ConfigValidatorSystem#

Discriminator 1b5a61d111730728 · data ConfigValidatorSystem · accounts ConfigValidatorSystemInstructionAccounts.

FieldType
extra_runsu32

Required accounts: 2; extras go to remaining.

Fields of ConfigValidatorSystemInstructionAccounts, in account order:

#FieldType
0statePubkey
1manager_authorityPubkey
2…remainingVec<AccountMeta>

DeactivateStake#

Discriminator a59ee561a8dcbbe1 · data DeactivateStake · accounts DeactivateStakeInstructionAccounts.

FieldType
stake_indexu32
validator_indexu32

Required accounts: 14; extras go to remaining.

Fields of DeactivateStakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1reserve_pdaPubkey
2validator_listPubkey
3stake_listPubkey
4stake_accountPubkey
5stake_deposit_authorityPubkey
6split_stake_accountPubkey
7split_stake_rent_payerPubkey
8clockPubkey
9rentPubkey
10epoch_schedulePubkey
11stake_historyPubkey
12system_programPubkey
13stake_programPubkey
14…remainingVec<AccountMeta>

Deposit#

Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.

FieldType
lamportsu64

Required accounts: 11; extras go to remaining.

Fields of DepositInstructionAccounts, in account order:

#FieldType
0statePubkey
1msol_mintPubkey
2liq_pool_sol_leg_pdaPubkey
3liq_pool_msol_legPubkey
4liq_pool_msol_leg_authorityPubkey
5reserve_pdaPubkey
6transfer_fromPubkey
7mint_toPubkey
8msol_mint_authorityPubkey
9system_programPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

DepositStakeAccount#

Discriminator 6e827329a466023b · data DepositStakeAccount · accounts DepositStakeAccountInstructionAccounts.

FieldType
validator_indexu32

Required accounts: 15; extras go to remaining.

Fields of DepositStakeAccountInstructionAccounts, in account order:

#FieldType
0statePubkey
1validator_listPubkey
2stake_listPubkey
3stake_accountPubkey
4stake_authorityPubkey
5duplication_flagPubkey
6rent_payerPubkey
7msol_mintPubkey
8mint_toPubkey
9msol_mint_authorityPubkey
10clockPubkey
11rentPubkey
12system_programPubkey
13token_programPubkey
14stake_programPubkey
15…remainingVec<AccountMeta>

EmergencyUnstake#

Discriminator 7b45a8c3b7d5c7d6 · data EmergencyUnstake · accounts EmergencyUnstakeInstructionAccounts.

FieldType
stake_indexu32
validator_indexu32

Required accounts: 8; extras go to remaining.

Fields of EmergencyUnstakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1validator_manager_authorityPubkey
2validator_listPubkey
3stake_listPubkey
4stake_accountPubkey
5stake_deposit_authorityPubkey
6clockPubkey
7stake_programPubkey
8…remainingVec<AccountMeta>

Initialize#

Discriminator afaf6d1f0d989bed · data Initialize · accounts InitializeInstructionAccounts.

FieldType
dataInitializeData

Required accounts: 12; extras go to remaining.

Fields of InitializeInstructionAccounts, in account order:

#FieldType
0statePubkey
1reserve_pdaPubkey
2stake_listPubkey
3validator_listPubkey
4msol_mintPubkey
5operational_sol_accountPubkey
6lp_mintPubkey
7sol_leg_pdaPubkey
8msol_legPubkey
9treasury_msol_accountPubkey
10clockPubkey
11rentPubkey
12…remainingVec<AccountMeta>

LiquidUnstake#

Discriminator 1e1e77f0bfe30c10 · data LiquidUnstake · accounts LiquidUnstakeInstructionAccounts.

FieldType
msol_amountu64

Required accounts: 10; extras go to remaining.

Fields of LiquidUnstakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1msol_mintPubkey
2liq_pool_sol_leg_pdaPubkey
3liq_pool_msol_legPubkey
4treasury_msol_accountPubkey
5get_msol_fromPubkey
6get_msol_from_authorityPubkey
7transfer_sol_toPubkey
8system_programPubkey
9token_programPubkey
10…remainingVec<AccountMeta>

MergeStakes#

Discriminator d8248de1f34e7ded · data MergeStakes · accounts MergeStakesInstructionAccounts.

FieldType
destination_stake_indexu32
source_stake_indexu32
validator_indexu32

Required accounts: 11; extras go to remaining.

Fields of MergeStakesInstructionAccounts, in account order:

#FieldType
0statePubkey
1stake_listPubkey
2validator_listPubkey
3destination_stakePubkey
4source_stakePubkey
5stake_deposit_authorityPubkey
6stake_withdraw_authorityPubkey
7operational_sol_accountPubkey
8clockPubkey
9stake_historyPubkey
10stake_programPubkey
11…remainingVec<AccountMeta>

OrderUnstake#

Discriminator 61a7906b75be8024 · data OrderUnstake · accounts OrderUnstakeInstructionAccounts.

FieldType
msol_amountu64

Required accounts: 8; extras go to remaining.

Fields of OrderUnstakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1msol_mintPubkey
2burn_msol_fromPubkey
3burn_msol_authorityPubkey
4new_ticket_accountPubkey
5clockPubkey
6rentPubkey
7token_programPubkey
8…remainingVec<AccountMeta>

PartialUnstake#

Discriminator 37f1cddd2d72cda3 · data PartialUnstake · accounts PartialUnstakeInstructionAccounts.

FieldType
stake_indexu32
validator_indexu32
desired_unstake_amountu64

Required accounts: 14; extras go to remaining.

Fields of PartialUnstakeInstructionAccounts, in account order:

#FieldType
0statePubkey
1validator_manager_authorityPubkey
2validator_listPubkey
3stake_listPubkey
4stake_accountPubkey
5stake_deposit_authorityPubkey
6reserve_pdaPubkey
7split_stake_accountPubkey
8split_stake_rent_payerPubkey
9clockPubkey
10rentPubkey
11stake_historyPubkey
12system_programPubkey
13stake_programPubkey
14…remainingVec<AccountMeta>

Pause#

Discriminator d316ddfb4a79c12f · data Pause · accounts PauseInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of PauseInstructionAccounts, in account order:

#FieldType
0statePubkey
1pause_authorityPubkey
2…remainingVec<AccountMeta>

ReallocStakeList#

Discriminator 0c247c1b806055c7 · data ReallocStakeList · accounts ReallocStakeListInstructionAccounts.

FieldType
capacityu32

Required accounts: 5; extras go to remaining.

Fields of ReallocStakeListInstructionAccounts, in account order:

#FieldType
0statePubkey
1admin_authorityPubkey
2stake_listPubkey
3rent_fundsPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

ReallocValidatorList#

Discriminator d73bda855d8a3c7b · data ReallocValidatorList · accounts ReallocValidatorListInstructionAccounts.

FieldType
capacityu32

Required accounts: 5; extras go to remaining.

Fields of ReallocValidatorListInstructionAccounts, in account order:

#FieldType
0statePubkey
1admin_authorityPubkey
2validator_listPubkey
3rent_fundsPubkey
4system_programPubkey
5…remainingVec<AccountMeta>

Redelegate#

Discriminator d45233a0e4507423 · data Redelegate · accounts RedelegateInstructionAccounts.

FieldType
stake_indexu32
source_validator_indexu32
dest_validator_indexu32

Required accounts: 15; extras go to remaining.

Fields of RedelegateInstructionAccounts, in account order:

#FieldType
0statePubkey
1validator_listPubkey
2stake_listPubkey
3stake_accountPubkey
4stake_deposit_authorityPubkey
5reserve_pdaPubkey
6split_stake_accountPubkey
7split_stake_rent_payerPubkey
8dest_validator_accountPubkey
9redelegate_stake_accountPubkey
10clockPubkey
11stake_historyPubkey
12stake_configPubkey
13system_programPubkey
14stake_programPubkey
15…remainingVec<AccountMeta>

RemoveLiquidity#

Discriminator 5055d14818ceb16c · data RemoveLiquidity · accounts RemoveLiquidityInstructionAccounts.

FieldType
tokensu64

Required accounts: 11; extras go to remaining.

Fields of RemoveLiquidityInstructionAccounts, in account order:

#FieldType
0statePubkey
1lp_mintPubkey
2burn_fromPubkey
3burn_from_authorityPubkey
4transfer_sol_toPubkey
5transfer_msol_toPubkey
6liq_pool_sol_leg_pdaPubkey
7liq_pool_msol_legPubkey
8liq_pool_msol_leg_authorityPubkey
9system_programPubkey
10token_programPubkey
11…remainingVec<AccountMeta>

RemoveValidator#

Discriminator 1960d39ba10ea8bc · data RemoveValidator · accounts RemoveValidatorInstructionAccounts.

FieldType
indexu32
validator_votePubkey

Required accounts: 5; extras go to remaining.

Fields of RemoveValidatorInstructionAccounts, in account order:

#FieldType
0statePubkey
1manager_authorityPubkey
2validator_listPubkey
3duplication_flagPubkey
4operational_sol_accountPubkey
5…remainingVec<AccountMeta>

Resume#

Discriminator 01a633aa7f208dce · data Resume · accounts ResumeInstructionAccounts.

No data fields.

Required accounts: 2; extras go to remaining.

Fields of ResumeInstructionAccounts, in account order:

#FieldType
0statePubkey
1pause_authorityPubkey
2…remainingVec<AccountMeta>

SetValidatorScore#

Discriminator 6529ce21d86f194e · data SetValidatorScore · accounts SetValidatorScoreInstructionAccounts.

FieldType
indexu32
validator_votePubkey
scoreu32

Required accounts: 3; extras go to remaining.

Fields of SetValidatorScoreInstructionAccounts, in account order:

#FieldType
0statePubkey
1manager_authorityPubkey
2validator_listPubkey
3…remainingVec<AccountMeta>

StakeReserve#

Discriminator 57d917b3cd197181 · data StakeReserve · accounts StakeReserveInstructionAccounts.

FieldType
validator_indexu32

Required accounts: 15; extras go to remaining.

Fields of StakeReserveInstructionAccounts, in account order:

#FieldType
0statePubkey
1validator_listPubkey
2stake_listPubkey
3validator_votePubkey
4reserve_pdaPubkey
5stake_accountPubkey
6stake_deposit_authorityPubkey
7rent_payerPubkey
8clockPubkey
9epoch_schedulePubkey
10rentPubkey
11stake_historyPubkey
12stake_configPubkey
13system_programPubkey
14stake_programPubkey
15…remainingVec<AccountMeta>

UpdateActive#

Discriminator 0443514088f55d98 · data UpdateActive · accounts UpdateActiveInstructionAccounts.

FieldType
stake_indexu32
validator_indexu32

Required accounts: 13; extras go to remaining.

Fields of UpdateActiveInstructionAccounts, in account order:

#FieldType
0statePubkey
1stake_listPubkey
2stake_accountPubkey
3stake_withdraw_authorityPubkey
4reserve_pdaPubkey
5msol_mintPubkey
6msol_mint_authorityPubkey
7treasury_msol_accountPubkey
8clockPubkey
9stake_historyPubkey
10stake_programPubkey
11token_programPubkey
12validator_listPubkey
13…remainingVec<AccountMeta>

UpdateDeactivated#

Discriminator 10e883739c64ef32 · data UpdateDeactivated · accounts UpdateDeactivatedInstructionAccounts.

FieldType
stake_indexu32

Required accounts: 14; extras go to remaining.

Fields of UpdateDeactivatedInstructionAccounts, in account order:

#FieldType
0statePubkey
1stake_listPubkey
2stake_accountPubkey
3stake_withdraw_authorityPubkey
4reserve_pdaPubkey
5msol_mintPubkey
6msol_mint_authorityPubkey
7treasury_msol_accountPubkey
8clockPubkey
9stake_historyPubkey
10stake_programPubkey
11token_programPubkey
12operational_sol_accountPubkey
13system_programPubkey
14…remainingVec<AccountMeta>

WithdrawStakeAccount#

Discriminator d355b841b7b1e9d9 · data WithdrawStakeAccount · accounts WithdrawStakeAccountInstructionAccounts.

FieldType
stake_indexu32
validator_indexu32
msol_amountu64
beneficiaryPubkey

Required accounts: 16; extras go to remaining.

Fields of WithdrawStakeAccountInstructionAccounts, in account order:

#FieldType
0statePubkey
1msol_mintPubkey
2burn_msol_fromPubkey
3burn_msol_authorityPubkey
4treasury_msol_accountPubkey
5validator_listPubkey
6stake_listPubkey
7stake_withdraw_authorityPubkey
8stake_deposit_authorityPubkey
9stake_accountPubkey
10split_stake_accountPubkey
11split_stake_rent_payerPubkey
12clockPubkey
13system_programPubkey
14token_programPubkey
15stake_programPubkey
16…remainingVec<AccountMeta>

CpiEvent#

Anchor self-CPI that carries one of the program's events. data is the CpiEvent enum.

Discriminator e445a52e51cb9a1d · data CpiEvent · accounts CpiEventInstructionAccounts.

Required accounts: 2; extras go to remaining.

Fields of CpiEventInstructionAccounts, in account order:

#FieldType
0programPubkey
1event_authorityPubkey
2…remainingVec<AccountMeta>

Accounts#

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

State#

Discriminator d8926b5e684bb6b1 · accounts::state::State.

FieldTypeDescription
msol_mintPubkey
admin_authorityPubkey
operational_sol_accountPubkey
treasury_msol_accountPubkey
reserve_bump_seedu8
msol_mint_authority_bump_seedu8
rent_exempt_for_token_accu64
reward_feeFee
stake_systemStakeSystem
validator_systemValidatorSystem
liq_poolLiqPool
available_reserve_balanceu64
msol_supplyu64
msol_priceu64
circulating_ticket_countu64count tickets for delayed-unstake
circulating_ticket_balanceu64total lamports amount of generated and not claimed yet tickets
lent_from_reserveu64
min_depositu64
min_withdrawu64
staking_sol_capu64
emergency_cooling_downu64
pause_authorityPubkeyemergency pause
pausedbool
delayed_unstake_feeFeeCents
withdraw_stake_account_feeFeeCents
withdraw_stake_account_enabledbool
last_stake_move_epochu64
stake_movedu64
max_stake_moved_per_epochFee

TicketAccountData#

Discriminator 854d1262d301e703 · accounts::ticket_account_data::TicketAccountData.

FieldType
state_addressPubkey
beneficiaryPubkey
lamports_amountu64
created_epochu64

Events#

Variants of instructions::CpiEvent, decoded from the CpiEvent instruction. Each wraps a struct from carbon_marinade_finance_decoder::events::<module>. The discriminator is the 8-byte event discriminator that follows the e445a52e51cb9a1d CPI-event tag.

ChangeAuthorityEvent#

Discriminator e46f2318bb4ee08a · events::change_authority_event::ChangeAuthorityEventEvent.

FieldType
statePubkey
admin_changeOption<PubkeyValueChange>
validator_manager_changeOption<PubkeyValueChange>
operational_sol_account_changeOption<PubkeyValueChange>
treasury_msol_account_changeOption<PubkeyValueChange>
pause_authority_changeOption<PubkeyValueChange>

ConfigLpEvent#

Discriminator 9fccc08a4491e094 · events::config_lp_event::ConfigLpEventEvent.

FieldType
statePubkey
min_fee_changeOption<FeeValueChange>
max_fee_changeOption<FeeValueChange>
liquidity_target_changeOption<U64ValueChange>
treasury_cut_changeOption<FeeValueChange>

ConfigMarinadeEvent#

Discriminator 9fa4f5725efd0309 · events::config_marinade_event::ConfigMarinadeEventEvent.

FieldType
statePubkey
rewards_fee_changeOption<FeeValueChange>
slots_for_stake_delta_changeOption<U64ValueChange>
min_stake_changeOption<U64ValueChange>
min_deposit_changeOption<U64ValueChange>
min_withdraw_changeOption<U64ValueChange>
staking_sol_cap_changeOption<U64ValueChange>
liquidity_sol_cap_changeOption<U64ValueChange>
withdraw_stake_account_enabled_changeOption<BoolValueChange>
delayed_unstake_fee_changeOption<FeeCentsValueChange>
withdraw_stake_account_fee_changeOption<FeeCentsValueChange>
max_stake_moved_per_epoch_changeOption<FeeValueChange>

InitializeEvent#

Discriminator ceafa9d0f1d223dd · events::initialize_event::InitializeEventEvent.

FieldType
statePubkey
paramsInitializeData
stake_listPubkey
validator_listPubkey
msol_mintPubkey
operational_sol_accountPubkey
lp_mintPubkey
lp_msol_legPubkey
treasury_msol_accountPubkey

EmergencyPauseEvent#

Discriminator 9ff1c0e81dd03315 · events::emergency_pause_event::EmergencyPauseEventEvent.

FieldType
statePubkey

ResumeEvent#

Discriminator 6175b77375e008e5 · events::resume_event::ResumeEventEvent.

FieldType
statePubkey

ReallocValidatorListEvent#

Discriminator 46bff2a4389c820d · events::realloc_validator_list_event::ReallocValidatorListEventEvent.

FieldType
statePubkey
countu32
new_capacityu32

ReallocStakeListEvent#

Discriminator c18110f3b183f817 · events::realloc_stake_list_event::ReallocStakeListEventEvent.

FieldType
statePubkey
countu32
new_capacityu32

DeactivateStakeEvent#

Discriminator 0236b8da4eb5a375 · events::deactivate_stake_event::DeactivateStakeEventEvent.

FieldType
statePubkey
epochu64
stake_indexu32
stake_accountPubkey
last_update_stake_delegationu64
split_stake_accountOption<SplitStakeAccountInfo>
validator_indexu32
validator_votePubkey
total_stake_targetu64
validator_stake_targetu64
total_active_balanceu64
delayed_unstake_cooling_downu64
validator_active_balanceu64
total_unstake_deltau64
unstaked_amountu64

MergeStakesEvent#

Discriminator 499c45e9200e9641 · events::merge_stakes_event::MergeStakesEventEvent.

FieldType
statePubkey
epochu64
destination_stake_indexu32
destination_stake_accountPubkey
last_update_destination_stake_delegationu64
source_stake_indexu32
source_stake_accountPubkey
last_update_source_stake_delegationu64
validator_indexu32
validator_votePubkey
extra_delegatedu64
returned_stake_rentu64
validator_active_balanceu64
total_active_balanceu64
operational_sol_balanceu64

RedelegateEvent#

Discriminator f14b87adccd74843 · events::redelegate_event::RedelegateEventEvent.

FieldType
statePubkey
epochu64
stake_indexu32
stake_accountPubkey
last_update_delegationu64
source_validator_indexu32
source_validator_votePubkey
source_validator_scoreu32
source_validator_balanceu64
source_validator_stake_targetu64
dest_validator_indexu32
dest_validator_votePubkey
dest_validator_scoreu32
dest_validator_balanceu64
dest_validator_stake_targetu64
redelegate_amountu64
split_stake_accountOption<SplitStakeAccountInfo>
redelegate_stake_indexu32
redelegate_stake_accountPubkey

StakeReserveEvent#

Discriminator 707595b94d77be6a · events::stake_reserve_event::StakeReserveEventEvent.

FieldType
statePubkey
epochu64
stake_indexu32
stake_accountPubkey
validator_indexu32
validator_votePubkey
total_stake_targetu64
validator_stake_targetu64
reserve_balanceu64
total_active_balanceu64
validator_active_balanceu64
total_stake_deltau64
amountu64

UpdateActiveEvent#

Discriminator fb12804bd050ae8c · events::update_active_event::UpdateActiveEventEvent.

FieldType
statePubkey
epochu64
stake_indexu32
stake_accountPubkey
validator_indexu32
validator_votePubkey
delegation_changeU64ValueChange
delegation_growth_msol_feesOption<u64>
extra_lamportsu64
extra_msol_feesOption<u64>
validator_active_balanceu64
total_active_balanceu64
msol_price_changeU64ValueChange
reward_fee_usedFee
total_virtual_staked_lamportsu64
msol_supplyu64

UpdateDeactivatedEvent#

Discriminator fc9fb193b671ba5e · events::update_deactivated_event::UpdateDeactivatedEventEvent.

FieldType
statePubkey
epochu64
stake_indexu32
stake_accountPubkey
balance_without_rent_exemptu64
last_update_delegated_lamportsu64
msol_feesOption<u64>
msol_price_changeU64ValueChange
reward_fee_usedFee
operational_sol_balanceu64
total_virtual_staked_lamportsu64
msol_supplyu64

ClaimEvent#

Discriminator 5d0f46aa308cd4db · events::claim_event::ClaimEventEvent.

FieldType
statePubkey
epochu64
ticketPubkey
beneficiaryPubkey
circulating_ticket_balanceu64
circulating_ticket_countu64
reserve_balanceu64
user_balanceu64
amountu64

OrderUnstakeEvent#

Discriminator e43f9bf984a08771 · events::order_unstake_event::OrderUnstakeEventEvent.

FieldType
statePubkey
ticket_epochu64
ticketPubkey
beneficiaryPubkey
circulating_ticket_balanceu64
circulating_ticket_countu64
user_msol_balanceu64
burned_msol_amountu64
sol_amountu64
fee_bp_centsu32
total_virtual_staked_lamportsu64
msol_supplyu64

AddLiquidityEvent#

Discriminator 1bb299ba2fc48c2d · events::add_liquidity_event::AddLiquidityEventEvent.

FieldType
statePubkey
sol_ownerPubkey
user_sol_balanceu64
user_lp_balanceu64
sol_leg_balanceu64
lp_supplyu64
sol_added_amountu64
lp_mintedu64
total_virtual_staked_lamportsu64
msol_supplyu64

LiquidUnstakeEvent#

Discriminator ad05930f050ec274 · events::liquid_unstake_event::LiquidUnstakeEventEvent.

FieldType
statePubkey
msol_ownerPubkey
liq_pool_sol_balanceu64
liq_pool_msol_balanceu64
treasury_msol_balanceOption<u64>
user_msol_balanceu64
user_sol_balanceu64
msol_amountu64
msol_feeu64
treasury_msol_cutu64
sol_amountu64
lp_liquidity_targetu64
lp_max_feeFee
lp_min_feeFee
treasury_cutFee

RemoveLiquidityEvent#

Discriminator 8dc7b67b9f5ed766 · events::remove_liquidity_event::RemoveLiquidityEventEvent.

FieldType
statePubkey
sol_leg_balanceu64
msol_leg_balanceu64
user_lp_balanceu64
user_sol_balanceu64
user_msol_balanceu64
lp_mint_supplyu64
lp_burnedu64
sol_out_amountu64
msol_out_amountu64

AddValidatorEvent#

Discriminator bee7aaf40ee38142 · events::add_validator_event::AddValidatorEventEvent.

FieldType
statePubkey
validatorPubkey
indexu32
scoreu32

RemoveValidatorEvent#

Discriminator 43a4bec09c9ca8d2 · events::remove_validator_event::RemoveValidatorEventEvent.

FieldType
statePubkey
validatorPubkey
indexu32
operational_sol_balanceu64

SetValidatorScoreEvent#

Discriminator 3a35edb2ee99559c · events::set_validator_score_event::SetValidatorScoreEventEvent.

FieldType
statePubkey
validatorPubkey
indexu32
score_changeU32ValueChange

DepositStakeAccountEvent#

Discriminator e7cb76604b7446e4 · events::deposit_stake_account_event::DepositStakeAccountEventEvent.

FieldType
statePubkey
stakePubkey
delegatedu64
withdrawerPubkey
stake_indexu32
validatorPubkey
validator_indexu32
validator_active_balanceu64
total_active_balanceu64
user_msol_balanceu64
msol_mintedu64
total_virtual_staked_lamportsu64
msol_supplyu64

DepositEvent#

Discriminator 78f83d531f8e6b90 · events::deposit_event::DepositEventEvent.

FieldType
statePubkey
sol_ownerPubkey
user_sol_balanceu64
user_msol_balanceu64
sol_leg_balanceu64
msol_leg_balanceu64
reserve_balanceu64
sol_swappedu64
msol_swappedu64
sol_depositedu64
msol_mintedu64
total_virtual_staked_lamportsu64
msol_supplyu64

WithdrawStakeAccountEvent#

Discriminator 83ee27301e1ba51c · events::withdraw_stake_account_event::WithdrawStakeAccountEventEvent.

FieldType
statePubkey
epochu64
stakePubkey
last_update_stake_delegationu64
stake_indexu32
validatorPubkey
validator_indexu32
user_msol_balanceu64
user_msol_authPubkey
msol_burnedu64
msol_feesu64
split_stakePubkey
beneficiaryPubkey
split_lamportsu64
fee_bp_centsu32
total_virtual_staked_lamportsu64
msol_supplyu64

Types#

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

AddLiquidityEvent#

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

AddValidatorEvent#

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

BoolValueChange#

Struct types::BoolValueChange.

FieldType
oldbool
newbool

ChangeAuthorityData#

Struct types::ChangeAuthorityData.

FieldType
adminOption<Pubkey>
validator_managerOption<Pubkey>
operational_sol_accountOption<Pubkey>
treasury_msol_accountOption<Pubkey>
pause_authorityOption<Pubkey>

ChangeAuthorityEvent#

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

ClaimEvent#

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

ConfigLpEvent#

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

ConfigLpParams#

Struct types::ConfigLpParams.

FieldType
min_feeOption<Fee>
max_feeOption<Fee>
liquidity_targetOption<u64>
treasury_cutOption<Fee>

ConfigMarinadeEvent#

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

ConfigMarinadeParams#

Struct types::ConfigMarinadeParams.

FieldType
rewards_feeOption<Fee>
slots_for_stake_deltaOption<u64>
min_stakeOption<u64>
min_depositOption<u64>
min_withdrawOption<u64>
staking_sol_capOption<u64>
liquidity_sol_capOption<u64>
withdraw_stake_account_enabledOption<bool>
delayed_unstake_feeOption<FeeCents>
withdraw_stake_account_feeOption<FeeCents>
max_stake_moved_per_epochOption<Fee>

DeactivateStakeEvent#

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

DepositEvent#

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

DepositStakeAccountEvent#

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

EmergencyPauseEvent#

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

Fee#

Struct types::Fee.

FieldType
basis_pointsu32

FeeCents#

From the program's IDL:

FeeCents, same as Fee but / 1_000_000 instead of 10_000 1 FeeCent = 0.0001%, 10_000 FeeCent = 1%, 1_000_000 FeeCent = 100%

Struct types::FeeCents.

FieldType
bp_centsu32

FeeCentsValueChange#

Struct types::FeeCentsValueChange.

FieldType
oldFeeCents
newFeeCents

FeeValueChange#

Struct types::FeeValueChange.

FieldType
oldFee
newFee

InitializeData#

Struct types::InitializeData.

FieldType
admin_authorityPubkey
validator_manager_authorityPubkey
min_stakeu64
rewards_feeFee
liq_poolLiqPoolInitializeData
additional_stake_record_spaceu32
additional_validator_record_spaceu32
slots_for_stake_deltau64
pause_authorityPubkey

InitializeEvent#

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

LiqPool#

Struct types::LiqPool.

FieldTypeDescription
lp_mintPubkey
lp_mint_authority_bump_seedu8
sol_leg_bump_seedu8
msol_leg_authority_bump_seedu8
msol_legPubkey
lp_liquidity_targetu64Liquidity target. If the Liquidity reach this amount, the fee reaches lp_min_discount_fee
lp_max_feeFeeLiquidity pool max fee
lp_min_feeFeeSOL/mSOL Liquidity pool min fee
treasury_cutFeeTreasury cut
lp_supplyu64
lent_from_sol_legu64
liquidity_sol_capu64

LiqPoolInitializeData#

Struct types::LiqPoolInitializeData.

FieldType
lp_liquidity_targetu64
lp_max_feeFee
lp_min_feeFee
lp_treasury_cutFee

LiquidUnstakeEvent#

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

List#

Struct types::List.

FieldType
accountPubkey
item_sizeu32
countu32
reserved1Pubkey
reserved2u32

MergeStakesEvent#

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

OrderUnstakeEvent#

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

PubkeyValueChange#

Struct types::PubkeyValueChange.

FieldType
oldPubkey
newPubkey

ReallocStakeListEvent#

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

ReallocValidatorListEvent#

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

RedelegateEvent#

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

RemoveLiquidityEvent#

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

RemoveValidatorEvent#

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

ResumeEvent#

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

SetValidatorScoreEvent#

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

SplitStakeAccountInfo#

Struct types::SplitStakeAccountInfo.

FieldType
accountPubkey
indexu32

StakeList#

Struct types::StakeList.

No fields.

StakeRecord#

Struct types::StakeRecord.

FieldType
stake_accountPubkey
last_update_delegated_lamportsu64
last_update_epochu64
is_emergency_unstakingu8

StakeReserveEvent#

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

StakeSystem#

Struct types::StakeSystem.

FieldTypeDescription
stake_listList
delayed_unstake_cooling_downu64
stake_deposit_bump_seedu8
stake_withdraw_bump_seedu8
slots_for_stake_deltau64set by admin, how much slots before the end of the epoch, stake-delta can start
last_stake_delta_epochu64Marks the start of stake-delta operations, meaning that if somebody starts a delayed-unstake ticket after this var is set with epoch_num the ticket will have epoch_created = current_epoch+1 (the user must wait one more epoch, because their unstake-delta will be execute in this epoch)
min_stakeu64
extra_stake_delta_runsu32can be set by validator-manager-auth to allow a second run of stake-delta to stake late stakers in the last minute of the epoch so we maximize user's rewards

U32ValueChange#

Struct types::U32ValueChange.

FieldType
oldu32
newu32

U64ValueChange#

Struct types::U64ValueChange.

FieldType
oldu64
newu64

UpdateActiveEvent#

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

UpdateDeactivatedEvent#

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

ValidatorList#

Struct types::ValidatorList.

No fields.

ValidatorRecord#

Struct types::ValidatorRecord.

FieldTypeDescription
validator_accountPubkeyValidator vote pubkey
active_balanceu64Validator total balance in lamports
scoreu32
last_stake_delta_epochu64
duplication_flag_bump_seedu8

ValidatorSystem#

Struct types::ValidatorSystem.

FieldTypeDescription
validator_listList
manager_authorityPubkey
total_validator_scoreu32
total_active_balanceu64sum of all active lamports staked
auto_add_validator_enabledu8DEPRECATED, no longer used

WithdrawStakeAccountEvent#

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

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.