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.
Tutorial
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.