Skip to main content

IPriceAdapter

IPriceAdapter

Interface for price adapters

getPriceData

function getPriceData(address asset) 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
assetaddressThe address of the asset to get the price for

Return Values

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

validatePriceAdapter

function validatePriceAdapter(address asset) external view returns (bool)

Validates that the given asset is compatible with this adapter

Parameters

NameTypeDescription
assetaddressThe address of the asset to validate

Return Values

NameTypeDescription
[0]booltrue if the asset is compatible, reverts otherwise