Today, Compound Labs maintains the Compound protocol’s price feed, which has been continually in service since 2018. In order to complete the process of transitioning the protocol to COMP Governance, it’s important that the community is able to maintain & upgrade a price feed that doesn’t rely on our team, or closed-source processes in any way.
Over the past year, our engineering team has developed the Open Price Feed, which is intended to be a permissionless, upgradable price feed for the Compound protocol (and other DeFi projects).
The Open Price Feed allows Reporters to sign price data using a known public key, which Posters (any Ethereum address) can submit on-chain.
Today, Coinbase Pro is the first Reporter using the Open Price Feed format, for all assets traded on Coinbase Pro; additional exchanges are developing their own Reporters, for their own trading pairs.
Migrating to the Open Price Feed
In order to cut reliance on Compound Labs to maintain the legacy feed, we propose that the protocol switch to using the Open Price Feed with a single Reporter (Coinbase Pro), and an on-chain “Anchor price”, which acts as a sanity check (Uniswap v2 Oracle). As the community becomes comfortable with the Open Price Feed, additional Reporters, and additional assets can be added through Governance–and the Anchor removed or used as a price source itself. Here’s how it will work:
Coinbase signs prices from Coinbase Pro, every few minutes, with high fidelity. These digitally signed prices are reported through an API. This will be the first functioning Open Price Feed Reporter.
Whenever these prices are posted, they are checked against a 30-60 minute TWAP (time-weighted average price) using the assets/ETH pair on Uniswap v2; this is the Anchor price. If the Reported price is within 20% of the Anchor, it’s accepted; otherwise the reported price is ignored. In practice, we expect 30 minutes to be long enough to make Uniswap price manipulation attacks prohibitively expensive.
In an extreme circumstance in which Coinbase believes their reporter key may have been compromised, the reporter also has the ability to sign an ‘invalidation’ message. Anyone may post this message to the chain, and the Open Price Feed will fall back to only using Uniswap Oracle prices, until a new price feed can be chosen by Governance.
As additional price Reporters come online, they can be added to the system through Governance, and new standards can quickly emerge (e.g. a median of 5 Reporters, without using an Anchor).
Next Steps
- The branch for active development of the Uniswap Anchored Coinbase Reporter View can be found in this GitHub pull request.
- A complete development overview will be posted in the Development channel soon; we encourage the community to review, audit, and improve the contracts we are developing.
- The contracts are being reviewed by OpenZeppelin
- We welcome comment, debate, and analysis on all aspects of the approach
- The entire system will be deployed to testnets, and tested in the open
- After the community feels comfortable with the system, it will be deployed to the Ethereum mainnet, and the community is free to propose it’s inclusion through Governance