-
Notifications
You must be signed in to change notification settings - Fork 49
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
Verify invariants about the protocol #96
Comments
Some more ideas:
|
I conducted all of these tests (except for the enabled LLTVs and IRMs) and they all pass, Do you have other invariants in mind that could be tested ? |
Some more ideas:
|
Related to this, I would also consider adding collateral to the left hand side of this assertion |
So it would be something like: For every asset, the sum of |
Yes, except technically I believe it should be <= since it is possible that blue is sent tokens without an interaction in blue. |
So we can have equality of the invariant in tests, but only inequality in production |
In #231 the equality stands |
I'm closing this as I opened a general issue about formal verification to keep track of what's left to do. See #390 |
The idea is to list the invariants about the protocols. This way we will remember to add them as forge invariants or certora invariants.
Current invariant list :
shares / assets
on a market is increasing, except in liquidate (in progress in [Certora] Verify share ratio #341)This invariant is difficult to check because every user's owed assets can change at each interaction. Moreover, it can be deduced (modulo virtual assets and shares) given the 2 previous invariants by applying
toAssetsDown
on both sides. For these reasons, it has been replaced with the following property: a given user cannot withdraw more thansupplyShares(address).toAssetsDown()
assets. (done in [Certora] Exit liquidity #316)For similar reasons as the invariant above, this invariant has been replaced with the following property: when repaying the whole position, a user is transfering more tokens than
borrowShares(address).toAssetsUp())
(done in [Certora] Exit liquidity #316)(some of the invariants were taken from comments below, and put there for easier tracking)
The text was updated successfully, but these errors were encountered: