Skip to content

round up collat value in rcf check#976

Open
adhusson wants to merge 1 commit into
mainfrom
roundup-collat-value-in-rcf-check
Open

round up collat value in rcf check#976
adhusson wants to merge 1 commit into
mainfrom
roundup-collat-value-in-rcf-check

Conversation

@adhusson
Copy link
Copy Markdown
Contributor

@adhusson adhusson commented Jun 4, 2026

Motivation:

  • the value collateral.mulDivUp(price, 1e36).mulDivUp(WAD, lif) can be interpreted as "how much would be repaid if all the collateral was seized", and the RCF check as "if all the collat is seized, is the excess repaid amount small enough?“"
  • simplifying the computation of the deactivation in case of a full seize
  • <= instead of < makes it more obvious that using type(uint256).max as rcfThreshold deactivates it
  • the difference with the previous, conservative rounding direction can be proven to be only a few WEI, because lif is bounded by 2

corresponding thread:

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