Module sui_system::staking_pool
- Struct
StakingPool
- Struct
PoolTokenExchangeRate
- Struct
StakedSui
- Struct
FungibleStakedSui
- Struct
FungibleStakedSuiData
- Struct
FungibleStakedSuiDataKey
- Struct
UnderflowSuiBalance
- Constants
- Function
new
- Function
request_add_stake
- Function
request_withdraw_stake
- Function
redeem_fungible_staked_sui
- Function
calculate_fungible_staked_sui_withdraw_amount
- Function
convert_to_fungible_staked_sui
- Function
withdraw_from_principal
- Function
unwrap_staked_sui
- Function
deposit_rewards
- Function
process_pending_stakes_and_withdraws
- Function
process_pending_stake_withdraw
- Function
process_pending_stake
- Function
withdraw_rewards
- Function
activate_staking_pool
- Function
deactivate_staking_pool
- Function
sui_balance
- Function
pool_id
- Function
fungible_staked_sui_pool_id
- Function
staked_sui_amount
- Function
stake_activation_epoch
- Function
is_preactive
- Function
activation_epoch
- Function
is_inactive
- Function
fungible_staked_sui_value
- Function
split_fungible_staked_sui
- Function
join_fungible_staked_sui
- Function
split
- Function
split_staked_sui
- Function
join_staked_sui
- Function
is_equal_staking_metadata
- Function
pool_token_exchange_rate_at_epoch
- Function
pending_stake_amount
- Function
pending_stake_withdraw_amount
- Function
exchange_rates
- Function
sui_amount
- Function
pool_token_amount
- Function
is_preactive_at_epoch
- Function
get_sui_amount
- Function
get_token_amount
- Function
initial_exchange_rate
- Function
check_balance_invariants
- Macro function
mul_div
- Function
calculate_rewards
use std::address;
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::type_name;
use std::u64;
use std::vector;
use sui::accumulator;
use sui::address;
use sui::bag;
use sui::balance;
use sui::coin;
use sui::config;
use sui::deny_list;
use sui::dynamic_field;
use sui::dynamic_object_field;
use sui::event;
use sui::funds_accumulator;
use sui::hex;
use sui::object;
use sui::party;
use sui::sui;
use sui::table;
use sui::transfer;
use sui::tx_context;
use sui::types;
use sui::url;
use sui::vec_map;
use sui::vec_set;
Struct StakingPool
A staking pool embedded in each validator struct in the system state object.
public struct StakingPool has key, store
Click to open
Fields
-
id: sui::object::UID
-
activation_epoch: std::option::Option<u64>
-
The epoch at which this pool became active.
The value is
None
if the pool is pre-active andSome(<epoch_number>)
if active or inactive. -
deactivation_epoch: std::option::Option<u64>
-
The epoch at which this staking pool ceased to be active.
None
= {pre-active, active},Some(<epoch_number>)
if in-active, and it was de-activated at epoch<epoch_number>
. -
sui_balance: u64
-
The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
in the
object, updated at epoch boundaries.StakedSui
-
rewards_pool: sui::balance::Balance<sui::sui::SUI>
- The epoch stake rewards will be added here at the end of each epoch.
-
pool_token_balance: u64
- Total number of pool tokens issued by the pool.
-
exchange_rates: sui::table::Table<u64, sui_system::staking_pool::PoolTokenExchangeRate>
-
Exchange rate history of previous epochs. Key is the epoch number.
The entries start from the
of this pool and contains exchange rates at the beginning of each epoch, i.e., right after the rewards for the previous epoch have been deposited into the pool.activation_epoch
-
pending_stake: u64
- Pending stake amount for this epoch, emptied at epoch boundaries.
-
pending_total_sui_withdraw: u64
- Pending stake withdrawn during the current epoch, emptied at epoch boundaries. This includes both the principal and rewards SUI withdrawn.
-
pending_pool_token_withdraw: u64
- Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
-
extra_fields: sui::bag::Bag
- Any extra fields that's not defined statically.