Assessment reports>Nibiru>Threat Models>Message: ExecuteMsg.EditOracleParams

Message: ExecuteMsg.EditOracleParams

This message can be sent via a CosmosWasm contract and allows for the oracle parameters to be edited.

The contractAddr address is checked to ensure that it is contained within the set of sudo contracts defined in the x/sudo module.

The parameters that a user can control are

  • VotePeriod — This is the number of blocks during which voting takes place.

  • VoteThreshold — This is the minimum proportion of votes that must be received for a ballot to pass.

  • RewardBand — This is a maxium divergence that a price vote can have from the weighted median in the ballot. If a vote lies within the valid range defined by μ := weightedMedian, validRange := μ ± (μ * rewardBand / 2), then rewards are added to the validator performance.

  • Whitelist — This is the set of whitelisted markets, or asset pairs, for the module — for example, ["unibi:uusd","ubtc:uusd"].

  • SlashFraction — This is the proportion of an oracle's stake that gets slashed for failing a voting period.

  • SlashWindow — This is the number of voting periods that specify a "slash window".

  • MinValidPerWindow — This is the minimum number of valid votes per window that a validator must submit to avoid being slashed.

  • TwapLookbackWindow — This is the amount of time to look back for TWAP calculations.

  • MinVoters — This is the minimum number of voters (i.e., oracle validators) per pair for it to be considered a passing ballot.

  • ValidatorFeeRatio — This is the validator fee ratio that is given to validators every epoch.

The oracle Params has a Validate method, but it does not seem to be called. Ideally, SetOracleParams should check this after merging the new params with the existing ones.

Zellic © 2024Back to top ↑