Skip to content

[Certora] SumOfCredits equals TotalUnits plus Fees. - #1063

Open
jhoenicke wants to merge 14 commits into
mainfrom
certora/sumofcredits
Open

[Certora] SumOfCredits equals TotalUnits plus Fees.#1063
jhoenicke wants to merge 14 commits into
mainfrom
certora/sumofcredits

Conversation

@jhoenicke

@jhoenicke jhoenicke commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

This is the main solvency invariant: the totalUnits equals the correctly scaled sums of all position credit plus fee. Together with the invariant from Midnight.spec that totalUnits equals the sum of all debts plus the withdrawable amount, this shows that all credits are backed by debt.

This pull-request superseeds #534.

corresponding thread

This is the main solvency invariant: the totalUnits equals the
correctly scaled sums of all position credit plus fee.  Together
with the invariant from Midnight.spec that totalUnits equals
the sum of all debts plus the withdrawable amount, this shows that
all credits are backed by debt.
@jhoenicke
jhoenicke force-pushed the certora/sumofcredits branch from a68c5b0 to dd5df1d Compare July 13, 2026 16:03

@QGarchery QGarchery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great !

Didn't have the time to look at the proof in depth, nor to look at the other UpdatePositionView spec

Comment thread certora/specs/UpdatePositionView.spec Outdated
Comment thread certora/specs/UpdatePositionView.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
Comment thread certora/specs/SumOfCreditsAxiomatic.spec Outdated
jochencertora and others added 8 commits August 28, 2026 12:02
Also instead of requiring some axioms for all values, we require the axioms
in summaryMulDivDown only for the used values.
Co-authored-by: Quentin Garchery <garchery.quentin@gmail.com>
Signed-off-by: Jochen Hoenicke <hoenicke@gmail.com>
Rename cvl*Of functions.
Use invariant from Midnight.spec
Made the specs more similar to each other (adapted variable names).
Use "proved in UpdatePositionView" as explanation for require.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants