Oracle
Overview
Parallel oracle implement with orml-oracle
, serval approved members can feed prices to on-chain oracle, and then aggregated on-chain.
Tip: follow the link for more info about orml-oracle.
Oracle Architecture
Prices Pallet
This pallet provides the price from Oracle Module by implementing thePriceFeeder
trait. In case of emergency, the price can be set directly by Oracle Collective.
View Data Storage
EmergencyPrice
Mapping from currency id to it's emergency price
Key Name | Type | Description |
currency_id | CurrencyId | The currency's Id |
Tip: Follow the link to know more about 'CurrencyId'.
View Methods
Set_price()
Set emergency price
Name | Substrate Config | Runtime Type | Description |
origin | T::Origin | RawOrigin | The account signed this transaction |
currency_id | - | CurrencyId | The currency id price to be set |
price | - | PriceWithDecimal | The price with decimal to be set |
RETURN: Returns Ok() when set_price succeeds, otherwise return a substrate error type.
Tip: Follow the link to know more about 'PriceWithDecimal'.
Reset_price()
Reset emergency price
Name | Substrate Config | Runtime Type | Description |
origin | T::Origin | RawOrigin | The account signed this transaction |
currency_id | - | CurrencyId | The currency id price to be set |
RETURN: Returns Ok() when reset_price succeeds, otherwise return a substrate error type.
View Event
SetPrice
Set emergency price. [currency_id, price_detail]
SetPrice(CurrencyId, PriceWithDecimal)
ResetPrice
Reset emergency price. [currency_id]
ResetPrice(CurrencyId)
Last updated