Mechanics
Last updated
Last updated
During periods of high volatility, we take for granted that the borrower is constantly monitoring their Collateral to Debt Ratio and Position's Health. In the background, Ratio's Risk Engine is periodically updating the Dynamic Collateralization Ratio of each of the open Vaults, and the user vault UI will dynamically present the market price at which the vault will be liquidated.
It is easy to calculate what amount needs to be repaid to avoid liquidation. The repay percentage is just the difference between CTD and CR
So the borrower has two options to repay some of their debt:
Borrower goes to the open market and buys some USDr and repays on the platform
Borrower mints more LP tokens and deposit directly on the platform
In this way the user would increase their CTD and avoid liquidation.
As mentioned before, in a liquidation event, the protocol will typically not unwind and liquidate the full position of the borrower; instead just a portion of the collateral will be liquidated and the borrower will return to a healthy position.
The liquidation threshold needed to put the borrower's position back to a healthy position (the Dynamic CR plus a health buffer dependent on the CR of the vault) is calculated by the following formula.
where fees takes into account the urgency of the protocol to liquidate and unwind the LP position at some cost to account for trading fees and slippage. By doing this small readjustment to the borrower's position, Ratio's Liquidation Engine is recalibrating the position of the borrower, allowing for a risk-on setting.