All asset parameters including LTV ratio and liquidation threshold are example values to facilitate example calculations. If you need to look at actual values used on Strobe Protocol, please have a look at Values page under Asset parameters section.
Health factor=∑Borrowing Value in USDi∑(LTV ratioi×Collateral Value in USDi)
The health factor is always bigger than or equal to the collateralization ratio because we take the liquidation threshold out, which always deflates the result of the equation. When they are equal, they will always be at the positive infinity.
Using the information from the table above, the health factor would be:
Health factor=2+0.3(0.9×5)+(0.9×1)=2.3(4.5)+(0.9)=2.35.4=2.347
As shown, the health factor is greater than the collateralization ratio. The difference between the health factor and the collateralization ratio is a buffer for the borrowers. When the health factor goes below 1, a portion of debt may be liquidated to bring the user's health ratio back to 1.
Amount to liquidate
The liquidation must happen before the health factor drops 'too much' below 1. What would be 'too much'?: When the value of the collateral is so little that the health factor cannot be recovered back to 1 even after being liquidated. How do we derive the equation? We can use the same health factor equation we have above.
Let's give an example using the variables below, and let's say we are repaying USDC debt and taking away XRP collateral during liquidation:
Parameter
XRP
USDC
LTV ratio
80%
85%
Deposited amount in USD
5.4 USD
0.1 USD
Borrowed amount in USD
0.1 USD
5 USD
Liquidation bonus
6%
7%
Let's expand:
Health factor=∑Borrowing Value in USDi∑(LTV ratioi×Collateral Value in USDi)
HFafter liquidation is the health factor after liquidation takes place.
LTVasset is the LTV ratio of an asset.
CVasset is the value of an asset deposited as a collateral in USD.
RVasset is the value of repayment on the debt of an asset in USD.
DVasset is the value of the debt of an asset in USD.
LFasset is the liquidation bonus factor of an asset.
Notice that the equation is just an equation for the health factor in the post-liquidation state. LTVXRP×(CVXRP−RVUSDC(1+LFXRP)) represents the discounted collateral left after a part of XRP collateral including the liquidation bonus is captured in exchange for the USDC debt repayment by the liquidator. LTVUSDC×CVUSDC represents the discounted USDC collateral. DVXRP+DVUSDC−RVUSDC represents total debt after the USDC debt repayment.
Let's rearrange the equation so we can solve for RVUSDC:
However, in some cases where more than two assets are borrowed or deposited as collaterals, RVrepaid asset can exceed DVrepaid asset or CVliquidated asset. In either case, repayment is not valid because repayment amount must be smaller than the debt and must be smaller than the captured collateral amount plus liquidation bonus in order for the liquidation to work.
In such cases, Final Repaid Amountrepaid asset needs to be reduced down to min(RVrepaid asset,min(DVrepaid asset,1+LFliquidated assetCVliquidated asset)).
Below, we review all of the different possibilities for liquidation. We use USDC=repaid asset, and XRP=liquidated asset.
HF≥1
Parameter
XRP
USDC
LTV ratio
80%
85%
Deposited amount in USD
5.4 USD
0.1 USD
Borrowed amount in USD
0.1 USD
0 USD
Liquidation bonus
6%
7%
In this case, there can't be a liquidation on this account, because the user's position is healthy:
HF=0.10.8×5.4+0.85×0.1≥1
HF≤1 and RVrepaid asset=min(RVrepaid asset,min(DVrepaid asset,1+LFliquidated assetCVliquidated asset))
Parameter
XRP
USDC
LTV ratio
80%
85%
Deposited amount in USD
5.4 USD
0.1 USD
Borrowed amount in USD
0.1 USD
5 USD
Liquidation bonus
6%
7%
This is the example we used previously. HF is smaller than 1:
HF=0.1+50.8×5.4+0.85×0.1=5.14.405≤1
and RVrepaid asset=min(RVrepaid asset,min(DVrepaid asset,1+LFliquidated assetCVliquidated asset):
Therefore, we can only repay 1+LFXRP3=1.063=2.830188679.... in this scenario. HF will not be fully restored back to 1. The denominator exists to account for the liquidation bonus, so that we can get 3 USD as the value of captured collateral plus liquidation bonus, which is the maximum we can get from the deposited USDC collateral. But liquidation should still run regardless.
This is when the amount of debt to be repaid isn't enough to bring HF back to 1 because the user has multiple assets in debt, and this amount is smaller than the collateral that can be captured.