15,000 USDC
View results
Submission Details
Severity: high

Collateral price can go below borrowed amount before liquadation.

Vulnerability Details

Impact

As we learned in the course, the collateral value can go below the borrowed amount value too quickly before anyone can liquidate users.

If something happens to BTC or ETH like FTX then it will affect this code as well.

If the user deposited $2000 worth of ETH and borrowed $1000 (1000 DSC) and the deposited ETH value went below $1000 then our protocol will become insolvent.

And I read this known issue If the protocol ever becomes insolvent, there is almost no way to recover. This is a known issue. But I think this is about recovery and my issue is how it will become insolvent and how can we recover this.

Tools Used

Tutorial

Recommendations

As mentioned herein Chainlink docs;

https://docs.chain.link/data-feeds#check-the-latest-answer-against-reasonable-limits

We can implement a feature to automatically limit the collateral value, and instead of relying on other liquidators to liquidate users, we can add an account inside the contract(contains the DSC balance, controlled by owners who deposited collateral and minted DSC for this account) and once we detect the collateral value going below 175% or 150%, the contract account can liquidate user, make the profit and again deposit the collateral and mint the DSC.

This way protocol will be saved from sudden spikes.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.