Closed devsquaaa closed 1 year ago
I agree with the first point.
About the second, I don't know if a stability pool mechanism would be relevant for the v1 as it would expose us to much more vulnerabilities imo. I'm totally cool if we implement it and will be happy to it (or at least part of it) but it will be a lot of work and will require some serious thinking and risk analysis prior to its implementation. Again it all comes down to the questions: What do we want the v1 to be (i.e. should it be similar to the MVP) and when do we want to have it finished?
Agreed I don't even think a stability pool in itself is relevant anymore for now anyway. We should focus on capital efficient liquidations that incentivise the liquidator while keeping the process enjoyable for the borrower. Liquidations should also be capped to a maximum of 50% initially to avoid liquidity pools to be tampered with on Uniswap.
What do you mean exactly by "Liquidations should also be capped to a maximum of 50%" @userdarius ?
We shouldn't allow a liquidator to liquidate more than 50% of the position
@devsquaaa how long will this take to implement?
Liquidations should also be capped to a maximum of 50% initially to avoid liquidity pools to be tampered with on Uniswap.
This is a good idea for most cases, but I think a liquidator should be able to liquidate a position if we're about to go into bad debt (i.e. position value is "barely" greater than debt value, because it would be impossible to liquidate 50% of the position and get a position above the minimum CR). Here is the design I propose :
p
of the position being given to the liquidator is given by min(<the proportion the liquidator wants to liquidate>, max(50%, <the proportion that would make the position's CR greater than minCR>))
This basically gives us the following guarantees :
Any thoughts ? @Lolshh @userdarius
@devsquaaa how long will this take to implement?
The design I described could most probably be ready for Sunday, and tested next week.
All good for me!
Let's try to finish this function and tests before the deadline
The liquidate function is ready. I just pushed 2 tests (e1f0740b99035151c6f28fc7cc8511240803ba08) of the liquidate function that cover the 2 important cases of a liquidation (case where the position's health can't be improved, and one where it is). Would be nice if someone else with another point of view could add some new tests for potential edge cases.
At the moment, our liquidation function just repays the debt (including interest) to the stablecoin (e.g. MAI or GHO).
I assume this is not the final system we want to implement. Here are some alternatives :
amountToPay = max(positionDebt, positionValue * (1+x%))
, with these values quoted in the stablecoin (so, in USD for MAI or GHO). This system is reasonnable because it incentivizes liquidators, while allowing the protocol to build up nice reserves, and potentially gives us a revenue stream.So, any idea what we should implement for the v1? @Lolshh @userdarius @GustaveCharles @NilsDelage