Skip to content
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

Consider liquidation price on take #219

Open
wants to merge 2 commits into
base: liq-2.0
Choose a base branch
from

Conversation

brianmcmichael
Copy link
Contributor

Takes the max of getPrice()*buf or tab/lot on take only.

This sets a price floor on initial takes to ward against an OSM attack.

This formula does not apply to redo() because the initial auction will take time. In a real oracle attack we'd resolve the oracle issue, but in a catastrophic market decline the redo() would rely entirely on the OSM price to set the price on the second try.

@@ -248,7 +251,7 @@ contract Clipper {
sales[id].tic = uint96(block.timestamp);

uint256 top;
top = rmul(getPrice(), buf);
top = max(rmul(getPrice(), buf), tab / lot);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using tab / lot isn't optimal because it neglects mat. See Lucas's reply to me here:

#158 (comment)

From discussions w/Primoz, having some multiplier (i.e. a second buf) is the most flexible option. See e.g.:
https://forum.makerdao.com/t/mip45-liquidations-2-0-liq-2-0-liquidation-system-redesign/6352/25

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still thinking through this. I can see Lucas's point, but I see this as an emergency fallback, the oracle price will still be primarily used as the starting point unless there's a hugely dramatic drop.

Primoz has a point, too, but rather than reducing it by a multiplier I'd argue for Lucas' point that this is just a starting point for the auction and that at least gives the vaultholder a fair shot at recapitalizing in the market. If indeed it is too low, it should still be repriced in the redo()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants