Priority Pool
The PriorityPool
allows users to queue asset tokens which are eventually deposited into a StakingPool
when deposit room becomes available. The liquid staking tokens (LSTs) minted by the StakingPool
are then distributed using a merkle tree.
Each user will continuously receive LSTs as more depositd are made into the StakingPool
until they have received an amount equal to the amount of asset tokens they deposited into the PriorityPool
. The rate at which each user receives LSTs is dependent on the user's reSDL balance in the SDLPool
. A higher reSDL balance entitles the user to receive LSTs at a faster rate than a user with a smaller reSDL balance. Users that hold no reSDL can also deposit into the PriorityPool
but they will receive no LSTs as long as there are users with deposits in the PriorityPool
that also hold reSDL.
The secondary function of the PriorityPool
is to act as a liquidity buffer for the StakingPool
it deposits into. When a user redeems LSTs for the underlying asset token, these LSTs will be swapped with queued asset tokens from the PriorityPool
if possible before queuing tokens in the WithdrawalPool
. This both reduces gas costs for the user and ensures that the StakingPool
earns the most yield possible as yield earning asset tokens remain in the pool instead of being withdrawn.
View Functions
token
Returns the address of the token this pool handles
Return Values
stakingPool
Returns the address of the staking pool that this pool deposits into
Return Values
sdlPool
Returns the address of the SDL pool
Return Values
distributionOracle
Returns the address of the oracle that handles distribution of liquid staking tokens
Return Values
rebaseController
Returns the address of the rebase controller
Return Values
withdrawalPool
Returns the address of the withdrawal pool
Return Values
queueDepositMin
Returns the minimum amount of tokens required to execute a deposit
Return Values
queueDepositMax
Returns the maximum amount of tokens that can be deposited in a single deposit
Return Values
poolStatus
Returns the current status of the pool
0 - OPEN (nothing disabled) 1 - DRAINING (deposits disabled) 2 - CLOSED (deposits/withdrawals disabled)
Return Values
merkleRoot
Returns the merkle root for the latest distribution tree
Return Values
ipfsHash
Returns the ipfs hash of the balance data for the latest distribution tree
Return Values
merkleTreeSize
Returns the number of unique addresses contained in the latest distribution tree
Return Values
totalQueued
Returns the total amount of token deposits in the pool waiting to be deposited into the staking pool
Return Values
getAccounts
Returns a list of all accounts that have deposited into the pool in the order that they appear in the distribution tree
Return Values
getAccountIndex
Returns the index of an account representing it's position in the distribution tree
Parameters
Return Values
getQueuedTokens
Returns an account's current amount of deposits in the pool (_distributionAmount
is stored on IPFS)
Parameters
Return Values
getLSDTokens
Returns an account's current amount of withdrawable liquid staking tokens (_distributionShareAmount
is stored on IPFS)
Parameters
Return Values
canWithdraw
Returns the total amount of asset tokens that an account can withdraw (includes account's queued tokens and stLINK balance and takes into account both priority pool and staking pool liquidity)
Parameters
Return Values
checkUpkeep
Returns whether a call should be made to performUpkeep to deposit queued/unused tokens into staking pool strategies
Return Values
getDepositsSinceLastUpdate
Returns the amount of new deposits into the staking pool since the last call to updateDistribution and the amount of shares received for those deposits
Return Values
getAccountData
Returns account data used for calculating a new merkle tree
A new merkle tree is calculated based on users' reSDL balance and the number of tokens they have queued Accounts are returned in the same order as they are in the merkle tree
Return Values
Write Functions
onTokenTransfer
ERC677 implementation to receive a token deposit or withdrawal
Can receive both asset tokens (deposit) and liquid staking tokens (withdrawal)
Parameters
deposit
Deposits asset tokens into the staking pool and/or queues them
Parameters
withdraw
Withdraws asset tokens
Will unqueue sender's asset tokens before swapping liquid staking tokens if there is sufficient liquidity and _shouldUnqueue is set to true
Parameters
unqueueTokens
Withdraws queued deposits from the priority pool
Parameters
claimLSDTokens
Claims withdrawable liquid staking tokens
Parameters
depositQueuedTokens
Deposits queued tokens and/or unused tokens sitting in staking pool
Parameters
performUpkeep
Deposits queued and/or unused tokens
Parameters
updateDistribution
Distributes a new batch of liquid staking tokens to users that have queued deposits
Parameters
executeQueuedWithdrawals
Executes a batch of withdrawals that have been queued in the withdrawal pool
Withdraws tokens from the staking pool and sends them to the withdrawal pool
Parameters
pauseForUpdate
Pauses queueing and unqueueing so a new merkle tree can be generated
setPoolStatus
Sets the pool's status
Parameters
setPoolStatusClosed
Sets the pool's status to CLOSED
setQueueDepositParams
Sets the minimum and maximum amount that can be deposited into strategies at once
Parameters
setDistributionOracle
Sets the distribution oracle
Parameters
setRebaseController
Sets the rebase controller
This address has authorization to close the pool in case of emergency
Parameters
setWithdrawalPool
Sets the withdrawal pool
Parameters
Last updated