lindy-labs / opus_contracts

Opus Source Code
https://opus.money
Other
0 stars 0 forks source link

feat: make recovery mode factors configurable #561

Closed tserg closed 6 months ago

tserg commented 6 months ago

Fix #528 and https://github.com/lindy-labs/opus_contracts/pull/527#discussion_r1470270380.

The following restrictions are imposed on the values of the factors:

  1. 50% <= target LTV factor <= 90%
    • Having a maximum ensures that governance/admin cannot remove recovery mode entirely by setting it to 100%, and there will always be at least a 10% window for recovery mode to take place.
    • Having a minimum prevents rogue or capricious behaviour to the detriment of users and the protocol because recovery mode is too easily triggered.
  2. 1% <= buffer factor <= 10%
    • If the buffer factor is set to 0, then the issue of users unilaterally triggering recovery mode would arise again. We should never let this happen. Therefore, the minimum is set to 1%.
    • Having a maximum ensures that thresholds will be always be scaled given the possible values of the target factor, except in the specific case where target factor is set to 90% and buffer factor is set to 10%, which would be the least restrictive settings that can be chosen.

The current settings of 70% target LTV factor and a 5% buffer factor will be the default at deployment, meaning that recovery mode is triggered at 70% of the Shrine's LTV, and thresholds start to be scaled from 75% of the Shrine's LTV.

tserg commented 6 months ago

@milancermak @0xBRM What do you think about these bounds?

0xBRM commented 6 months ago

Sounds good. I agree with Milan. Although maybe in the future we can converge to a solid value and remove the optionality altogether to do away with this minor governance attack vector.