ubiquity / ubiquity-dollar

Ubiquity Dollar (UUSD) smart contracts and user interface.
https://uad.ubq.fi
Apache License 2.0
34 stars 89 forks source link

Oracle Upgrades #889

Closed 0x4007 closed 3 days ago

0x4007 commented 8 months ago

This can be looked into in late 2024/early 2025 but we should consider a more robust oracle strategy. Chainlink is not very good for censorship resistance.

@rndquu @gitcoindev @molecula451 I have concerns around using Chainlink and censorship resistance. Chainlink is a centralized point of failure for the protocol. Why not use the on chain TWAPs instead? Perhaps we can have a planned upgrade sometime in late 2024 to change the oracle(s)?

We'll gradually move to smth like "take the median price from chainlink, curve, uniswap, other oracle provider". Right now chainlink is the fastest to implement, safest and most reliable solution.

Originally posted by @rndquu in https://github.com/ubiquity/ubiquity-dollar/issues/830#issuecomment-1914232535

rndquu commented 8 months ago

I wanted to create a separate issue for a more robust chainlink implementation but since there is already one I will just post the audit's low severity issues which point to how exactly we could improve current chainlink integration:

0x4007 commented 4 days ago

Hey @rndquu any new ideas here?

rndquu commented 4 days ago

Hey @rndquu any new ideas here?

New oracle design is a huge issue.

Basically we should:

  1. Fetch quotes from multiple oracles
  2. Implement a fallback if oracle fetching failed
  3. Implement a circuit breaker if fallback fails
  4. Perform an audit
  5. Prepare on-chain contract migrations

In the end we get a system design more resilient to oracle outliers or ethereum mainnet issues.

I would get back to the "new oracle design" feature when we have enough collateral in the Ubiquity pool to be afraid to lose it (although current design also works fine right now).

We can either keep this issue open or close as "not planned" and reopen when we acquire enough liquidity in the Ubiquity pool.