decred / dcrdex

The Decred Decentralized Exchange (DEX), powered by atomic-swaps.
Other
184 stars 92 forks source link

tatanka: Make fee oracles more robust. #2726

Open JoeGruffins opened 6 months ago

JoeGruffins commented 6 months ago

Currently dcr and btc rely only on EstimateSmartFee which can have varying results. We can improve our estimations by pulling from other sources and taking an average. Some to consider are https://bitcoiner.live https://mempool.space/ https://blockchain.info https://blockchair.com https://blockcypher.com https://btc.com https://tatum.io https://blockdaemon.com https://bitcoinfees.billfodl.com https://bitcoinfees.net https://btc.network

Here is a graph from @buck54321 showing real time values returned from these services: image

I propose we choose a few of these and take the average of all we can fetch without error, unless they seem unreasonably high or low.

For dcr there is https://dcrdata.decred.org/ Are there others?

ukane-philemon commented 5 months ago

Working on this.

I'm looking out for fee sources that provide fee estimates for more than one asset:

  1. https://tatum.io/ (mainnet) - Supports: ETH, BTC, LTC, DOGE, we can fetch at most 3 assets/calls per second,
  2. https://blockdaemon.com/ (mainnet/testnet) - Supports: avalanche, bitcoin, bitcoincash, ethereum, fantom, litecoin, polkadot, polygon and solana. API KEY REQUIRED. Operators need to refresh API key every 6 months if we fetch fee estimate for 5 assets every 5 minutes.

PS: What assets are our top priority in this effort (DCR, BTC, LTC, BTC Cash, ETH)? We can add more sources for other assets subsequently, I think.

Also, using the average of 3 sources per asset is preferable, correct?

JoeGruffins commented 5 months ago

PS: What assets are our top priority in this effort (DCR, BTC, LTC, BTC Cash, ETH)? We can add more sources for other assets subsequently, I think.

Yeah if we need to set priorities, those sound right to me.

Also, using the average of 3 sources per asset is preferable, correct?

I think three is a good target, but I assume we won't find that many for many coins.