Skip to content

FundFlowController: Chainlink Vault Deposits and Unbonding

The FundFlowController manages deposits and withdrawals for Chainlink staking vaults in the OperatorVCS and CommunityVCS. Specifically, it calculates vault deposit/withdrawal order, calculates the current state of accounting across vault groups, and periodically unbonds vaults in the Chainlink staking contract to ensure there are always funds available to withdraw.

Returns the address of the Operator VCS

function operatorVCS() public view returns (address)
Name Type Description
operatorVCS address Address of Operator VCS

Returns the address of the Community VCS

function communityVCS() public view returns (address)
Name Type Description
communityVCS address Address of Community VCS

Returns the duration of the unbonding period in the Chainlink staking contract

function unbondingPeriod() public view returns (uint64)
Name Type Description
unbondingPeriod uint64 Unbonding period

Returns the duration of the claim period in the Chainlink staking contract

function claimPeriod() public view returns (uint64)
Name Type Description
claimPeriod uint64 Claim period

Returns the total number of vault groups

function numVaultGroups() public view returns (uint64)
Name Type Description
numVaultGroups uint64 Number of vault groups

Returns the index of current unbonded vault group

function curUnbondedVaultGroup() public view returns (uint64)
Name Type Description
curUnbondedVaultGroup uint64 Current unbonded vault group

Returns the time that a vault group was last unbonded

function timeOfLastUpdateByGroup() public view returns (uint64)
Name Type Description
vaultGroup uint64 Index of vault group
Name Type Description
timeOfLastUpdate uint64 Time of last update for selected group

Returns encoded vault deposit order for each strategy

Return data should be passed to the priority pool when depositing into the staking pool

function getDepositData(uint256 _toDeposit) external view returns (bytes[])
Name Type Description
_toDeposit uint256 amount to deposit
Name Type Description
depositData bytes[] list of encoded vault deposit data

Returns encoded vault withdrawal order for each strategy

Return data should be passed to the priority pool when withdrawing from the staking pool

function getWithdrawalData(uint256 _toWithdraw) external view returns (bytes[])
Name Type Description
_toWithdraw uint256 amount to withdraw
Name Type Description
withdrawalData bytes[] list of encoded vault withdrawal data

Returns whether claim period is active

Funds can only be withdrawn while the claim period is active

function claimPeriodActive() external view returns (bool)
Name Type Description
isActive bool true if claim period is active, false otherwise

Returns whether vault groups should be updated.

function shouldUpdateVaultGroups() external view returns (bool)
Name Type Description
shouldUpdate bool true if vault groups should be updated, false otherwise

Executes a vault group update

Re-unbonds all vaults in the current vault group and increments the current vault group
to the next one which will have just entered the claim period
an update is needed once per claim period right after the claim period expires for the
current vault group

function updateVaultGroups() external

Calculates and updates totalDepositRoom and totalUnbonded for a list of operator vault groups

Used to correct minor accounting errors that result from the removal or slashing
of operators in the Chainlink staking contract

function updateOperatorVaultGroupAccounting(uint256[] _vaultGroups) external
Name Type Description
_vaultGroups uint256[] list of vault groups

Delegates to an address for a group of vaults.

function delegateVaults(address[] _vaults, address _to, bytes32 _rights, bool _enable) external
Name Type Description
_vaults address[] List of vault addresses
_to address Address to delegate to
_rights bytes32 Rights to grant
_enable bool Whether to enable or revoke delegation

Withdraws non-LINK token rewards from a group of vaults.

function withdrawTokenRewards(address[] _vaults, address[] _tokens) external
Name Type Description
_vaults address[] List of vault addresses
_tokens address[] List of tokens to withdraw

Sets the address of reward receiver for non-LINK vault rewards.

function setNonLINKRewardReceiver(address _nonLINKRewardReceiver) external
Name Type Description
_nonLINKRewardReceiver address Address of reward receiver