Skip to content

Tags: cryptosweden/open-oracle

Tags

audit-uniswap-anchored-view

Toggle audit-uniswap-anchored-view's commit message
Add a uniswap anchored view

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.

audit-anchored-view

Toggle audit-anchored-view's commit message
Anchored View/PriceOracleProxy for a single (Coinbase) reporter