Hello! I’ve been getting familiar with liquidation on Compound by using Compound | Liquidate and I noticed something interesting.
We can liquidate a user by paying off the borrowing amount of another cToken’s underlying asset and receiving some percentage of another cToken’s collateral. For example if a user borrowed 100 DAI for 10 cETH and is in the red, a liquidator can pay some DAI and receive some discounted value of their cETH.
However I noticed some users borrow the same underlying token that they used as collateral. For example, borrowing ETH and using their cETH as collateral.
When I try to liquidate those users (example from the screenshot) by using cETH.liquidateBorrow and sending ETH I get the nonReentrant “re-entered” error. This is because the cETH contract needs to call itself and throws an error.
so my question is this, is it not possible to liquidate users that are borrowing from the same cToken they use as collateral? If it not possible, then how does the cToken get the collateral back?
Thanks,