Hub
Last updated
Last updated
The Hub contract acts as the central hub for all minted stSei. Native Sei tokens received from users are delegated from here, and undelegations from stSei unbond requests are also handled from this contract. Rewards generated from delegations are withdrawn to the Reward contract, later restaking to validators, and update exchange rate.
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Instantiates the stSei Hub contract. Adds a specified validator to whitelist and bonds the creator's initial Sei deposit. The creator's initial Sei deposit ensures the stSei supply always be a high enough value to prevent rounding errors in the stSei exchange rate calculation.
Can be called during a Cw20 token transfer when the Hub contract is the recipient. Allows the token transfer to execute a Receive Hook as a subsequent action within the same transaction.
Bonds sei by delegating the sei amount equally between validators from the registry and mints stSei tokens to the message sender. Requires native Sei tokens to be sent to Hub
.
The platform tries to distribute the stake evenly across all validators. Given a single delegation, the exact number of validators that will receive delegations and the amount that they will receive depends on the current distribution of stake. We take a sorted (ASC) list of validators, calculate the desired amount that each validator should have target_stake = (total delegated + delegation_amount) / num_validators
and begin adding stake up to the desired amount, starting from the validator with the least stake. The exact amount of a single delegation is calculated as target_stake - validator_stake
, and you'll have as many delegations as it takes to "drain" the delegation_amount.
Distributes Sei delegation rewards to stSei holders. Withdraws all accrued delegation rewards to the Reward Dispatcher
contract and requests the Reward
contract to update the global reward index value. Can be issued by the specific address .
Withdraws unbonded Sei. Requires an unbonding entry to have been made before the unbonding period.
Checks whether a slashing event occurred and updates state accordingly.
Updates parameter values of the Hub contract. Can only be issued by the creator.
Updates the Hub
contract configuration. Can only be issued by the creator.
A proxy handler to execute redelegations from Hub address.
Can only be executed by Validators Registry or by the owner of the Hub.
Bonds sei by delegating the sei amount equally between validators from the registry.
No stSei tokens have been minted.
Can only be executed by Rewards Dispatcher.
Requires native Sei tokens to be sent to Hub
.
Burns received stSei and equally unbonds a corresponding amount of Sei from a validator from the registry.
Gets the Hub
contract's configuration.
Gets information about the current undelegation batch.
Gets the amount of undelegated Sei that will be available for withdrawal (unbonding requests past the unbonding period) for the specified user.
Gets parameter information.
Gets the list of Sei unbonding amounts being unbonded for the specified user.
Gets the historical list of undelegation batch entries.
* = optional
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
Key | Type | Description |
---|---|---|
creator
CanonicalAddr
Address of contract creator
update_reward_index_addr
CanonicalAddr
The address allowed to call UpdateGlobalIndex
reward_dispatcher_contract
Option<CanonicalAddr>
Contract address of Rewards Dispatcher
validators_registry_contract
Option<CanonicalAddr>
Contract address of Validators Registry
bsei_token_contract
Option<CanonicalAddr>
Contract address of bSei's Cw20 token contract
stsei_token_contract
Option<CanonicalAddr>
Contract address of stSei's Cw20 token contract
rewards_contract
Option<CanonicalAddr>
Contract address of Reward
epoch_period
u64
Minimum time delay between undelegation batches [seconds]
underlying_coin_denom
String
Underlying asset denomination of stAsset (Sei)
unbonding_period
u64
Time required for the Hub contract to consider an undelegation batch to be fully undelegated (past the unbonding period) [seconds]
peg_recovery_fee
Decimal
Fee applied to stSei generation and redemption
er_threshold
Decimal
Minimum stSei exchange rate before peg recovery fee is applied
reward_denom
String
Native token denomination for distributed bSei rewards (kUSD)
paused
Option<bool>
The pause system operation switch to facilitate smooth contract upgrades and data migration
epoch_period
u64
Minimum time delay between undelegation batches [seconds]
underlying_coin_denom
String
Underlying asset denomination of stAsset (Sei)
unbonding_period
u64
Time required for the Hub contract to consider an undelegation batch to be fully undelegated (past the unbonding period) [seconds]
peg_recovery_fee
Decimal
Fee applied to stSei generation and redemption
er_threshold
Decimal
Minimum stSei exchange rate before peg recovery fee is applied
reward_denom
String
Native token denomination for distributed bSei rewards (kUSD)
update_reward_index_addr
String
The address allowed to call UpdateGlobalIndex
sender
String
Sender of token transfer
amount
Uint128
Amount of tokens received
msg
Binary
Base64-encoded string of JSON of Receive Hook
airdrop_hooks
Vec<Binary>
Not currently enabled
epoch_period
u64
Minimum time delay between undelegation batches [seconds]
unbonding_period
u64
Time required for the Hub contract to consider an undelegation batch to be fully undelegated (past the unbonding period) [seconds]
peg_recovery_fee
Decimal
Fee applied to stSei generation and redemption
et_threshold
Decimal
Minimum stSei exchange rate before peg recovery fee is applied
paused
bool
The pause system operation switch to facilitate smooth contract upgrades and data migration
reward_denom
String
Native token denomination for distributed bSei rewards (kUSD)
rewards_dispatcher_contract
String
Contract address of Rewards Dispatcher
validators_registry_contract
String
Contract address of Validators Registry
bsei_token_contract
String
Contract address of bSei's Cw20 token contract
stsei_token_contract
String
Contract address of stSei's Cw20 token contract
airdrop_registry_contract
String
Not currently enabled
rewards_contract
String
Contract address of Reward
update_reward_index_addr
String
The address allowed to call UpdateGlobalIndex
src_validator
String
Address of source vaildator in redelegation pair
redelegations
Vec<(String, Coin)>
List of(destination validator, redelegation amount)
owner
String
Address of the owner
update_reward_index_addr
String
The address allowed to call UpdateGlobalIndex
reward_dispatcher_contract
String
Contract address of Rewards Dispatcher
validators_registry_contract
String
Contract address of Validators Registry
bsei_token_contract
String
Contract address of bSei's Cw20 token contract
stsei_token_contract
String
Contract address of stSei's Cw20 token contract
airdrop_registry_contract
String
Not currently enabled
token_contract
String
Not currently enabled
bsei_exchange_rate
Decimal
Current bSei <> Sei exchange rate
stset_exchange_rate
Decimal
Current stSei <> Sei exchange rate
total_bond_bsei_amount
Uint128
Total amount of Sei currently bonded by Hub via bSei logic
total_bond_stsei_amount
Uint128
Total amount of Sei currently bonded by Hub via stSei logic
last_index_modification
u64
Unix block timestamp when the global reward index was last updated
prev_hub_balance
Uint128
Hub's sei balance when WithdrawUnbonded was lasted executed. Used to calcutate the actual amount of unbonded Sei
last_unbonded_time
u64
Unix block timestamp when a batch was last undelegated
last_processed_batch
u64
Batch ID of the most recently released batch
id
u64
Batch ID of the current undelegation batch
requested_bsei_with_fee
Uint128
Amount of (fee-applied)bSei requested for undelegation in this batch
requested_stsei
Uint128
Amount of stSei requested for undelegation in this batch
address
String
Address of user that previously unbonded Sei via redeeming bSei
withdrawable
Uint128
Amount of undelegated Sei availabe for withdrawal
epoch_period
u64
Minimum time delay between undelegation batches [seconds]
underlying_coin_denom
String
Underlying asset denomination of stAsset (Sei)
unbonding_period
u64
Time required for the Hub contract to consider an undelegation batch to be fully undelegated (past the unbonding period) [seconds]
peg_recovery_fee
Decimal
Fee applied to stSei generation and redemption
er_threshold
Decimal
Minimum stSei exchange rate before peg recovery fee is applied
reward_denom
String
Native token denomination for distributed bSei rewards (kUSD)
paused
Option<bool>
The pause system operation switch to facilitate smooth contract upgrades and data migration
address
String
Address of user that previously unbonded Sei by redeeming stSei
address
String
Address of user that requested to unbond stSei
requests
UnbondRequest
List of unbonding requests made by user
UnbondRequest
Vec<(u64, Uint128, Uint128)>
List of (batch ID, bSei unbond amount, stSei unbond amount)
start_from*
u64
Batch Id to start query
limit*
u32
Maximum number of query entries
history
Vec<UnbondHistoryResponse>
List of batch information
batch_id
u64
Batch ID
time
u64
Unix block timestamp when this batch was undelegated
bsei_amount
Uint128
(Fee-applied)amount of bSei unbonded in this batch
bsei_applied_exchange_rate
Decimal
bSei exchange rate at the time of batch undelegation
bsei_withdraw_rate
Decimal
Conversion rate applied when users later withdraw from this batch
stsei_amount
Uint128
(Fee-applied)amount of stSei unbonded in this batch
stsei_applied_exchange_rate
Decimal
stSei exchange rate at the time of batch undelegation
stsei_withdraw_rate
Decimal
Convertion rate applied when users later withdraw from this batch
released
bool
Indication on whether is batch is released(processed as fully undelegated by the contract)