Native Oracle
Summary
Gameluk offers an Oracle module that supports asset exchange rate pricing for use by other modules and contracts. Validators are expected and required to participate as Oracles when validating for the network to ensure the most reliable and accurate pricing for assets.
During each voting window, a validator must provide asset pricing for the whitelisted assets. At the end of each voting window, the chain aggregates the votes and computes a weighted median based on validator voting power to determine the effective exchange rate for each asset.
Price Feeder
The validator must participate in providing pricing for the oracle to avoid penalties and legal consequences. A systemd service can be configured to run the oracle sidecar, providing a more reliable and customizable solution for asset price provision. The sidecar can be built with make install-price-feeder
from the gameluk-chain repo dir, and needs an associated config file that specifies the account from which to send oracle votes along with additional configuration information such as assets to provide and providers to use for pricing information.
Validators must update the addresses keyring information and currency pairs to include assets whitelisted by the oracle module.
Below is an example of a systemd service file for running the oracle sidecar:
Oracle Penalties
Validators will be penalized for non-participation or submitting bad data. Each validator has a miss count and an abstain count that is tracked. The abstain count tracks the number of voting windows in which the validator did not submit a vote. The miss count tracks the number of voting windows in which the validator's vote was improper, either because it contained data outside of 1 standard deviation or because it did not include asset prices for all whitelisted assets. A slash window is a period of blocks specified by oracle parameters. If the validator has too many misses and/or abstains across this window, they are slashed and jailed. This is because oracle integrity and freshness are treated as core chain services, and validators that do not participate in the upkeep of oracle asset pricing are penalized.
Misses and abstains both contribute to oracle penalization
Feeder Delegation
To run the oracle price feeder while signing from a different account, it is recommended to set up a feeder for your validator. This will allow the feeder account to perform oracle votes on behalf of the validator.
Example
Queries
Actives
Returns the current active denoms for which there are exchange rates
Exchange Rates
Returns the current exchange rates for supported assets. Optionally can query for a specific denom by entering it as an additional param.
TWAPs
Returns the time weighted average price for a given time interval in seconds. The maximum lookback is determined by oracle parameters.
Vote Penalty Counter
Returns the penalty counter for a validator queried by validator address.
Params
Returns the current parameters for the oracle module
Last updated