-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a Uniswap anchored Open Oracle view. We intend to propose switching the Compound Protocol to use this oracle, together with the Coinbase reporter feed. The idea is that the price can only be set to a value coming from the reporter, but must be reasonably close to the anchor price. The configuration for the oracle is passed up entirely in the constructor, including which uniswap market to use as an anchor for each reported price. Tokens can also be configured to have FIXED_ETH or FIXED_USD prices. FIXED_USD prices are constant (since the oracle returns prices denominated in USD). FIXED_ETH prices are a multiple of the ETH price, which must be reported in order to be used. The view also directly exposes the interface for compatibility with the Compound Protocol, which currently expects to fetch prices by CToken address. In the unexpected event that the reporter believes their key to be compromised, they may sign a 'rotate' message which can be used to invalidate the reporter. In such an event, the view is configured to fall back to using the anchor price directly. In order to track the Uniswap price, the price accumulators those markets expose are tracked by block timestamp. Whenever prices are posted, the tracked accumulators are updated in such a way as to always have an accumulator from at least a certain period ago. When a current anchor price is needed, it is always the time-weighted average price over at least the configured anchor period.
- Loading branch information
1 parent
c4c4683
commit d0a0d03
Showing
27 changed files
with
2,150 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.