-
Notifications
You must be signed in to change notification settings - Fork 1
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
LIF and LTV restrictions #77
Conversation
…nto feat/lif-restriction
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.
only allow pre-liquidations if the position is not liquidatable
Not clear to me why. I think it makes the scenario where the is user pays a third-party to liquidate them more complex: now the third-party has to send a different tx at the liquidatable/not-liquidatable threshold.
The idea was to make sure that the invariant "position gets better after a pre-liquidation" holds. With
I actually think that it makes it easier for liquidators, because:
|
Co-authored-by: MathisGD <[email protected]> Signed-off-by: Quentin Garchery <[email protected]>
Agree that with the constraint you go from "healthy pre-liquidated positions improve" to "pre-liquidated position improve" but it only seems useful for a Or there is still a threshold to take into account that I missed? If not then for cheap pre-liquidation providers, or those paid out-of-band (not through LIF), this change creates an additional case to take into account. Since pre-liquidations are opt-in, it seems better to have a smooth usecase for configurations that always improve on the built-in liquidation. |
I agree. But it seems like there would be some use case for a preLIF2 greater than the LIF on Morpho, because you could also have lower than 1 pre-liquidation close factor.
Pre-liquidations do a withdraw collateral on Morpho, so they have to leave the position healthy. If they don't then they revert, so this is a threshold that was there before and is removed with this PR (even though we add another one).
I'm not sure to get what you mean by "cheap pre-liquidation providers", or what you mean by "[not paid] through LIF" |
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.
I'm convinced. I think the key point is making explicit that leaving unhealthy positions is not possible with this contract because there's an underlying withdrawCollateral
. Not handling (understand refusing) operations that are out of the scope of this contract could be confusing from a user point of view. If we want to support other usages maybe we need other contracts tailored for this purpose.
Forgot about this, so there is no scenario that looks like "with the right preLIF2 preliquidating always works", you always have to consider liquidation as an alternative. Thank you! |
The lemma 2.2.1 of the yellow paper states if
LTV < 1 / LIF
then the position gets healthier after a liquidation.In case of pre-liquidations, the case of interest is
LTV < LLTV
(after is the range of liquidations). So we wantLTV < LLTV => LTV < 1 / LIF
, which is equivalent to sayingLLTV <= 1 / LIF
, which is equivalent toLIF <= 1 / LLTV
.In this PR, the choice was made to:
preLIF2
for simplicity, which implies that we have the bound onpreLIF
Todo:
preLIF2