Skip to content

Commit

Permalink
Merge pull request #125 from mhxw/develop
Browse files Browse the repository at this point in the history
fix typo
  • Loading branch information
chechu authored Sep 18, 2024
2 parents f48e992 + 30b3bfb commit 7bdc00a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions contracts/ResilientOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import "@venusprotocol/governance-contracts/contracts/Governance/AccessControlle
* @title ResilientOracle
* @author Venus
* @notice The Resilient Oracle is the main contract that the protocol uses to fetch prices of assets.
*
*
* DeFi protocols are vulnerable to price oracle failures including oracle manipulation and incorrectly
* reported prices. If only one oracle is used, this creates a single point of failure and opens a vector
* for attacking the protocol.
*
*
* The Resilient Oracle uses multiple sources and fallback mechanisms to provide accurate prices and protect
* the protocol from oracle attacks. Currently it includes integrations with Chainlink, Pyth, Binance Oracle
* and TWAP (Time-Weighted Average Price) oracles. TWAP uses PancakeSwap as the on-chain price source.
*
* For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per
* vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot
* oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source.
*
*
* For every market (vToken) we configure the main, pivot and fallback oracles. The oracles are configured per
* vToken's underlying asset address. The main oracle oracle is the most trustworthy price source, the pivot
* oracle is used as a loose sanity checker and the fallback oracle is used as a backup price source.
*
* To validate prices returned from two oracles, we use an upper and lower bound ratio that is set for every
* market. The upper bound ratio represents the deviation between reported price (the price that’s being
* validated) and the anchor price (the price we are validating against) above which the reported price will
Expand All @@ -38,8 +38,8 @@ isValid = anchorRatio <= upperBoundAnchorRatio && anchorRatio >= lowerBoundAncho
* In most cases, Chainlink is used as the main oracle, TWAP or Pyth oracles are used as the pivot oracle depending
* on which supports the given market and Binance oracle is used as the fallback oracle. For some markets we may
* use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles.
*
* use Pyth or TWAP as the main oracle if the token price is not supported by Chainlink or Binance oracles.
*
* For a fetched price to be valid it must be positive and not stagnant. If the price is invalid then we consider the
* oracle to be stagnant and treat it like it's disabled.
*/
Expand Down Expand Up @@ -413,7 +413,7 @@ contract ResilientOracle is PausableUpgradeable, AccessControlledV8, ResilientOr
* @param asset asset address
* @return price USD price in 18 decimals
* @return pivotValidated Boolean representing if the validation of fallback oracle price
* and pivot oracle price were successfull
* and pivot oracle price were successfully
* @custom:error Invalid price error is thrown if fallback oracle fails to fetch price of the asset
* @custom:error Invalid price error is thrown if fallback oracle is not enabled or fallback oracle
* address is null
Expand Down
4 changes: 2 additions & 2 deletions contracts/oracles/ChainlinkOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ contract ChainlinkOracle is AccessControlledV8, OracleInterface {
* @param asset Asset address
* @param price Asset price in 18 decimals
* @custom:access Only Governance
* @custom:event Emits PricePosted event on succesfully setup of asset price
* @custom:event Emits PricePosted event on successfully setup of asset price
*/
function setDirectPrice(address asset, uint256 price) external notNullAddress(asset) {
_checkAccessAllowed("setDirectPrice(address,uint256)");
Expand Down Expand Up @@ -98,7 +98,7 @@ contract ChainlinkOracle is AccessControlledV8, OracleInterface {
* @custom:error NotNullAddress error is thrown if asset address is null
* @custom:error NotNullAddress error is thrown if token feed address is null
* @custom:error Range error is thrown if maxStale period of token is not greater than zero
* @custom:event Emits TokenConfigAdded event on succesfully setting of the token config
* @custom:event Emits TokenConfigAdded event on successfully setting of the token config
*/
function setTokenConfig(
TokenConfig memory tokenConfig
Expand Down

0 comments on commit 7bdc00a

Please sign in to comment.