NFTFloorOracle
Offchain clients can update the prices in this contract. The public can read prices aggeregate prices which are not expired from different feeders, if number of valid/unexpired prices not enough, we do not aggeregate and just use previous price
AssetAdded
AssetRemoved
AssetDataSet
OracleNodesSet
OracleConfigSet
OracleNftPaused
UPDATER_ROLE
priceMap
Aggregated price with address
feeders
All feeders
nfts
All asset list
priceFeederMap
Original raw value to aggregate with
config
storage for oracle configurations
whenNotPaused
onlyWhenKeyExisted
onlyWhenKeyNotExisted
_whenNotPaused
setPause
_isExistedKey
_addAsset
_removeAsset
addAssets
removeAsset
_addAssets
set nft assets.
Parameters
Name | Type | Description |
---|---|---|
assets | address[] | assets to set |
initialize
Allow contract creator to set admin and first updater
Parameters
Name | Type | Description |
---|---|---|
admin | address | The admin who can change roles |
updaters | address[] | The initial updaters |
assets | address[] | The initial nft assets |
_setConfig
set oracle configs
Parameters
Name | Type | Description |
---|---|---|
_expirationPeriod | uint128 | only prices not expired will be aggregated with |
_maxPriceDeviation | uint128 | use to reject when price increase/decrease rate more than this value |
_setOracles
set oracles.
Parameters
Name | Type | Description |
---|---|---|
nodes | address[] | feeders to set |
setOracles
Allows owner to change oracles.
Parameters
Name | Type | Description |
---|---|---|
nodes | address[] | feeders to set |
setConfig
Allows owner to update oracle configs
_checkValidityOfPrice
setPrice
Allows updater to set new price on PriceInformation and updates the internal TWAP cumulativePrice.
Parameters
Name | Type | Description |
---|---|---|
token | address | The nft contracts to set a floor price for |
twap | uint256 | The last floor twap |
_finalizePrice
_addRawValue
_combine
setMultiplePrices
Allows owner to set new price on PriceInformation and updates the internal TWAP cumulativePrice.
Parameters
Name | Type | Description |
---|---|---|
tokens | address[] | The nft contract to set a floor price for |
twaps | uint256[] |
getTwap
Parameters
Name | Type | Description |
---|---|---|
token | address | The nft contract |
Return Values
Name | Type | Description |
---|---|---|
twap | uint256 | The most recent twap on chain |
getLastUpdateTime
Parameters
Name | Type | Description |
---|---|---|
token | address | The nft contract |
Return Values
Name | Type | Description |
---|---|---|
timestamp | uint256 | The timestamp of the last update for an asset |