Staking and Delegation
Last updated
Last updated
Please view the docs for how to use leap wallet.
This document provides several diagrams to help users and BVS developers understand SatLayer core contracts' common user workflow.
Undelegating from an Operator automatically queues a withdrawal that needs to go through the DelegationManager's withdrawal delay. Stakers that want to withdraw can choose to undelegate, or can simply call queueWithdrawals directly.
This flow is mostly useful if a Staker wants to change which Operator they are delegated to. The Staker first needs to undelegate (see above). At this point, they can delegate to a different Operator. However, the new Operator will only be awarded shares once the Staker completes their queued withdrawal as shares
:
DelegationManager is responsible for managing the delegation relationship between users and operators. Users can register as operators, delegate tokens, undelegate, and request and receive withdrawals. The Delegation Manager ensures the secure and efficient flow of tokens by controlling and recording delegation operations.
RewardCoordinator is responsible for ensuring the correct distribution of rewards. It coordinates the process of uploading, calculating, distributing, and claiming rewards through the following steps:
BVS program uploads rewards
Off-chain calculation logic
Upload reward distribution (via reward Merkle tree)
Users claim rewards
Strategy consists of StrategyManager, StrategyFactory, StrategyBase and StrategyBaseTVLLimits.
Strategy Manager is responsible for managing the deposit and withdrawal of tokens, as well as allocating tokens to specific strategies and operators. It acts as a bridge between liquidity providers and operators within the system.
Strategy Manager manages the flow of tokens through a series of functions. Users can obtain corresponding shares by depositing tokens and allocate these shares to specific strategies and operators. Additionally, users can convert shares back into tokens through withdrawal operations. Strict permission controls ensure the security and stability of the system.
Any CW20-compatible token can be supported by deploying a StrategyBaseTVLLimits
instance from the StrategyFactory
. The StrategyFactory
only allows a strategy to be deployed once per token, and automatically whitelists newly-deployed strategies.
Each supported token has its own instance of StrategyBaseTVLLimits
, has two main functions (deposit and withdraw), both of which can only be called by the StrategyManager. These StrategyBaseTVLLimits
contracts are fairly simple deposit/withdraw contracts that hold tokens deposited by Stakers.