Dapp Use Cases
Tokens Borrowed Invariant
Make sure that the tokens borrowed are not more than the tokens deposited
Use Case
A core invariant of lending protocols is that the tokens borrowed are not more than the tokens deposited. We’re using Morpho as an example, and they do have checks in place to prevent this invariant from being violated, but it’s a good example to show how to write an invariant assertion.
Explanation
Check that the tokens borrowed are not more than the tokens deposited. This invariant should never be violated.