Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

cergyk - UbiquityPool::redeemDollar No guarantees of pool solvency #60

Closed
sherlock-admin2 opened this issue Jan 10, 2024 · 3 comments
Closed
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue

Comments

@sherlock-admin2
Copy link
Contributor

sherlock-admin2 commented Jan 10, 2024

cergyk

medium

UbiquityPool::redeemDollar No guarantees of pool solvency

Summary

The ubiquity pool relies on chainlink feeds for minting/redeeming but as the price fluctuates, there is no guarantee that there is enough collateral in the pool to serve all redeems. That can cause a bank run in which the last user may not be able to redeem.

Vulnerability Detail

Scenario

Only DAI is used as a collateral in the pool

Alice and Bob deposit 10 DAI when price of uAD against DAI is 0.9, so they both get 11 uAD. Collateral in the pool is 20 DAI.

Chainlink feed now returns 1.1 for the same pair.

Alice can withdraw 12 DAI by redeeming all of her uAD. Bob should be able to redeem 12 DAI as well, but there is only 8 DAI left in the pool.

Impact

Last users may be unable to redeem full value of their uAD, and thus lose funds.

Code Snippet

https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L284-L294

Tool used

Manual Review

Recommendation

Socialize losses when chainlink feed returns a price which may not allow all users to redeem.

Duplicate of #17

@github-actions github-actions bot added the Excluded Excluded by the judge without consulting the protocol or the senior label Jan 14, 2024
@sherlock-admin2
Copy link
Contributor Author

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

The issue describes about the protocol insolvancy in case of collateral depeg. It's not avoidable, that's why the protocol has borrowing function to get yield, take fees on mint and redeem, these features will hedge the risk from protocol insolvancy

@github-actions github-actions bot reopened this Jan 16, 2024
@github-actions github-actions bot added Medium A valid Medium severity issue Has Duplicates A valid issue with 1+ other issues describing the same vulnerability and removed Excluded Excluded by the judge without consulting the protocol or the senior labels Jan 16, 2024
@sherlock-admin2
Copy link
Contributor Author

1 comment(s) were left on this issue during the judging contest.

auditsea commented:

The issue describes about the protocol insolvancy in case of collateral depeg. It's not avoidable, that's why the protocol has borrowing function to get yield, take fees on mint and redeem, these features will hedge the risk from protocol insolvancy

@rndquu
Copy link

rndquu commented Jan 17, 2024

Socialize losses when chainlink feed returns a price which may not allow all users to redeem.

I don't really understand the proposed solution.

There are no guarantees of pool solvency hence there are fees and AMO minters. You may refer to this comment for more context.

Another point is that if the DAI/USD quote is $1.1 then the Dollar toke TWAP price will be <1$ hence the minting would be disabled (but yet possible in some cases).

Overall the issue seems to be valid but I'm not sure how to fix it except introducing more "Dollar burn" related operations which basically acquire collateral.

@nevillehuang nevillehuang added Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label and removed Has Duplicates A valid issue with 1+ other issues describing the same vulnerability labels Jan 22, 2024
@sherlock-admin2 sherlock-admin2 changed the title Radiant Charcoal Horse - UbiquityPool::redeemDollar No guarantees of pool solvency cergyk - UbiquityPool::redeemDollar No guarantees of pool solvency Jan 24, 2024
@sherlock-admin2 sherlock-admin2 added the Reward A payout will be made for this issue label Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate A valid issue that is a duplicate of an issue with `Has Duplicates` label Medium A valid Medium severity issue Reward A payout will be made for this issue
Projects
None yet
Development

No branches or pull requests

3 participants