Skip to main content

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

NameTypeDescription
configAddressaddressThe 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

NameTypeDescription
assetaddressThe 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

NameTypeDescription
vaultAssetaddress

Return Values

NameTypeDescription
priceuint256The raw price of the asset
decimalsuint8The number of decimals for the returned price