Byzantine Oracle
Last updated
Last updated
As ByzVaults are ERC4626 vaults they are required to properly calculate and know the totalAssets of the vault so that when users are depositing or withdrawing the value of the shares in relation to the assets is processed correctly. For Native ByzVaults, most of their assets are stored on the consensus layer. These assets, and the rewards that have been generated can not be easily retrieved by the Native ByzVault smart contract.
The Byzantine Oracle is an off chain Go program that updates the StakingOracle
contract with each vault's total valuation on a daily basis at 03:00 UTC. The vaults use this information to update its lastTotalValuation
, which is used for the vault's totalAssets
calculation. In this way, when totalAssets
is called, it returns a value that includes:
ETH on the ByzVault
ETH on the EigenPod (only applicable for EigenLayer vaults)
ETH on the consensus layer/beacon chain
The Byzantine Oracle program creates an internal state of all vaults created by the ByzantineFactory
contract. It then tracks all the validator's for a vault through it's validatorList
, which is updated when the validator manager adds a new validator with registerValidators
.
The program gets all of the required data at a specific block, which is the 'snapshot block'. Then, the updateOracleData
function is called by the oracleSubmitter
role. The function will at some point be processed and added into the 'report block'. As there is some time in between the snapshot block and report block, users may have deposited or completed a withdrawal in this time frame. In order to account for this, when the Oracle takes the snapshot it also stores the vault's inOutTracker
value. Then, when the report is processed, it compares this value against the vault's current inOutTracker
. This allows for the Oracle to handle this edge case of deposit/withdrawals happening in between the snapshot and report itself.