Struct spl_stake_pool::state::StakePool
source · [−]#[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
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
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
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
sourceimpl StakePool
impl StakePool
sourcepub fn calc_pool_tokens_for_deposit(&self, stake_lamports: u64) -> Option<u64>
pub fn calc_pool_tokens_for_deposit(&self, stake_lamports: u64) -> Option<u64>
calculate the pool tokens that should be minted for a deposit of stake_lamports
sourcepub fn calc_lamports_withdraw_amount(&self, pool_tokens: u64) -> Option<u64>
pub fn calc_lamports_withdraw_amount(&self, pool_tokens: u64) -> Option<u64>
calculate lamports amount on withdrawal
sourcepub fn calc_pool_tokens_stake_withdrawal_fee(
&self,
pool_tokens: u64
) -> Option<u64>
pub fn calc_pool_tokens_stake_withdrawal_fee(
&self,
pool_tokens: u64
) -> Option<u64>
calculate pool tokens to be deducted as withdrawal fees
sourcepub fn calc_pool_tokens_sol_withdrawal_fee(
&self,
pool_tokens: u64
) -> Option<u64>
pub fn calc_pool_tokens_sol_withdrawal_fee(
&self,
pool_tokens: u64
) -> Option<u64>
calculate pool tokens to be deducted as withdrawal fees
sourcepub fn calc_pool_tokens_stake_deposit_fee(
&self,
pool_tokens_minted: u64
) -> Option<u64>
pub fn calc_pool_tokens_stake_deposit_fee(
&self,
pool_tokens_minted: u64
) -> Option<u64>
calculate pool tokens to be deducted as stake deposit fees
sourcepub fn calc_pool_tokens_stake_referral_fee(
&self,
stake_deposit_fee: u64
) -> Option<u64>
pub fn calc_pool_tokens_stake_referral_fee(
&self,
stake_deposit_fee: u64
) -> Option<u64>
calculate pool tokens to be deducted from deposit fees as referral fees
sourcepub fn calc_pool_tokens_sol_deposit_fee(
&self,
pool_tokens_minted: u64
) -> Option<u64>
pub fn calc_pool_tokens_sol_deposit_fee(
&self,
pool_tokens_minted: u64
) -> Option<u64>
calculate pool tokens to be deducted as SOL deposit fees
sourcepub fn calc_pool_tokens_sol_referral_fee(
&self,
sol_deposit_fee: u64
) -> Option<u64>
pub fn calc_pool_tokens_sol_referral_fee(
&self,
sol_deposit_fee: u64
) -> Option<u64>
calculate pool tokens to be deducted from SOL deposit fees as referral fees
sourcepub fn calc_epoch_fee_amount(&self, reward_lamports: u64) -> Option<u64>
pub fn calc_epoch_fee_amount(&self, reward_lamports: u64) -> Option<u64>
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
sourcepub fn check_validator_list(
&self,
validator_list_info: &AccountInfo<'_>
) -> Result<(), ProgramError>
pub fn check_validator_list(
&self,
validator_list_info: &AccountInfo<'_>
) -> Result<(), ProgramError>
Check the validator list is valid
sourcepub fn check_reserve_stake(
&self,
reserve_stake_info: &AccountInfo<'_>
) -> Result<(), ProgramError>
pub fn check_reserve_stake(
&self,
reserve_stake_info: &AccountInfo<'_>
) -> Result<(), ProgramError>
Check the reserve stake is valid
sourcepub fn is_uninitialized(&self) -> bool
pub fn is_uninitialized(&self) -> bool
Check if StakePool is currently uninitialized
sourcepub fn update_fee(&mut self, fee: &FeeType) -> Result<(), StakePoolError>
pub fn update_fee(&mut self, fee: &FeeType) -> Result<(), StakePoolError>
Updates one of the StakePool’s fees.
Trait Implementations
sourceimpl BorshDeserialize for StakePool where
AccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
Lockup: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
u8: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
u8: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
impl BorshDeserialize for StakePool where
AccountType: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u8: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
Pubkey: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
Lockup: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
u8: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
u8: BorshDeserialize,
Option<Pubkey>: BorshDeserialize,
Fee: BorshDeserialize,
Option<Fee>: BorshDeserialize,
u64: BorshDeserialize,
u64: BorshDeserialize,
sourceimpl BorshSchema for StakePool where
AccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u8: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
Lockup: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
Option<Pubkey>: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
u8: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
u8: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
impl BorshSchema for StakePool where
AccountType: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u8: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
Pubkey: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
Lockup: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
Option<Pubkey>: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
u8: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
u8: BorshSchema,
Option<Pubkey>: BorshSchema,
Fee: BorshSchema,
Option<Fee>: BorshSchema,
u64: BorshSchema,
u64: BorshSchema,
sourcefn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
sourcefn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
fn add_definitions_recursively(
definitions: &mut HashMap<Declaration, Definition>
)
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
sourcefn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
fn add_definition(
declaration: String,
definition: Definition,
definitions: &mut HashMap<String, Definition, RandomState>
)
Helper method to add a single type definition to the map.
fn schema_container() -> BorshSchemaContainer
sourceimpl BorshSerialize for StakePool where
AccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
Lockup: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
u8: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
u8: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
impl BorshSerialize for StakePool where
AccountType: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u8: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
Pubkey: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
Lockup: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
u8: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
u8: BorshSerialize,
Option<Pubkey>: BorshSerialize,
Fee: BorshSerialize,
Option<Fee>: BorshSerialize,
u64: BorshSerialize,
u64: BorshSerialize,
impl StructuralPartialEq for StakePool
Auto Trait Implementations
impl RefUnwindSafe for StakePool
impl Send for StakePool
impl Sync for StakePool
impl Unpin for StakePool
impl UnwindSafe for StakePool
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more