Skip to main content

Solidity API

PriceAdapterRegistry

A registry contract that manages price adapters for different assets in the Orion protocol.

This contract allows the configuration of price adapters for various assets in the investment universe.

configAddress

address configAddress

Orion Config contract address

priceAdapterDecimals

uint8 priceAdapterDecimals

Price Adapter Precision

adapterOf

mapping(address => contract IPriceAdapter) adapterOf

Mapping of asset addresses to their corresponding price adapters

onlyConfig

modifier onlyConfig()

constructor

constructor(address initialOwner_, address configAddress_) public

Constructor

Parameters

NameTypeDescription
initialOwner_addressThe address of the initial owner
configAddress_addressThe address of the OrionConfig contract

setPriceAdapter

function setPriceAdapter(address asset, contract IPriceAdapter adapter) external

Register or replace the price adapter for an asset.

Parameters

NameTypeDescription
assetaddressThe address of the asset.
adaptercontract IPriceAdapterThe price adapter for the asset.

unsetPriceAdapter

function unsetPriceAdapter(address asset) external

Unregister the price adapter for an asset.

Parameters

NameTypeDescription
assetaddressThe address of the asset.

getPrice

function getPrice(address asset) external view returns (uint256)

Returns the price of the given asset via its assigned price adapter.

The asset shall be whitelisted in the OrionConfig contract, therefore assigned an adapter in adapterOf. Returned value is always expected to have priceAdapterDecimals decimals.

Parameters

NameTypeDescription
assetaddressThe address of the asset.

Return Values

NameTypeDescription
[0]uint256The price of the asset, normalized to priceAdapterDecimals decimals.