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.
| Crate | carbon-marinade-finance-decoder 2.0.0 |
| Install | cargo add carbon-marinade-finance-decoder@2. |
| Program ID | MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD (carbon_) |
| Category | Liquid staking & restaking |
| Decoder | carbon_ |
| Instruction enum | instructions:: |
| Account enum | accounts:: |
| Event enum | instructions:: |
| Features | serde, postgres, graphql (none enabled by default) |
| API docs | docs.rs/carbon-marinade-finance-decoder/2.0.0 |
| Source | decoders/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:
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/fulluse {
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(())
}
}RUST_LOG=info cargo runEach 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:: (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 State 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_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(())
}
}RUST_LOG=info cargo runEach 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::, 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
MarBmsSgKXdrN1egZf5sqe1TMai9K1rChYNDJgjq7aD. - 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 |
|---|---|
lamports | u64 |
Required accounts: 9; extras go to remaining.
Fields of AddLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | lp_ | Pubkey |
| 3 | liq_ | Pubkey |
| 4 | liq_ | Pubkey |
| 5 | transfer_ | Pubkey |
| 6 | mint_to | Pubkey |
| 7 | system_ | Pubkey |
| 8 | token_ | Pubkey |
| 9… | remaining | Vec< |
AddValidator#
Discriminator fa7135368d75d7b9 · data AddValidator · accounts AddValidatorInstructionAccounts.
| Field | Type |
|---|---|
score | u32 |
Required accounts: 9; extras go to remaining.
Fields of AddValidatorInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | manager_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | validator_ | Pubkey |
| 4 | duplication_ | Pubkey |
| 5 | rent_payer | Pubkey |
| 6 | clock | Pubkey |
| 7 | rent | Pubkey |
| 8 | system_ | Pubkey |
| 9… | remaining | Vec< |
ChangeAuthority#
Discriminator 326a426863769158 · data ChangeAuthority · accounts ChangeAuthorityInstructionAccounts.
| Field | Type |
|---|---|
data | ChangeAuthorityData |
Required accounts: 2; extras go to remaining.
Fields of ChangeAuthorityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin_ | Pubkey |
| 2… | remaining | Vec< |
Claim#
Discriminator 3ec6d6c1d59f6cd2 · data Claim · accounts ClaimInstructionAccounts.
No data fields.
Required accounts: 6; extras go to remaining.
Fields of ClaimInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | reserve_pda | Pubkey |
| 2 | ticket_ | Pubkey |
| 3 | transfer_ | Pubkey |
| 4 | clock | Pubkey |
| 5 | system_ | Pubkey |
| 6… | remaining | Vec< |
ConfigLp#
Discriminator 0a18a8775630e111 · data ConfigLp · accounts ConfigLpInstructionAccounts.
| Field | Type |
|---|---|
params | ConfigLpParams |
Required accounts: 2; extras go to remaining.
Fields of ConfigLpInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin_ | Pubkey |
| 2… | remaining | Vec< |
ConfigMarinade#
Discriminator 43032272beb9113e · data ConfigMarinade · accounts ConfigMarinadeInstructionAccounts.
| Field | Type |
|---|---|
params | ConfigMarinadeParams |
Required accounts: 2; extras go to remaining.
Fields of ConfigMarinadeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin_ | Pubkey |
| 2… | remaining | Vec< |
ConfigValidatorSystem#
Discriminator 1b5a61d111730728 · data ConfigValidatorSystem · accounts ConfigValidatorSystemInstructionAccounts.
| Field | Type |
|---|---|
extra_runs | u32 |
Required accounts: 2; extras go to remaining.
Fields of ConfigValidatorSystemInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | manager_ | Pubkey |
| 2… | remaining | Vec< |
DeactivateStake#
Discriminator a59ee561a8dcbbe1 · data DeactivateStake · accounts DeactivateStakeInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
validator_ | u32 |
Required accounts: 14; extras go to remaining.
Fields of DeactivateStakeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | reserve_pda | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | stake_list | Pubkey |
| 4 | stake_ | Pubkey |
| 5 | stake_ | Pubkey |
| 6 | split_ | Pubkey |
| 7 | split_ | Pubkey |
| 8 | clock | Pubkey |
| 9 | rent | Pubkey |
| 10 | epoch_ | Pubkey |
| 11 | stake_ | Pubkey |
| 12 | system_ | Pubkey |
| 13 | stake_ | Pubkey |
| 14… | remaining | Vec< |
Deposit#
Discriminator f223c68952e1f2b6 · data Deposit · accounts DepositInstructionAccounts.
| Field | Type |
|---|---|
lamports | u64 |
Required accounts: 11; extras go to remaining.
Fields of DepositInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | msol_mint | Pubkey |
| 2 | liq_ | Pubkey |
| 3 | liq_ | Pubkey |
| 4 | liq_ | Pubkey |
| 5 | reserve_pda | Pubkey |
| 6 | transfer_ | Pubkey |
| 7 | mint_to | Pubkey |
| 8 | msol_ | Pubkey |
| 9 | system_ | Pubkey |
| 10 | token_ | Pubkey |
| 11… | remaining | Vec< |
DepositStakeAccount#
Discriminator 6e827329a466023b · data DepositStakeAccount · accounts DepositStakeAccountInstructionAccounts.
| Field | Type |
|---|---|
validator_ | u32 |
Required accounts: 15; extras go to remaining.
Fields of DepositStakeAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | validator_ | Pubkey |
| 2 | stake_list | Pubkey |
| 3 | stake_ | Pubkey |
| 4 | stake_ | Pubkey |
| 5 | duplication_ | Pubkey |
| 6 | rent_payer | Pubkey |
| 7 | msol_mint | Pubkey |
| 8 | mint_to | Pubkey |
| 9 | msol_ | Pubkey |
| 10 | clock | Pubkey |
| 11 | rent | Pubkey |
| 12 | system_ | Pubkey |
| 13 | token_ | Pubkey |
| 14 | stake_ | Pubkey |
| 15… | remaining | Vec< |
EmergencyUnstake#
Discriminator 7b45a8c3b7d5c7d6 · data EmergencyUnstake · accounts EmergencyUnstakeInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
validator_ | u32 |
Required accounts: 8; extras go to remaining.
Fields of EmergencyUnstakeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | validator_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | stake_list | Pubkey |
| 4 | stake_ | Pubkey |
| 5 | stake_ | Pubkey |
| 6 | clock | Pubkey |
| 7 | stake_ | Pubkey |
| 8… | remaining | Vec< |
Initialize#
Discriminator afaf6d1f0d989bed · data Initialize · accounts InitializeInstructionAccounts.
| Field | Type |
|---|---|
data | InitializeData |
Required accounts: 12; extras go to remaining.
Fields of InitializeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | reserve_pda | Pubkey |
| 2 | stake_list | Pubkey |
| 3 | validator_ | Pubkey |
| 4 | msol_mint | Pubkey |
| 5 | operational_ | Pubkey |
| 6 | lp_mint | Pubkey |
| 7 | sol_leg_pda | Pubkey |
| 8 | msol_leg | Pubkey |
| 9 | treasury_ | Pubkey |
| 10 | clock | Pubkey |
| 11 | rent | Pubkey |
| 12… | remaining | Vec< |
LiquidUnstake#
Discriminator 1e1e77f0bfe30c10 · data LiquidUnstake · accounts LiquidUnstakeInstructionAccounts.
| Field | Type |
|---|---|
msol_amount | u64 |
Required accounts: 10; extras go to remaining.
Fields of LiquidUnstakeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | msol_mint | Pubkey |
| 2 | liq_ | Pubkey |
| 3 | liq_ | Pubkey |
| 4 | treasury_ | Pubkey |
| 5 | get_ | Pubkey |
| 6 | get_ | Pubkey |
| 7 | transfer_ | Pubkey |
| 8 | system_ | Pubkey |
| 9 | token_ | Pubkey |
| 10… | remaining | Vec< |
MergeStakes#
Discriminator d8248de1f34e7ded · data MergeStakes · accounts MergeStakesInstructionAccounts.
| Field | Type |
|---|---|
destination_ | u32 |
source_ | u32 |
validator_ | u32 |
Required accounts: 11; extras go to remaining.
Fields of MergeStakesInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | stake_list | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | destination_ | Pubkey |
| 4 | source_ | Pubkey |
| 5 | stake_ | Pubkey |
| 6 | stake_ | Pubkey |
| 7 | operational_ | Pubkey |
| 8 | clock | Pubkey |
| 9 | stake_ | Pubkey |
| 10 | stake_ | Pubkey |
| 11… | remaining | Vec< |
OrderUnstake#
Discriminator 61a7906b75be8024 · data OrderUnstake · accounts OrderUnstakeInstructionAccounts.
| Field | Type |
|---|---|
msol_amount | u64 |
Required accounts: 8; extras go to remaining.
Fields of OrderUnstakeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | msol_mint | Pubkey |
| 2 | burn_ | Pubkey |
| 3 | burn_ | Pubkey |
| 4 | new_ | Pubkey |
| 5 | clock | Pubkey |
| 6 | rent | Pubkey |
| 7 | token_ | Pubkey |
| 8… | remaining | Vec< |
PartialUnstake#
Discriminator 37f1cddd2d72cda3 · data PartialUnstake · accounts PartialUnstakeInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
validator_ | u32 |
desired_ | u64 |
Required accounts: 14; extras go to remaining.
Fields of PartialUnstakeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | validator_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | stake_list | Pubkey |
| 4 | stake_ | Pubkey |
| 5 | stake_ | Pubkey |
| 6 | reserve_pda | Pubkey |
| 7 | split_ | Pubkey |
| 8 | split_ | Pubkey |
| 9 | clock | Pubkey |
| 10 | rent | Pubkey |
| 11 | stake_ | Pubkey |
| 12 | system_ | Pubkey |
| 13 | stake_ | Pubkey |
| 14… | remaining | Vec< |
Pause#
Discriminator d316ddfb4a79c12f · data Pause · accounts PauseInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of PauseInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pause_ | Pubkey |
| 2… | remaining | Vec< |
ReallocStakeList#
Discriminator 0c247c1b806055c7 · data ReallocStakeList · accounts ReallocStakeListInstructionAccounts.
| Field | Type |
|---|---|
capacity | u32 |
Required accounts: 5; extras go to remaining.
Fields of ReallocStakeListInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin_ | Pubkey |
| 2 | stake_list | Pubkey |
| 3 | rent_funds | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
ReallocValidatorList#
Discriminator d73bda855d8a3c7b · data ReallocValidatorList · accounts ReallocValidatorListInstructionAccounts.
| Field | Type |
|---|---|
capacity | u32 |
Required accounts: 5; extras go to remaining.
Fields of ReallocValidatorListInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | admin_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | rent_funds | Pubkey |
| 4 | system_ | Pubkey |
| 5… | remaining | Vec< |
Redelegate#
Discriminator d45233a0e4507423 · data Redelegate · accounts RedelegateInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
source_ | u32 |
dest_ | u32 |
Required accounts: 15; extras go to remaining.
Fields of RedelegateInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | validator_ | Pubkey |
| 2 | stake_list | Pubkey |
| 3 | stake_ | Pubkey |
| 4 | stake_ | Pubkey |
| 5 | reserve_pda | Pubkey |
| 6 | split_ | Pubkey |
| 7 | split_ | Pubkey |
| 8 | dest_ | Pubkey |
| 9 | redelegate_ | Pubkey |
| 10 | clock | Pubkey |
| 11 | stake_ | Pubkey |
| 12 | stake_ | Pubkey |
| 13 | system_ | Pubkey |
| 14 | stake_ | Pubkey |
| 15… | remaining | Vec< |
RemoveLiquidity#
Discriminator 5055d14818ceb16c · data RemoveLiquidity · accounts RemoveLiquidityInstructionAccounts.
| Field | Type |
|---|---|
tokens | u64 |
Required accounts: 11; extras go to remaining.
Fields of RemoveLiquidityInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | lp_mint | Pubkey |
| 2 | burn_from | Pubkey |
| 3 | burn_ | Pubkey |
| 4 | transfer_ | Pubkey |
| 5 | transfer_ | Pubkey |
| 6 | liq_ | Pubkey |
| 7 | liq_ | Pubkey |
| 8 | liq_ | Pubkey |
| 9 | system_ | Pubkey |
| 10 | token_ | Pubkey |
| 11… | remaining | Vec< |
RemoveValidator#
Discriminator 1960d39ba10ea8bc · data RemoveValidator · accounts RemoveValidatorInstructionAccounts.
| Field | Type |
|---|---|
index | u32 |
validator_ | Pubkey |
Required accounts: 5; extras go to remaining.
Fields of RemoveValidatorInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | manager_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3 | duplication_ | Pubkey |
| 4 | operational_ | Pubkey |
| 5… | remaining | Vec< |
Resume#
Discriminator 01a633aa7f208dce · data Resume · accounts ResumeInstructionAccounts.
No data fields.
Required accounts: 2; extras go to remaining.
Fields of ResumeInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | pause_ | Pubkey |
| 2… | remaining | Vec< |
SetValidatorScore#
Discriminator 6529ce21d86f194e · data SetValidatorScore · accounts SetValidatorScoreInstructionAccounts.
| Field | Type |
|---|---|
index | u32 |
validator_ | Pubkey |
score | u32 |
Required accounts: 3; extras go to remaining.
Fields of SetValidatorScoreInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | manager_ | Pubkey |
| 2 | validator_ | Pubkey |
| 3… | remaining | Vec< |
StakeReserve#
Discriminator 57d917b3cd197181 · data StakeReserve · accounts StakeReserveInstructionAccounts.
| Field | Type |
|---|---|
validator_ | u32 |
Required accounts: 15; extras go to remaining.
Fields of StakeReserveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | validator_ | Pubkey |
| 2 | stake_list | Pubkey |
| 3 | validator_ | Pubkey |
| 4 | reserve_pda | Pubkey |
| 5 | stake_ | Pubkey |
| 6 | stake_ | Pubkey |
| 7 | rent_payer | Pubkey |
| 8 | clock | Pubkey |
| 9 | epoch_ | Pubkey |
| 10 | rent | Pubkey |
| 11 | stake_ | Pubkey |
| 12 | stake_ | Pubkey |
| 13 | system_ | Pubkey |
| 14 | stake_ | Pubkey |
| 15… | remaining | Vec< |
UpdateActive#
Discriminator 0443514088f55d98 · data UpdateActive · accounts UpdateActiveInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
validator_ | u32 |
Required accounts: 13; extras go to remaining.
Fields of UpdateActiveInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | stake_list | Pubkey |
| 2 | stake_ | Pubkey |
| 3 | stake_ | Pubkey |
| 4 | reserve_pda | Pubkey |
| 5 | msol_mint | Pubkey |
| 6 | msol_ | Pubkey |
| 7 | treasury_ | Pubkey |
| 8 | clock | Pubkey |
| 9 | stake_ | Pubkey |
| 10 | stake_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | validator_ | Pubkey |
| 13… | remaining | Vec< |
UpdateDeactivated#
Discriminator 10e883739c64ef32 · data UpdateDeactivated · accounts UpdateDeactivatedInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
Required accounts: 14; extras go to remaining.
Fields of UpdateDeactivatedInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | stake_list | Pubkey |
| 2 | stake_ | Pubkey |
| 3 | stake_ | Pubkey |
| 4 | reserve_pda | Pubkey |
| 5 | msol_mint | Pubkey |
| 6 | msol_ | Pubkey |
| 7 | treasury_ | Pubkey |
| 8 | clock | Pubkey |
| 9 | stake_ | Pubkey |
| 10 | stake_ | Pubkey |
| 11 | token_ | Pubkey |
| 12 | operational_ | Pubkey |
| 13 | system_ | Pubkey |
| 14… | remaining | Vec< |
WithdrawStakeAccount#
Discriminator d355b841b7b1e9d9 · data WithdrawStakeAccount · accounts WithdrawStakeAccountInstructionAccounts.
| Field | Type |
|---|---|
stake_index | u32 |
validator_ | u32 |
msol_amount | u64 |
beneficiary | Pubkey |
Required accounts: 16; extras go to remaining.
Fields of WithdrawStakeAccountInstructionAccounts, in account order:
| # | Field | Type |
|---|---|---|
| 0 | state | Pubkey |
| 1 | msol_mint | Pubkey |
| 2 | burn_ | Pubkey |
| 3 | burn_ | Pubkey |
| 4 | treasury_ | Pubkey |
| 5 | validator_ | Pubkey |
| 6 | stake_list | Pubkey |
| 7 | stake_ | Pubkey |
| 8 | stake_ | Pubkey |
| 9 | stake_ | Pubkey |
| 10 | split_ | Pubkey |
| 11 | split_ | Pubkey |
| 12 | clock | Pubkey |
| 13 | system_ | Pubkey |
| 14 | token_ | Pubkey |
| 15 | stake_ | Pubkey |
| 16… | 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 MarinadeFinanceAccount. Each wraps a boxed struct from carbon_. decode_ only considers accounts owned by PROGRAM_ID and returns the first variant that matches.
State#
Discriminator d8926b5e684bb6b1 · accounts::.
| Field | Type | Description |
|---|---|---|
msol_mint | Pubkey | |
admin_ | Pubkey | |
operational_ | Pubkey | |
treasury_ | Pubkey | |
reserve_ | u8 | |
msol_ | u8 | |
rent_ | u64 | |
reward_fee | Fee | |
stake_ | StakeSystem | |
validator_ | ValidatorSystem | |
liq_pool | LiqPool | |
available_ | u64 | |
msol_supply | u64 | |
msol_price | u64 | |
circulating_ | u64 | count tickets for delayed-unstake |
circulating_ | u64 | total lamports amount of generated and not claimed yet tickets |
lent_ | u64 | |
min_deposit | u64 | |
min_ | u64 | |
staking_ | u64 | |
emergency_ | u64 | |
pause_ | Pubkey | emergency pause |
paused | bool | |
delayed_ | FeeCents | |
withdraw_ | FeeCents | |
withdraw_ | bool | |
last_ | u64 | |
stake_moved | u64 | |
max_ | Fee |
TicketAccountData#
Discriminator 854d1262d301e703 · accounts::.
| Field | Type |
|---|---|
state_ | Pubkey |
beneficiary | Pubkey |
lamports_ | u64 |
created_ | u64 |
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.
ChangeAuthorityEvent#
Discriminator e46f2318bb4ee08a · events::.
| Field | Type |
|---|---|
state | Pubkey |
admin_ | Option< |
validator_ | Option< |
operational_ | Option< |
treasury_ | Option< |
pause_ | Option< |
ConfigLpEvent#
Discriminator 9fccc08a4491e094 · events::.
| Field | Type |
|---|---|
state | Pubkey |
min_ | Option< |
max_ | Option< |
liquidity_ | Option< |
treasury_ | Option< |
ConfigMarinadeEvent#
Discriminator 9fa4f5725efd0309 · events::.
| Field | Type |
|---|---|
state | Pubkey |
rewards_ | Option< |
slots_ | Option< |
min_ | Option< |
min_ | Option< |
min_ | Option< |
staking_ | Option< |
liquidity_ | Option< |
withdraw_ | Option< |
delayed_ | Option< |
withdraw_ | Option< |
max_ | Option< |
InitializeEvent#
Discriminator ceafa9d0f1d223dd · events::.
| Field | Type |
|---|---|
state | Pubkey |
params | InitializeData |
stake_list | Pubkey |
validator_ | Pubkey |
msol_mint | Pubkey |
operational_ | Pubkey |
lp_mint | Pubkey |
lp_msol_leg | Pubkey |
treasury_ | Pubkey |
EmergencyPauseEvent#
Discriminator 9ff1c0e81dd03315 · events::.
| Field | Type |
|---|---|
state | Pubkey |
ResumeEvent#
Discriminator 6175b77375e008e5 · events::.
| Field | Type |
|---|---|
state | Pubkey |
ReallocValidatorListEvent#
Discriminator 46bff2a4389c820d · events::.
| Field | Type |
|---|---|
state | Pubkey |
count | u32 |
new_ | u32 |
ReallocStakeListEvent#
Discriminator c18110f3b183f817 · events::.
| Field | Type |
|---|---|
state | Pubkey |
count | u32 |
new_ | u32 |
DeactivateStakeEvent#
Discriminator 0236b8da4eb5a375 · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake_index | u32 |
stake_ | Pubkey |
last_ | u64 |
split_ | Option< |
validator_ | u32 |
validator_ | Pubkey |
total_ | u64 |
validator_ | u64 |
total_ | u64 |
delayed_ | u64 |
validator_ | u64 |
total_ | u64 |
unstaked_ | u64 |
MergeStakesEvent#
Discriminator 499c45e9200e9641 · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
destination_ | u32 |
destination_ | Pubkey |
last_ | u64 |
source_ | u32 |
source_ | Pubkey |
last_ | u64 |
validator_ | u32 |
validator_ | Pubkey |
extra_ | u64 |
returned_ | u64 |
validator_ | u64 |
total_ | u64 |
operational_ | u64 |
RedelegateEvent#
Discriminator f14b87adccd74843 · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake_index | u32 |
stake_ | Pubkey |
last_ | u64 |
source_ | u32 |
source_ | Pubkey |
source_ | u32 |
source_ | u64 |
source_ | u64 |
dest_ | u32 |
dest_ | Pubkey |
dest_ | u32 |
dest_ | u64 |
dest_ | u64 |
redelegate_ | u64 |
split_ | Option< |
redelegate_ | u32 |
redelegate_ | Pubkey |
StakeReserveEvent#
Discriminator 707595b94d77be6a · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake_index | u32 |
stake_ | Pubkey |
validator_ | u32 |
validator_ | Pubkey |
total_ | u64 |
validator_ | u64 |
reserve_ | u64 |
total_ | u64 |
validator_ | u64 |
total_ | u64 |
amount | u64 |
UpdateActiveEvent#
Discriminator fb12804bd050ae8c · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake_index | u32 |
stake_ | Pubkey |
validator_ | u32 |
validator_ | Pubkey |
delegation_ | U64ValueChange |
delegation_ | Option<u64> |
extra_ | u64 |
extra_ | Option<u64> |
validator_ | u64 |
total_ | u64 |
msol_ | U64ValueChange |
reward_ | Fee |
total_ | u64 |
msol_supply | u64 |
UpdateDeactivatedEvent#
Discriminator fc9fb193b671ba5e · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake_index | u32 |
stake_ | Pubkey |
balance_ | u64 |
last_ | u64 |
msol_fees | Option<u64> |
msol_ | U64ValueChange |
reward_ | Fee |
operational_ | u64 |
total_ | u64 |
msol_supply | u64 |
ClaimEvent#
Discriminator 5d0f46aa308cd4db · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
ticket | Pubkey |
beneficiary | Pubkey |
circulating_ | u64 |
circulating_ | u64 |
reserve_ | u64 |
user_ | u64 |
amount | u64 |
OrderUnstakeEvent#
Discriminator e43f9bf984a08771 · events::.
| Field | Type |
|---|---|
state | Pubkey |
ticket_ | u64 |
ticket | Pubkey |
beneficiary | Pubkey |
circulating_ | u64 |
circulating_ | u64 |
user_ | u64 |
burned_ | u64 |
sol_amount | u64 |
fee_ | u32 |
total_ | u64 |
msol_supply | u64 |
AddLiquidityEvent#
Discriminator 1bb299ba2fc48c2d · events::.
| Field | Type |
|---|---|
state | Pubkey |
sol_owner | Pubkey |
user_ | u64 |
user_ | u64 |
sol_ | u64 |
lp_supply | u64 |
sol_ | u64 |
lp_minted | u64 |
total_ | u64 |
msol_supply | u64 |
LiquidUnstakeEvent#
Discriminator ad05930f050ec274 · events::.
| Field | Type |
|---|---|
state | Pubkey |
msol_owner | Pubkey |
liq_ | u64 |
liq_ | u64 |
treasury_ | Option<u64> |
user_ | u64 |
user_ | u64 |
msol_amount | u64 |
msol_fee | u64 |
treasury_ | u64 |
sol_amount | u64 |
lp_ | u64 |
lp_max_fee | Fee |
lp_min_fee | Fee |
treasury_ | Fee |
RemoveLiquidityEvent#
Discriminator 8dc7b67b9f5ed766 · events::.
| Field | Type |
|---|---|
state | Pubkey |
sol_ | u64 |
msol_ | u64 |
user_ | u64 |
user_ | u64 |
user_ | u64 |
lp_ | u64 |
lp_burned | u64 |
sol_ | u64 |
msol_ | u64 |
AddValidatorEvent#
Discriminator bee7aaf40ee38142 · events::.
| Field | Type |
|---|---|
state | Pubkey |
validator | Pubkey |
index | u32 |
score | u32 |
RemoveValidatorEvent#
Discriminator 43a4bec09c9ca8d2 · events::.
| Field | Type |
|---|---|
state | Pubkey |
validator | Pubkey |
index | u32 |
operational_ | u64 |
SetValidatorScoreEvent#
Discriminator 3a35edb2ee99559c · events::.
| Field | Type |
|---|---|
state | Pubkey |
validator | Pubkey |
index | u32 |
score_ | U32ValueChange |
DepositStakeAccountEvent#
Discriminator e7cb76604b7446e4 · events::.
| Field | Type |
|---|---|
state | Pubkey |
stake | Pubkey |
delegated | u64 |
withdrawer | Pubkey |
stake_index | u32 |
validator | Pubkey |
validator_ | u32 |
validator_ | u64 |
total_ | u64 |
user_ | u64 |
msol_minted | u64 |
total_ | u64 |
msol_supply | u64 |
DepositEvent#
Discriminator 78f83d531f8e6b90 · events::.
| Field | Type |
|---|---|
state | Pubkey |
sol_owner | Pubkey |
user_ | u64 |
user_ | u64 |
sol_ | u64 |
msol_ | u64 |
reserve_ | u64 |
sol_swapped | u64 |
msol_ | u64 |
sol_ | u64 |
msol_minted | u64 |
total_ | u64 |
msol_supply | u64 |
WithdrawStakeAccountEvent#
Discriminator 83ee27301e1ba51c · events::.
| Field | Type |
|---|---|
state | Pubkey |
epoch | u64 |
stake | Pubkey |
last_ | u64 |
stake_index | u32 |
validator | Pubkey |
validator_ | u32 |
user_ | u64 |
user_ | Pubkey |
msol_burned | u64 |
msol_fees | u64 |
split_stake | Pubkey |
beneficiary | Pubkey |
split_ | u64 |
fee_ | u32 |
total_ | u64 |
msol_supply | u64 |
Types#
Types used by the instructions, accounts and events above, exported from carbon_.
AddLiquidityEvent#
Struct types::. Same fields as the AddLiquidityEvent event.
AddValidatorEvent#
Struct types::. Same fields as the AddValidatorEvent event.
BoolValueChange#
Struct types::.
| Field | Type |
|---|---|
old | bool |
new | bool |
ChangeAuthorityData#
Struct types::.
| Field | Type |
|---|---|
admin | Option< |
validator_ | Option< |
operational_ | Option< |
treasury_ | Option< |
pause_ | Option< |
ChangeAuthorityEvent#
Struct types::. Same fields as the ChangeAuthorityEvent event.
ClaimEvent#
Struct types::. Same fields as the ClaimEvent event.
ConfigLpEvent#
Struct types::. Same fields as the ConfigLpEvent event.
ConfigLpParams#
Struct types::.
| Field | Type |
|---|---|
min_fee | Option<Fee> |
max_fee | Option<Fee> |
liquidity_ | Option<u64> |
treasury_ | Option<Fee> |
ConfigMarinadeEvent#
Struct types::. Same fields as the ConfigMarinadeEvent event.
ConfigMarinadeParams#
Struct types::.
| Field | Type |
|---|---|
rewards_fee | Option<Fee> |
slots_ | Option<u64> |
min_stake | Option<u64> |
min_deposit | Option<u64> |
min_ | Option<u64> |
staking_ | Option<u64> |
liquidity_ | Option<u64> |
withdraw_ | Option< |
delayed_ | Option< |
withdraw_ | Option< |
max_ | Option<Fee> |
DeactivateStakeEvent#
Struct types::. Same fields as the DeactivateStakeEvent event.
DepositEvent#
Struct types::. Same fields as the DepositEvent event.
DepositStakeAccountEvent#
Struct types::. Same fields as the DepositStakeAccountEvent event.
EmergencyPauseEvent#
Struct types::. Same fields as the EmergencyPauseEvent event.
Fee#
Struct types::Fee.
| Field | Type |
|---|---|
basis_ | u32 |
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::.
| Field | Type |
|---|---|
bp_cents | u32 |
FeeCentsValueChange#
Struct types::.
FeeValueChange#
Struct types::.
InitializeData#
Struct types::.
| Field | Type |
|---|---|
admin_ | Pubkey |
validator_ | Pubkey |
min_stake | u64 |
rewards_fee | Fee |
liq_pool | LiqPoolInitializeData |
additional_ | u32 |
additional_ | u32 |
slots_ | u64 |
pause_ | Pubkey |
InitializeEvent#
Struct types::. Same fields as the InitializeEvent event.
LiqPool#
Struct types::.
| Field | Type | Description |
|---|---|---|
lp_mint | Pubkey | |
lp_ | u8 | |
sol_ | u8 | |
msol_ | u8 | |
msol_leg | Pubkey | |
lp_ | u64 | Liquidity target. If the Liquidity reach this amount, the fee reaches lp_min_discount_fee |
lp_max_fee | Fee | Liquidity pool max fee |
lp_min_fee | Fee | SOL/mSOL Liquidity pool min fee |
treasury_ | Fee | Treasury cut |
lp_supply | u64 | |
lent_ | u64 | |
liquidity_ | u64 |
LiqPoolInitializeData#
Struct types::.
LiquidUnstakeEvent#
Struct types::. Same fields as the LiquidUnstakeEvent event.
List#
Struct types::List.
| Field | Type |
|---|---|
account | Pubkey |
item_size | u32 |
count | u32 |
reserved1 | Pubkey |
reserved2 | u32 |
MergeStakesEvent#
Struct types::. Same fields as the MergeStakesEvent event.
OrderUnstakeEvent#
Struct types::. Same fields as the OrderUnstakeEvent event.
PubkeyValueChange#
Struct types::.
| Field | Type |
|---|---|
old | Pubkey |
new | Pubkey |
ReallocStakeListEvent#
Struct types::. Same fields as the ReallocStakeListEvent event.
ReallocValidatorListEvent#
Struct types::. Same fields as the ReallocValidatorListEvent event.
RedelegateEvent#
Struct types::. Same fields as the RedelegateEvent event.
RemoveLiquidityEvent#
Struct types::. Same fields as the RemoveLiquidityEvent event.
RemoveValidatorEvent#
Struct types::. Same fields as the RemoveValidatorEvent event.
ResumeEvent#
Struct types::. Same fields as the ResumeEvent event.
SetValidatorScoreEvent#
Struct types::. Same fields as the SetValidatorScoreEvent event.
SplitStakeAccountInfo#
Struct types::.
| Field | Type |
|---|---|
account | Pubkey |
index | u32 |
StakeList#
Struct types::.
No fields.
StakeRecord#
Struct types::.
| Field | Type |
|---|---|
stake_ | Pubkey |
last_ | u64 |
last_ | u64 |
is_ | u8 |
StakeReserveEvent#
Struct types::. Same fields as the StakeReserveEvent event.
StakeSystem#
Struct types::.
| Field | Type | Description |
|---|---|---|
stake_list | List | |
delayed_ | u64 | |
stake_ | u8 | |
stake_ | u8 | |
slots_ | u64 | set by admin, how much slots before the end of the epoch, stake-delta can start |
last_ | u64 | Marks 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_stake | u64 | |
extra_ | u32 | can 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::.
| Field | Type |
|---|---|
old | u32 |
new | u32 |
U64ValueChange#
Struct types::.
| Field | Type |
|---|---|
old | u64 |
new | u64 |
UpdateActiveEvent#
Struct types::. Same fields as the UpdateActiveEvent event.
UpdateDeactivatedEvent#
Struct types::. Same fields as the UpdateDeactivatedEvent event.
ValidatorList#
Struct types::.
No fields.
ValidatorRecord#
Struct types::.
| Field | Type | Description |
|---|---|---|
validator_ | Pubkey | Validator vote pubkey |
active_ | u64 | Validator total balance in lamports |
score | u32 | |
last_ | u64 | |
duplication_ | u8 |
ValidatorSystem#
Struct types::.
| Field | Type | Description |
|---|---|---|
validator_ | List | |
manager_ | Pubkey | |
total_ | u32 | |
total_ | u64 | sum of all active lamports staked |
auto_ | u8 | DEPRECATED, no longer used |
WithdrawStakeAccountEvent#
Struct types::. Same fields as the WithdrawStakeAccountEvent event.