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

fix: Make batch shares rounding favour the system #549

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bingen
Copy link
Collaborator

@bingen bingen commented Oct 30, 2024

It uses ceil division in TroveManager._updateBatchShares, so that the rounding error goes against the user instead of the rest of the batch.

  • Pros
    • It seems safer, as it would prevent the flagged issues of borrowing for free
    • It’s more consistent with the other direction
  • Cons
    • It can still be gamed: other batch users may frontrun a borrowing operation, so that the user increasing debt owes more than minted due to rounding error.
    • The impact may be higher: now a user would swallow all the rounding error if frontrun (otherwise, the user can choose the right amount to prevent it), while before the error would be shared among the rest of the batch (most cases that would be higher, unless a user has >= 50% of the batch)
    • Introducing changes so late always poses some risk, and it seems the rounding issues have been quite mitigated by Prevent shares to debt ratio in batches to be too low #455

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.

1 participant