RioLRTAssetRegistry
Inherits: IRioLRTAssetRegistry, OwnableUpgradeable, UUPSUpgradeable, RioLRTCore
State Variables
priceFeedDecimals
The number of decimals that all asset price feeds must use.
priceScale
The price scale used for all assets (max of 18 decimals).
supportedAssets
All supported assets.
assetInfo
Information about a supported asset.
ethBalanceInUnverifiedValidators
The amount of ETH held in unverified validators.
Functions
onlyWithdrawalQueueOrDepositPool
Require that the caller is the withdrawal queue or deposit pool.
constructor
Parameters
issuer_
address
The LRT issuer that's authorized to deploy this contract.
initialize
Initializes the asset registry contract.
Parameters
initialOwner
address
The initial owner of the contract.
token_
address
The address of the liquid restaking token.
priceFeedDecimals_
uint8
The number of decimals that all price feeds must use.
initialAssets
AssetConfig[]
The initial supported asset configurations.
getTVL
Returns the total value of all underlying assets in the unit of account.
getTVLForAsset
Returns the total value of the underlying asset in the unit of account.
Parameters
asset
address
The address of the asset.
getTotalBalanceForAsset
Returns the total balance of the asset, including the deposit pool and EigenLayer.
Parameters
asset
address
The address of the asset.
getETHBalanceInEigenLayer
Returns the ETH balance held in EigenLayer. This includes the ETH held in unverified validators, EigenPod shares, and ETH that's queued for withdrawal.
isSupportedAsset
Checks if a given asset is supported.
Parameters
asset
address
The address of the asset to check.
getAssetInfoByAddress
Returns information about an asset.
Parameters
asset
address
The address of the asset.
getAssetStrategy
Returns the asset's EigenLayer strategy.
Parameters
asset
address
The address of the asset.
getAssetSharesHeld
Returns the amount of EigenLayer shares held for an asset.
Parameters
asset
address
The address of the asset.
getAssetPriceFeed
Returns the asset's current price feed.
Parameters
asset
address
The address of the asset.
getAssetDepositCap
Returns the asset's current deposit cap.
Parameters
asset
address
The address of the asset.
getAssetDecimals
Returns the asset's decimal precision.
Parameters
asset
address
The address of the asset.
getAssetPrice
Returns the asset's current price.
Parameters
asset
address
The address of the asset.
getSupportedAssets
Returns an array of all supported assets.
getAssetStrategies
Returns the EigenLayer strategies for all supported assets.
convertToUnitOfAccountFromAsset
Converts an asset amount to its equivalent value in the unit of account. The unit of account is the price feed's quote asset.
Parameters
asset
address
The address of the asset to convert.
amount
uint256
The amount of the asset to convert.
convertFromUnitOfAccountToAsset
Converts the unit of account value to its equivalent in the asset. The unit of account is the price feed's quote asset.
Parameters
asset
address
The address of the asset to convert to.
value
uint256
The asset's value in the unit of account.
convertToSharesFromAsset
Converts an amount of an asset to the equivalent amount of EigenLayer shares.
Parameters
asset
address
The address of the asset to convert.
amount
uint256
The amount of the asset to convert.
convertFromSharesToAsset
Converts an amount of EigenLayer shares to the equivalent amount of an asset.
Parameters
strategy
address
The EigenLayer strategy.
shares
uint256
The amount of EigenLayer shares.
getPrice
Get the current price from the provided price feed. This function performs no checks on the price feed. Its output should not be trusted unless the price feed parameter is known and trusted.
Parameters
priceFeed
address
The price feed contract address.
addAsset
Adds a new underlying asset to the liquid restaking token.
Parameters
config
AssetConfig
The asset's configuration.
removeAsset
Removes an underlying asset from the liquid restaking token.
Parameters
asset
address
The address of the asset to remove.
forceRemoveAsset
Force removes an underlying asset from the liquid restaking token regardless of its balance.
Parameters
asset
address
The address of the asset to force remove.
setAssetDepositCap
Sets the asset's deposit cap.
Parameters
asset
address
newDepositCap
uint96
The new rebalance delay.
setAssetPriceFeed
Sets the asset's price feed.
Parameters
asset
address
newPriceFeed
address
The new price feed.
increaseSharesHeldForAsset
Increases the number of EigenLayer shares held for an asset.
Parameters
asset
address
The address of the asset.
amount
uint256
The amount of EigenLayer shares to increase.
decreaseSharesHeldForAsset
Decreases the number of EigenLayer shares held for an asset.
Parameters
asset
address
The address of the asset.
amount
uint256
The amount of EigenLayer shares to decrease.
increaseUnverifiedValidatorETHBalance
Increases the unverified validator ETH balance.
Parameters
amount
uint256
The amount of ETH to increase.
decreaseUnverifiedValidatorETHBalance
Decreases the unverified validator ETH balance.
Parameters
amount
uint256
The amount of ETH to decrease.
_addAsset
Adds a new underlying asset to the liquid restaking token.
Parameters
config
AssetConfig
The asset's configuration.
_removeAsset
Removes an underlying asset from the liquid restaking token.
Parameters
asset
address
The address of the asset to remove.
force
bool
If true, the asset will be removed regardless of its balance.
_findAssetIndex
Returns the index of the asset in the supported assets array.
Parameters
asset
address
The address of the asset.
_normalizeDecimals
Normalizes an amount from one decimal precision to another.
Parameters
amount
uint256
The amount to normalize.
fromDecimals
uint8
The amount's current decimal precision.
toDecimals
uint8
The amount's target decimal precision.
_authorizeUpgrade
Allows the owner to upgrade the asset registry implementation.
Parameters
newImplementation
address
The implementation to upgrade to.
Last updated