ERC4626PriceAdapter
ERC4626PriceAdapter
Price adapter for ERC-4626 vaults.
CONFIG
contract IOrionConfig CONFIG
Orion Config contract address
PRICE_REGISTRY
contract IPriceAdapterRegistry PRICE_REGISTRY
Price adapter registry for vault underlying asset prices
UNDERLYING_ASSET
contract IERC20Metadata UNDERLYING_ASSET
Protocol underlying asset
UNDERLYING_ASSET_DECIMALS
uint8 UNDERLYING_ASSET_DECIMALS
Decimals of the protocol underlying
PRICE_DECIMALS
uint8 PRICE_DECIMALS
Decimals of the price
constructor
constructor(address configAddress) public
Constructor
Parameters
| Name | Type | Description |
|---|---|---|
| configAddress | address | The address of the OrionConfig contract |
validatePriceAdapter
function validatePriceAdapter(address asset) external view
Validates that the given asset is compatible with this adapter
Reverts with InvalidAdapter if the asset is not compatible
Parameters
| Name | Type | Description |
|---|---|---|
| asset | address | The address of the asset to validate |
getPriceData
function getPriceData(address vaultAsset) external view returns (uint256 price, uint8 decimals)
Get the price data for an asset
The asset shall be whitelisted in the OrionConfig contract. The registry will handle normalization to priceAdapterDecimals.
Parameters
| Name | Type | Description |
|---|---|---|
| vaultAsset | address |
Return Values
| Name | Type | Description |
|---|---|---|
| price | uint256 | The raw price of the asset |
| decimals | uint8 | The number of decimals for the returned price |