OrionAssetERC4626PriceAdapter
OrionAssetERC4626PriceAdapter
Price adapter for ERC-4626 vaults sharing the same underlying asset as the Orion protocol.
This adapter assumes that the target vault and the Orion protocol use the same underlying asset. It is not safe to use this adapter with vaults that are based on a different asset.
config
contract IOrionConfig config
Orion Config contract address
underlyingAsset
address underlyingAsset
Underlying asset address
underlyingAssetDecimals
uint8 underlyingAssetDecimals
Decimals of the underlying asset
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 |