Use Case

In DeFi protocols, users can borrow assets. To prevent users from borrowing too much and being unable to repay, protocols use a health factor. The health factor is a ratio of the user’s collateral to the user’s debt. If the health factor is below the liquidation threshold, the user’s position is liquidatable.

Explanation

Check the health factor of a user’s position before and after a trade to make sure that the health factor is above the liquidation threshold.

Code Example

pre: Health factor is above the liquidation threshold

post: Health factor is above the liquidation threshold

TODO: Add code example