ebtc-protocol / ebtc

GNU General Public License v3.0
56 stars 25 forks source link

Identify or setup a fallback price feed #240

Closed sajanrajdev closed 1 year ago

sajanrajdev commented 1 year ago

stETH/wstETH don't have a Tellor (nor any other alternative price feed from CL available on mainnet). Further research into alternatives must be conducted and, if no other safe feed is found, a feed should be developed in collaboration with Tellor. Ideally: wstETH/BTC or stETH/BTC.

sajanrajdev commented 1 year ago

Alternative to Chainlink a few other Oracle Protocols exist that could potentially offer the required price feed. The top contestants are:

Their decentralization and security profile must be analyzed in order to identify the preferred option.

sajanrajdev commented 1 year ago

Oracle Providers Comparison

Tellor

Technical Overview

Integration notes

Band

Techincal Overview

Integration notes

sajanrajdev commented 1 year ago

Notes from meeting with Tellor

Recording of meeting: https://drive.google.com/file/d/1NiMmttmxcBXm9hayXOVHp8LluaX4OpJf/view?usp=sharing

sajanrajdev commented 1 year ago

Band Protocol engagement

Reached out to Band protocol with regards to certain questions around their infrastructure and integration:

Once the Oracle Script is developed and deployed, how should we make the data request? My understanding is that we should broadcast a MsgRequestData to the BandChain but, if the intention is for this data feed to be updated with a continuous frequency, does that mean that we need to setup a bot to broadcast and pay for this request continuously? Is there a decentralized (or more decentralized) way of handling this? Can it be handled directly from the Ethereum network?

Yes, you will have to set up some bot to request BandChain and relay the result. However, we are working on developing this bot for public use. This bot will relay data along with the proof. So, smart contract itself can verify data through bridge.

What is the average cost per request?

This depends on your oracle script and data sources. You can calculate it roughly by this formula (base_gas + prepare_gas + execute_gas)gas_prices + data_source_fee ask_count. Currently, gas_price is about 0.0025uband. You can also try to request your oracle script in testnet first.

Could you explain a bit better how does the network ensure that no malicious prices are approved?

When you request data in BandChain, you will have to specify ask_count. This value is the number of validators that are required to help get your data by running the data sources. Then, you can add your aggregation logic in oracle script to prevent malicious prices such as median of the price from validators.

sajanrajdev commented 1 year ago

Fall Back Oracles comparison

Notes on API3

Band VS Tellor

A comparison was conducted between the two protocols and a Venn diagram highlighting their pros and cons can be found in the following Miro board. image

Recomendation

Based on conversations with both the Band and Tellor teams, an analysis of their architectures and the comparison from above, it is my recommendation to pursue Tellor as the fallback Oracle for the following main reasons:

sajanrajdev commented 1 year ago

Pursuing Tellor as Fallback Oracle. The following issues were created to track the implementation of the required infrastructure: