ubiquity / ubiquity-dollar

Ubiquity Dollar (uAD) smart contracts and user interface.
https://uad.ubq.fi
Apache License 2.0
31 stars 82 forks source link

feat: add ICurveStableSwapNG #933

Closed rndquu closed 2 months ago

rndquu commented 2 months ago

Resolves https://github.com/ubiquity/ubiquity-dollar/issues/931

This PR refactors LibUbiquityPool to use ICurveStableSwapNG instead of ICurveStableSwapMetaNG.

ICurveStableSwapMetaNG is basically a Dollar/3CRV pool. Keeping in mind that 3CRV is equal to $1.03 we can't reliably fetch Dollar price in USD from ICurveStableSwapMetaNG.

We plan to create a new ICurveStableSwapNG pool with LUSD/Dollar pair. So calculating Dollar price in USD works this way: 1) Fetch LUSD/USD price from chainlink 2) Fetch Dollar/LUSD price from Curve's ICurveStableSwapNG oracle 3) Now we have everything to calculate Dollar/USD price

P.S. Deployment scripts will be updated in a separate PR

ubiquibot-continuous-deploys[bot] commented 2 months ago
2fdab8c
76267f7
81f760b
beb4498
gitcoindev commented 2 months ago

Implementation-wise looks perfect, I will wait for the security research with his review before approval to merge.

0xadrii commented 2 months ago

Everything looks correct, the issue is properly fixed