PriceProvidersRepository
PriceProvidersRepository
A repository of price providers. It manages price providers as well as maps assets to their price provider. It acts as a entry point for Silo for token prices.
Methods
acceptOwnership
Transfers ownership of the contract to a pending owner Can only be called by the pending owner.
addPriceProvider
Register new price provider
Parameters
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | undefined |
changeManager
Change manager address
Callable by manager or external owner role
Parameters
Name | Type | Description |
---|---|---|
_manager | address | new manager address |
getPrice
Returns "Time-Weighted Average Price" for an asset
Parameters
Name | Type | Description |
---|---|---|
_asset | address | address of an asset for which to read price |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | TWAP price of a token with 18 decimals |
isPriceProvider
Returns true if address is a registered price provider
Parameters
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | address of price provider to be removed |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | true if address is a registered price provider, otherwise false |
manager
Gets manager role address
Returns
Name | Type | Description |
---|---|---|
_0 | address | manager role address |
owner
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
pendingOwner
Returns the address of the pending owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
priceProviders
Maps asset address to its price provider
Each asset must have a price provider contract assigned, otherwise it's not supported
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | contract IPriceProvider | undefined |
priceProvidersRepositoryPing
Sanity check funciton
Returns
Name | Type | Description |
---|---|---|
_0 | bool | returns always TRUE |
providerList
Gets an array of price providers
Returns
Name | Type | Description |
---|---|---|
_0 | address[] | array of price providers |
providersCount
Gets number of pice providers registerd
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | number of pice providers registerd |
providersReadyForAsset
Check if prices are available for an asset
Parameters
Name | Type | Description |
---|---|---|
_asset | address | asset address to check |
Returns
Name | Type | Description |
---|---|---|
_0 | bool | returns TRUE if price feed is ready, otherwise false |
quoteToken
Token in which prices are quoted. It's most likely WETH, however it could vary from deployment to deployment. For example 1 SILO costs X amount of quoteToken.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
removePriceProvider
Unregister price provider
Parameters
Name | Type | Description |
---|---|---|
_provider | contract IPriceProvider | undefined |
renounceOwnership
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
setPriceProviderForAsset
Sets price provider for asset
Request for asset price is forwarded to the price provider assigned to that asset
Parameters
Name | Type | Description |
---|---|---|
_asset | address | address of an asset for which price provider will be used |
_provider | contract IPriceProvider | undefined |
siloRepository
SiloRepository contract address
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
transferOwnership
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
transferPendingOwnership
Transfers pending ownership of the contract to a new account (newPendingOwner
). Can only be called by the current owner.
Parameters
Name | Type | Description |
---|---|---|
newPendingOwner | address | undefined |
Events
ManagerChanged
Emitted when manager is changed
Parameters
Name | Type | Description |
---|---|---|
manager | address | undefined |
NewPriceProvider
Emitted when price provider is added
Parameters
Name | Type | Description |
---|---|---|
newPriceProvider | contract IPriceProvider | undefined |
OwnershipPending
Emitted when ownership transfer is proposed, aka pending owner is set
Parameters
Name | Type | Description |
---|---|---|
previousOwner | address | undefined |
newOwner | address | undefined |
OwnershipTransferred
Emitted when ownership is transferred on transferOwnership
and acceptOwnership
Parameters
Name | Type | Description |
---|---|---|
previousOwner | address | undefined |
newOwner | address | undefined |
PriceProviderForAsset
Emitted when asset is assigned to price provider
Parameters
Name | Type | Description |
---|---|---|
asset | address | undefined |
priceProvider | contract IPriceProvider | undefined |
PriceProviderRemoved
Emitted when price provider is removed
Parameters
Name | Type | Description |
---|---|---|
priceProvider | contract IPriceProvider | undefined |
Last updated