dss icon indicating copy to clipboard operation
dss copied to clipboard

[draft] make bad debt grace period configurable per-Ilk

Open livnev opened this issue 4 years ago • 3 comments

Vow.wait exists in order to avoid creating unnecessary flop auctions immediately after a position has entered liquidation (creating bad debt), but before the flip auction has had time to finish and cancel the bad debt. Currently, Vow.wait has to be configured to apply to debt generated by all collateral types, meaning that it should be set to the maximum running time of any flip auction. This is a limitation, since some future collateral types may wish to allow much longer liquidation auction durations than the existing ones, which would force wait to be longer, unnecessarily delaying flop auctions for other collateral types.

This PR makes wait configurable per Ilk, as Vow.ilks(ilk).wait.

TODOs:

  • adjust tests

livnev avatar Oct 05 '20 14:10 livnev

I know this is still a very early PR, but have 2 suggestions that might make sense:

  • Keep the wait value per collateral in the vow. That way we might save replacing the cat. I haven't analysed if keeping the same cat is something convenient or which implications it might have, but at least the possibility of replacing just the vow is there (similar analysis should be done for flapper and flopper).

  • Instead of saving the tab in the 2 dimensions era and wait mapping, just save it in one dimension mapping with the addition of both values.

gbalabasquer avatar Oct 05 '20 17:10 gbalabasquer

Hi @gbalabasquer, thanks for your attention and suggestions:

  1. It seemed better to avoid introducing the concept of Ilks (and per-Ilk data) in the Vow, seeing as currently the Vow does not concern itself with collateral-specific information. Also, even if we were to store per-Ilk wait in the Vow, we would still need a way of referencing which Ilk the fess is coming from (to know which wait to use), meaning that the interface would change and would require a change in the Cat anyway.

  2. Good point, I have further simplified fess with this idea.

Overall, the main disadvantage of this change is the need to deploy a new Vow (and new Cat), which seems unavoidable. I wanted to flag this limitation, so that it can at least be incorporated the next time it is convenient to redeploy the Vow (if ever).

livnev avatar Oct 05 '20 18:10 livnev

  1. Right, I forgot about having to identify the ilk wait time when executing fess.

  2. Great.

Yes, as you know, replacing the vow is a bit complicate process. We made some analysis about it at the moment the flop stuck auctions happened. We ended up fixing that specific problem with some work around in the flop. However a more natural fix would be in the vow. I guess at some point vow should be updated with all these improvements.

gbalabasquer avatar Oct 05 '20 18:10 gbalabasquer