Total Controlled ETH

Summary

  • The total amount of ETH controlled by the protocol, including principal, accumulated rewards, and unclaimed unstake requests.

  • Requires a sum of various contracts and beacon chain information provided by the Oracle.

Calculation

```solidity
/// @notice The total amount of ETH controlled by the protocol.
/// @dev Sums over the balances of various contracts and the beacon chain information from the oracle.
    function totalControlled() public view returns (uint256) {
        OracleRecord memory record = oracle.latestRecord();
        uint256 total = 0;
        total += unallocatedETH;
        total += allocatedETHForDeposits;
        /// The total ETH deposited to the beacon chain must be decreased by the deposits processed by the off-chain
        /// oracle since it will be accounted for in the currentTotalValidatorBalance from that point onwards.
        total += totalDepositedInValidators - record.cumulativeProcessedDepositAmount;
        total += record.currentTotalValidatorBalance;
        total += unstakeRequestsManager.balance();
        return total;
    }
```

See Staking.sol line #574

```solidity
    /// @inheritdoc IUnstakeRequestsManagerRead
    /// @dev The difference between allocatedETHForClaims and totalClaimed represents the amount of ether waiting to be
    /// claimed.
    function balance() external view returns (uint256) {
        if (allocatedETHForClaims > totalClaimed) {
            return allocatedETHForClaims - totalClaimed;
        }
        return 0;
    }
```

See UnstakeRequestsManager.sol line #356

Note

  • DepositedInValidators - ProcessedDepositAmount tracks the amount that has left the staking contract but yet to appear on the Beacon Chain.

staking.totalControlled()

staking.unallocatedETH()

staking.allocatedETHForDeposits()

staking.totalDepositedinValidators()

oracle.latestRecord(cumulativeProcessedDepositAmount), 8th value

oracle.latestRecord(currentTotalValidatorBalance), 7th value

unstakeRequestsManager.balance()

unstakeRequestsManager.allocatedETHForClaims()

unstakeRequestsManager.totalClaimed()

Last updated