Migrating to the Open Price Feed

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
6 Likes

Hello Robert,
Just curious if anyone else iis already using this or plans to use the open price feed through coinbase?
As I understand it, “oracles” are a critical “attack vector”, how much risk do you see in this?
Also I hear all about chainlink as being the standard in this market, but I know nothing about them, (just angry i didnt buy them under a buck :laughing:) but like to know how this competes? and could compound provide a service like chainlink in the future as a price feed aggregator?
cheers!
Patrick

1 Like

Price feeds are a critical risk for projects that rely on price data to enforce the rules of the protocol; this includes Compound and most DeFi projects.

This would be the first deployment of the Open Price Feed, which any other project could piggyback on to use any of the prices included, such as Coinbase or OKEx.

This proposed implementation is designed to minimize the risk of relying on Coinbase (either due to a technical, or malicious error on their part), which is already “low” risk in my opinion, and present a path for the Compound community to add more price inputs over time, without ever relying on our team.

Alternative solutions like Chainlink present their own risks; technical risks (whether or not their contracts have been audited), centralization risks (who can edit/replace the contracts, e.g. a centralized company), etc.

3 Likes

The initial assets include:

Coinbase Pro

  • BTC
  • ETH
  • DAI
  • REP (likely requires consideration of Augur v2)
  • BAT
  • ZRX
  • COMP
  • LINK
  • KNC

USDC and USDT will assume a $1.00 peg, which matches the current price feed implementation.

1 Like

We just released our documentation for the Open Price Feed so that the community can get started understanding and auditing the system.

1 Like

We’ve been working on getting up test-nets for the Open Price Feed. We currently have an oracle set-up on both Kovan and Ropsten networks. The Kovan oracle uses the Uniswap cumulative prices copied from mainnet and the Ropsten oracle uses the real Uniswap factory contracts. These deployments will help us see how the oracle responds to real prices and interactions with Uniswap. Feel free to post to these oracles using the compound-poster.

Kovan: https://kovan.etherscan.io/address/0xbBdE93962Ca9fe39537eeA7380550ca6845F8db7
Ropsten: https://ropsten.etherscan.io/address/0xbef4e076a995c784be6094a432b9ca99b7431a3f

Note: our test nets are managed by eureka. If you have questions or want to follow along with test-net deployments, that would be the best place.

Great to see this work on the open oracle system. I wanted to repost an idea I shared a while back in Discord, related to the idea of absorbing price data from organizations who aren’t willing to provide a conforming feed (whether to avoid liability, or because it’s a technical burden, or whatever):


In the original Open Oracle System article, it mentions “Reporters” as the first step in the chain. This is someone who is the ultimate source for a certain piece of price data. An example would be Coinbase as the source of prices on the Coinbase exchange. The article imagines the Reporter as an active participant, bearing the burden of signing and publishing this price data. It might be hard to get reliable price sources like Coinbase to volunteer to act as Reporters, not least because of the legal liability they might perceive they are taking on. But as it happens, Coinbase is already publishing signed price data through their existing HTTPS-based APIs. The SSL key on their server is effectively signing the payload of the API responses. Projects like TLSNotary (https://tlsnotary.org/) show how to use the SSL stream to create a proof that a message was sent from the server in question.

It could be a way to jump start the oracle system without needing to persuade the ultimate data sources to participate.

1 Like

Pyggie yes, although its not clear whether that path will be faster than getting more reporters to sign with secp256k1 keys - we’ve been following projects like deco.works and I’d be happy to see a prototype using something like that…but I don’t expect it to happen anytime soon