-
Notifications
You must be signed in to change notification settings - Fork 115
fix(liquidation): fix repaid assets rounding #626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@adhusson wrote:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this new issue, I'm putting into question the importance to have the shares as input to the liquidate function. Removing this input is another (albeit radical) solution to this issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only issue I have is that seizedAssets input converted into repaidShares can be greater than borrowShares thus overflow, so a liquidator who wants to liquidate everything would have to input either collateral or collateral - 1 (whereas today they have to either input seizedAssets = collateral or repaidShares = borrowShares)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, it seems weird to remove the granularity of repaid shares to liquidate, because a liquidation is like a repay + withdraw collateral
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides, it seems weird to remove the granularity of repaid shares to liquidate, because a liquidation is like a repay + withdraw collateral
By the same logic it should also expose a liquidate repaidAssets entrypoint. Ideally we would have a use case in mind to enable another entrypoint
The only issue I have is that
seizedAssetsinput converted intorepaidSharescan be greater thanborrowSharesthus overflow, so a liquidator who wants to liquidate everything would have to input eithercollateralorcollateral - 1
I think it's even more general, and there are situations where the collateral seized would be less than the full collateral. Typically this is in LTV range [LLTV, 1/LIF]. The choice to have the repaid shares entrypoint was to facilitate full liquidations in those cases, and the choice was made against making bad debt realization more of a natural choice. I'm still not fully convinced by the argument in favor, and I also feel like now the code is less clear because of it
9fedc64 to
742939d
Compare
|
Replaced by #638 |
Uh oh!
There was an error while loading. Please reload this page.