Subnet Node Delegate Staking
Subnet nodes can be staked to for a portion of the nodes emissions. Each node can have its own delegate reward rate.
Add
Users can add balance to a subnet by calling add_to_node_delegate_stake
with the subnet ID and balance, they want to transfer to the subnet.
pub fn add_to_node_delegate_stake(
origin: OriginFor<T>,
subnet_id: u32,
subnet_node_id: u32,
node_delegate_stake_to_be_added: u128
)
Remove
Users can remove their node delegate stake balance by calling remove_node_delegate_stake
with the subnet ID and subnet node ID to remove from and the shares to remove. Shares are converted to balance internally.
pub fn remove_node_delegate_stake(
origin: OriginFor<T>,
subnet_id: u32,
subnet_node_id: u32,
node_delegate_stake_shares_to_be_removed: u128
)
Transfer
Users can transfer node delegate stake shares from one account to another by calling transfer_node_delegate_stake
with the subnet ID, subnet node ID, to account ID, and shares to transfer.
pub fn transfer_node_delegate_stake(
origin: OriginFor<T>,
subnet_id: u32,
subnet_node_id: u32,
to_account_id: T::AccountId,
node_delegate_stake_shares_to_transfer: u128
)
Swap
Users can swap node delegate stake between nodes by calling swap_node_delegate_stake
with the subnet ID and the subnet node ID, to remove stake from, and the subnet ID and subnet node ID to add stake to, with the shares they want to remove from the from_subnet_id
and from_subnet_node_id
.
pub fn swap_node_delegate_stake(
origin: OriginFor<T>,
from_subnet_id: u32,
from_subnet_node_id: u32,
to_subnet_id: u32,
to_subnet_node_id: u32,
node_delegate_stake_shares_to_swap: u128
)
Increase Node Delegate Stake
This functionality does NOT increase a user's balance.
Users can increase the overall delegate stake balance in the subnets pool by calling increase_node_delegate_stake
with the subnet ID nd subnet node ID they want to increase the pool balance of, and the amount to transfer to the subnet.
This will increase the balance of all current delegate stakers.
This function is useful for airdropping rewards to the subnet node delegate stakers.
pub fn increase_node_delegate_stake(
origin: OriginFor<T>,
subnet_id: u32,
subnet_node_id: u32,
amount: u128,
)
Last updated