Confusion regarding the specific operation of the liquidity function in the DEFI chapter. #3200
Replies: 1 comment 4 replies
-
Hello @jupiter-Pulin, I think your claim that we don't burn the DSC of the liquidator when they try to liquidate unhealthy users is wrong. We indeed burn their DSC, as shown in the code below. function _burnDsc(uint256 amountDscToBurn, address onBehalfOf, address dscFrom) private {
s_DSCMinted[onBehalfOf] -= amountDscToBurn;
//should add this ???
// s_DSCMinted[dscFrom] -= amountDscToBurn;
bool success = i_dsc.transferFrom(dscFrom, address(this), amountDscToBurn);
i_dsc.burn(amountDscToBurn);
} In the above code, the _burnDsc(debtToCover, user, msg.sender); I want you to understand that the DSC we are burning from the liquidator is not a debt they minted with the protocol but rather some DSC they got some other way, so we can't do what you suggest, which is |
Beta Was this translation helpful? Give feedback.
-
Since this is a reward for us as liquidators, and we are using DSC to cover the debt of the liquidated user, shouldn't our DSC also decrease accordingly, and then we take the collateral that the liquidated user has pledged? For example: If the user has pledged $200 worth of ETH => 100 DSC, and if the collateral value decreases to $150 worth of ETH, then as the liquidator, we need to take the user's collateral. In other words, we need to use the 100 DSC we hold to claim the user's $150 worth of ETH. After that, our DSC account should also decrease by 100 DSC. However, this function doesn't implement this; it only decreases the user's account. I believe we should add the following line: s_DSCMinted[dscFrom] -= amountDscToBurn;
Beta Was this translation helpful? Give feedback.
All reactions