Polygon Strategy
PolygonStrategy is a staking strategy that manages multiple PolygonVault contracts by tracking the balance of each and moving tokens in and out of them.
View Functions
token
Returns the address of the staking token (POL).
function token() public view returns (address)Return Values
token
address
POL token address
stakingPool
Returns the address of the staking pool that controls this strategy.
function stakingPool() public view returns (address)Return Values
stakingPool
address
Staking pool address
stakeManager
Returns the address of the Polygon stake manager contract.
Return Values
stakeManager
address
Stake manager address
fundFlowController
Returns the address of the fund flow controller contract.
Return Values
fundFlowController
address
Fund flow controller address
validatorMEVRewardsPool
Returns the address of the MEV rewards pool contract.
Return Values
validatorMEVRewardsPool
address
MEV rewards pool address
validatorMEVRewardsPercentage
Returns the percentage of MEV rewards validators will receive (basis points).
Return Values
validatorMEVRewardsPercentage
uint256
Validator MEV rewards %
vaultImplementation
Returns the address of the vault implementation contract.
Return Values
vaultImplementation
address
Vault implementation address
validatorRemoval
Returns the current validator removal state.
Return Values
isActive
bool
If removal is active
validatorId
uint64
Validator ID
queuedWithdrawals
uint128
Queued withdrawals
totalQueued
Returns the total number of tokens queued for deposit into vaults.
Return Values
totalQueued
uint256
Total queued tokens
numVaultsUnbonding
Returns the total number of vaults currently unbonding.
Return Values
numVaultsUnbonding
uint256
Number of vaults unbonding
validatorWithdrawalIndex
Returns the index of validator to withdraw from on next withdrawal.
Return Values
validatorWithdrawalIndex
uint256
Validator withdrawal index
canDeposit
Returns the available deposit room for this strategy.
Return Values
canDeposit
uint256
Available deposit room
canWithdraw
Returns the available withdrawal room for this strategy.
Return Values
canWithdraw
uint256
Available withdrawal room
getTotalDeposits
Returns the total amount of deposits in this strategy.
Return Values
totalDeposits
uint256
Total deposits
getMaxDeposits
Returns the maximum that can be deposited into this strategy.
Return Values
maxDeposits
uint256
Maximum deposits
getMinDeposits
Returns the minimum that must remain in this strategy.
Return Values
minDeposits
uint256
Minimum deposits
getValidators
Returns a list of all validators.
Return Values
validators
Validator[]
List of validators
getVaults
Returns a list of all vaults controlled by this contract.
Return Values
vaults
IPolygonVault[]
List of vaults
getDepositChange
Returns the deposit change since deposits were last updated.
Return Values
depositChange
int
Change in total deposits
getFees
Returns a list of all fees and fee receivers.
Return Values
fees
Fee[]
List of fees
staked
Returns whether an account should receive validator rewards (used by the validator MEV rewards pool).
Parameters
_account
address
Account address
Return Values
staked
uint256
1 if eligible, 0 otherwise
totalStaked
Returns the total number of active validators (used by the validator MEV rewards pool).
Return Values
totalStaked
uint256
Number of validators
Write Functions
deposit
Deposits tokens from the staking pool into this strategy.
Parameters
_amount
uint256
Amount to deposit
withdraw
Withdraws tokens from this strategy and sends them to staking pool.
Parameters
_amount
uint256
Amount to withdraw
depositQueuedTokens
Deposits queued tokens into vaults.
Parameters
_vaultIds
uint256[]
List of vault IDs
_amounts
uint256[]
Amounts to deposit per vault
unbond
Unbonds token deposits in vaults.
Parameters
_toUnbond
uint256
Amount to unbond
forceUnbond
Unbonds token deposits in vaults (used to rebalance between vaults).
Parameters
_vaultIds
uint256[]
List of vault IDs
_amounts
uint256[]
Amounts to unbond per vault
unstakeClaim
Claims and withdraws tokens from vaults that are unbonded.
Parameters
_vaultIds
uint256[]
List of vault IDs
updateDeposits
Updates deposit accounting and calculates fees on newly earned rewards.
Return Values
depositChange
int256
Change in deposits since last update
receivers
address[]
List of fee receivers
amounts
uint256[]
List of fee amounts
restakeRewards
Restakes rewards in the polygon staking contract for given vaults.
Parameters
_vaultIds
uint256[]
List of vault IDs
addValidator
Adds a new validator.
Parameters
_pool
address
Validator shares pool address
_rewardsReceiver
address
Validator MEV rewards receiver
queueValidatorRemoval
Queues a validator for removal.
Parameters
_validatorId
uint256
Validator ID
finalizeValidatorRemoval
Finalizes a queued validator removal.
upgradeVaults
Upgrades vaults to a new implementation contract.
Parameters
_vaults
address[]
List of vault addresses
_data
bytes[]
Encoded function calls per vault
addFee
Adds a new fee.
Parameters
_receiver
address
Fee receiver address
_feeBasisPoints
uint256
Fee in basis points
updateFee
Updates an existing fee.
Parameters
_index
uint256
Fee index
_receiver
address
Fee receiver address
_feeBasisPoints
uint256
Fee in basis points
setValidatorMEVRewardsPool
Sets the validator MEV rewards pool.
Parameters
_validatorMEVRewardsPool
address
MEV rewards pool address
setValidatorMEVRewardsPercentage
Sets the percentage of MEV rewards that validators receive.
Parameters
_validatorMEVRewardsPercentage
uint256
Validator MEV rewards %
setVaultImplementation
Sets a new vault implementation contract to be used when deploying/upgrading vaults.
Parameters
_vaultImplementation
address
Vault implementation address
setFundFlowController
Sets the fund flow controller.
Parameters
_fundFlowController
address
Fund flow controller address
Last updated