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.
Config
Key
Type
Description
Parameters
Key
Type
Description
InitMsg
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 .
A proxy handler to execute redelegations from Hub address.
Can only be executed by Validators Registry or by the owner of the Hub.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]#[serde(rename_all ="snake_case")]pubenumExecuteMsg {RedelegateProxy {// delegator is automatically set to address of the calling contract src_validator:String, redelegations:Vec<(String, Coin)>, //(dst_validator, amount) },}
[Internal] BondRewards
Bonds sei by delegating the sei amount equally between validators from the registry.