Skip to content

Commit

Permalink
Document rebalancing
Browse files Browse the repository at this point in the history
  • Loading branch information
lykhonis committed Jan 22, 2024
1 parent 3fbc387 commit 038348f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pool/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,16 @@ contract Vault is OwnableUnset, ReentrancyGuardUpgradeable, PausableUpgradeable
emit FeeClaimed(account, beneficiary, amount);
}

// Rebalance the vault by accounting balance of the vault.
// This is called periodically by the oracle.
// The balance of the vault is the sum of:
// - totalStaked + totalUnstaked: the total amount of stake on beacon chain and execution layer
// - totalPendingWithdrawal: the total amount of pending withdrawals
// - totalClaimable: the total amount of pending withdrawals that can be claimed immidiately
// - totalFees: the total amount of fees available for withdrawal
//
// Rebalancing is not accounting for potential validator penalties. It is assumed that the penalties
// shall not occur or shall be negligible.
function rebalance() external onlyOracle whenNotPaused {
uint256 unstaked = address(this).balance;
uint256 staked = totalStaked;
Expand Down

0 comments on commit 038348f

Please sign in to comment.