#[repr(C)]
pub struct StakePool {
Show 30 fields pub account_type: AccountType, pub manager: Pubkey, pub staker: Pubkey, pub stake_deposit_authority: Pubkey, pub stake_withdraw_bump_seed: u8, pub validator_list: Pubkey, pub reserve_stake: Pubkey, pub pool_mint: Pubkey, pub manager_fee_account: Pubkey, pub token_program_id: Pubkey, pub total_lamports: u64, pub pool_token_supply: u64, pub last_update_epoch: u64, pub lockup: Lockup, pub epoch_fee: Fee, pub next_epoch_fee: Option<Fee>, pub preferred_deposit_validator_vote_address: Option<Pubkey>, pub preferred_withdraw_validator_vote_address: Option<Pubkey>, pub stake_deposit_fee: Fee, pub stake_withdrawal_fee: Fee, pub next_stake_withdrawal_fee: Option<Fee>, pub stake_referral_fee: u8, pub sol_deposit_authority: Option<Pubkey>, pub sol_deposit_fee: Fee, pub sol_referral_fee: u8, pub sol_withdraw_authority: Option<Pubkey>, pub sol_withdrawal_fee: Fee, pub next_sol_withdrawal_fee: Option<Fee>, pub last_epoch_pool_token_supply: u64, pub last_epoch_total_lamports: u64,
}
Expand description

Initialized program details.

Fields

account_type: AccountType

Account type, must be StakePool currently

manager: Pubkey

Manager authority, allows for updating the staker, manager, and fee account

staker: Pubkey

Staker authority, allows for adding and removing validators, and managing stake distribution

stake_deposit_authority: Pubkey

Stake deposit authority

If a depositor pubkey is specified on initialization, then deposits must be signed by this authority. If no deposit authority is specified, then the stake pool will default to the result of: Pubkey::find_program_address( &[&stake_pool_address.to_bytes()[..32], b"deposit"], program_id, )

stake_withdraw_bump_seed: u8

Stake withdrawal authority bump seed for create_program_address(&[state::StakePool account, "withdrawal"])

validator_list: Pubkey

Validator stake list storage account

reserve_stake: Pubkey

Reserve stake account, holds deactivated stake

pool_mint: Pubkey

Pool Mint

manager_fee_account: Pubkey

Manager fee account

token_program_id: Pubkey

Pool token program id

total_lamports: u64

Total stake under management. Note that if last_update_epoch does not match the current epoch then this field may not be accurate

pool_token_supply: u64

Total supply of pool tokens (should always match the supply in the Pool Mint)

last_update_epoch: u64

Last epoch the total_lamports field was updated

lockup: Lockup

Lockup that all stakes in the pool must have

epoch_fee: Fee

Fee taken as a proportion of rewards each epoch

next_epoch_fee: Option<Fee>

Fee for next epoch

preferred_deposit_validator_vote_address: Option<Pubkey>

Preferred deposit validator vote account pubkey

preferred_withdraw_validator_vote_address: Option<Pubkey>

Preferred withdraw validator vote account pubkey

stake_deposit_fee: Fee

Fee assessed on stake deposits

stake_withdrawal_fee: Fee

Fee assessed on withdrawals

next_stake_withdrawal_fee: Option<Fee>

Future stake withdrawal fee, to be set for the following epoch

stake_referral_fee: u8

Fees paid out to referrers on referred stake deposits. Expressed as a percentage (0 - 100) of deposit fees. i.e. stake_deposit_fee% of stake deposited is collected as deposit fees for every deposit and stake_referral_fee% of the collected stake deposit fees is paid out to the referrer

sol_deposit_authority: Option<Pubkey>

Toggles whether the DepositSol instruction requires a signature from this sol_deposit_authority

sol_deposit_fee: Fee

Fee assessed on SOL deposits

sol_referral_fee: u8

Fees paid out to referrers on referred SOL deposits. Expressed as a percentage (0 - 100) of SOL deposit fees. i.e. sol_deposit_fee% of SOL deposited is collected as deposit fees for every deposit and sol_referral_fee% of the collected SOL deposit fees is paid out to the referrer

sol_withdraw_authority: Option<Pubkey>

Toggles whether the WithdrawSol instruction requires a signature from the deposit_authority

sol_withdrawal_fee: Fee

Fee assessed on SOL withdrawals

next_sol_withdrawal_fee: Option<Fee>

Future SOL withdrawal fee, to be set for the following epoch

last_epoch_pool_token_supply: u64

Last epoch’s total pool tokens, used only for APR estimation

last_epoch_total_lamports: u64

Last epoch’s total lamports, used only for APR estimation

Implementations

calculate the pool tokens that should be minted for a deposit of stake_lamports

calculate lamports amount on withdrawal

calculate pool tokens to be deducted as withdrawal fees

calculate pool tokens to be deducted as withdrawal fees

calculate pool tokens to be deducted as stake deposit fees

calculate pool tokens to be deducted from deposit fees as referral fees

calculate pool tokens to be deducted as SOL deposit fees

calculate pool tokens to be deducted from SOL deposit fees as referral fees

Calculate the fee in pool tokens that goes to the manager

This function assumes that reward_lamports has not already been added to the stake pool’s total_lamports

Check the validator list is valid

Check the reserve stake is valid

Check if StakePool is actually initialized as a stake pool

Check if StakePool is currently uninitialized

Updates one of the StakePool’s fees.

Trait Implementations

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes. Read more

Deserialize this instance from a slice of bytes.

Get the name of the type without brackets.

Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type. Read more

Helper method to add a single type definition to the map.

Serialize this instance into a vector of bytes.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.