Strobe Protocol
  • Introduction
  • Terminology
  • Products
  • Money market
    • Rationale
    • User guide
    • Architecture
      • Deposit and repayment
      • Withdrawal and borrowing
      • Liquidation
      • EVM Sidechain lending internals
    • Interest rate strategies
      • Interest rate strategy 1
    • Asset parameters
      • Definitions
      • Values
    • Overcollateralization and collateralization ratio
    • Health factor and liquidation
    • Oracle
    • Axelar
      • General message passing
      • Failure conditions and solutions
    • Risks
    • FAQ
  • Useful links
Powered by GitBook
On this page
  • Health factor
  • Amount to liquidate
  1. Money market

Health factor and liquidation

PreviousOvercollateralization and collateralization ratioNextOracle

Last updated 3 months ago

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

For liquidation, the health factor is calculated instead of .

Health factor=∑(LTV ratioi×Collateral Value in USDi)∑Borrowing Value in USDi\text{Health factor} = \frac{\sum (\text{LTV ratio}_i \times \text{Collateral Value in USD}_i)}{\sum \text{Borrowing Value in USD}_i}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=(0.9×5)+(0.9×1)2+0.3=(4.5)+(0.9)2.3=5.42.3=2.347\text{Health factor} = \frac{(0.9 \times 5) + (0.9 \times 1)}{2 + 0.3} = \frac{(4.5) + (0.9)}{2.3} = \frac{5.4}{2.3} = 2.347Health factor=2+0.3(0.9×5)+(0.9×1)​=2.3(4.5)+(0.9)​=2.35.4​=2.347

As it can be seen, 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 liquidator can liquidate that user and make it back to 1 or closer to 1.

Amount to liquidate

The liquidation must happen before the health factor drops 'too much'. 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 axlUSDC debt and taking away XRP collateral during liquidation:

Parameter
XRP
axlUSDC

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=∑(LTV ratioi×Collateral Value in USDi)∑Borrowing Value in USDi\text{Health factor} = \frac{\sum (\text{LTV ratio}_i \times \text{Collateral Value in USD}_i)}{\sum \text{Borrowing Value in USD}_i}Health factor=∑Borrowing Value in USDi​∑(LTV ratioi​×Collateral Value in USDi​)​

into

HFafter liquidation=LTVXRP×(CVXRP−RVaxlUSDC(1+LFXRP))+LTVaxlUSDC×CVaxlUSDCDVXRP+DVaxlUSDC−RVaxlUSDC\text{HF}_{\text{after liquidation}} = \frac{LTV_{XRP} \times (CV_{XRP} - RV_{axlUSDC}(1 + LF_{XRP})) + LTV_{axlUSDC} \times CV_{axlUSDC}}{DV_{XRP} + DV_{axlUSDC} - RV_{axlUSDC}}HFafter liquidation​=DVXRP​+DVaxlUSDC​−RVaxlUSDC​LTVXRP​×(CVXRP​−RVaxlUSDC​(1+LFXRP​))+LTVaxlUSDC​×CVaxlUSDC​​

where

  • HFafter liquidation\text{HF}_{\text{after liquidation}}HFafter liquidation​ is the health factor after liquidation takes place.

  • LTVasset\text{LTV}_{asset}LTVasset​ is the LTV ratio of an asset.

  • CVasset\text{CV}_{asset}CVasset​ is the value of an asset deposited as a collateral in USD.

  • RVasset\text{RV}_{asset}RVasset​ is the value of repayment on the debt of an asset in USD.

  • DVasset\text{DV}_{asset}DVasset​ is the value of the debt of an asset in USD.

  • LFasset\text{LF}_{asset}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−RVaxlUSDC(1+LFXRP))LTV_{XRP} \times (CV_{XRP} - RV_{axlUSDC}(1 + LF_{XRP}))LTVXRP​×(CVXRP​−RVaxlUSDC​(1+LFXRP​)) represents the discounted collateral left after a part of XRP collateral including the liquidation bonus is captured in exchange for the axlUSDC debt repayment by the liquidator. LTVaxlUSDC×CVaxlUSDCLTV_{axlUSDC} \times CV_{axlUSDC}LTVaxlUSDC​×CVaxlUSDC​ represents the discounted axlUSDC collateral. DVXRP+DVaxlUSDC−RVaxlUSDCDV_{XRP} + DV_{axlUSDC} - RV_{axlUSDC}DVXRP​+DVaxlUSDC​−RVaxlUSDC​ represents total debt after the axlUSDC debt repayment.

Let's rearrange the equation so we can solve for RVaxlUSDC\text{RV}_{axlUSDC}RVaxlUSDC​:

HFafter liquidation=LTVXRP×(CVXRP−RVaxlUSDC(1+LFXRP))+LTVaxlUSDC×CVaxlUSDCDVXRP+DVaxlUSDC−RVaxlUSDC\text{HF}_{\text{after liquidation}} = \frac{LTV_{XRP} \times (CV_{XRP} - RV_{axlUSDC}(1 + LF_{XRP})) + LTV_{axlUSDC} \times CV_{axlUSDC}}{DV_{XRP} + DV_{axlUSDC} - RV_{axlUSDC}}HFafter liquidation​=DVXRP​+DVaxlUSDC​−RVaxlUSDC​LTVXRP​×(CVXRP​−RVaxlUSDC​(1+LFXRP​))+LTVaxlUSDC​×CVaxlUSDC​​
  ⟹  HFafter liquidation(DVXRP)+HFafter liquidation(DVaxlUSDC)−HFafter liquidation(RVaxlUSDC)\implies \text{HF}_{\text{after liquidation}}(DV_{XRP}) + \text{HF}_{\text{after liquidation}}(DV_{axlUSDC}) - \text{HF}_{\text{after liquidation}}(RV_{axlUSDC})⟹HFafter liquidation​(DVXRP​)+HFafter liquidation​(DVaxlUSDC​)−HFafter liquidation​(RVaxlUSDC​)
=(LTVXRP)(CVXRP)−(RVaxlUSDC)(LTVXRP)(1+LFXRP))+(LTVaxlUSDC)(CVaxlUSDC)= (LTV_{XRP})(CV_{XRP}) - (RV_{axlUSDC})(LTV_{XRP})(1 + LF_{XRP})) + (LTV_{axlUSDC})(CV_{axlUSDC})=(LTVXRP​)(CVXRP​)−(RVaxlUSDC​)(LTVXRP​)(1+LFXRP​))+(LTVaxlUSDC​)(CVaxlUSDC​)
  ⟹  (RVaxlUSDC)(LTVXRP)(1+LFXRP))−HFafter liquidation(RVaxlUSDC\implies (RV_{axlUSDC})(LTV_{XRP})(1 + LF_{XRP})) - \text{HF}_{\text{after liquidation}}(RV_{axlUSDC}⟹(RVaxlUSDC​)(LTVXRP​)(1+LFXRP​))−HFafter liquidation​(RVaxlUSDC​
=−HFafter liquidation(DVXRP)−HFafter liquidation(DVaxlUSDC)+(LTVXRP)(CVXRP)+(LTVaxlUSDC)(CVaxlUSDC)= -\text{HF}_{\text{after liquidation}}(DV_{XRP}) -\text{HF}_{\text{after liquidation}}(DV_{axlUSDC}) + (LTV_{XRP})(CV_{XRP}) + (LTV_{axlUSDC})(CV_{axlUSDC})=−HFafter liquidation​(DVXRP​)−HFafter liquidation​(DVaxlUSDC​)+(LTVXRP​)(CVXRP​)+(LTVaxlUSDC​)(CVaxlUSDC​)
  ⟹  (RVaxlUSDC)((LTVXRP)(1+LFXRP))−HFafter liquidation)\implies (RV_{axlUSDC})((LTV_{XRP})(1 + LF_{XRP})) - \text{HF}_{\text{after liquidation}})⟹(RVaxlUSDC​)((LTVXRP​)(1+LFXRP​))−HFafter liquidation​)
=−HFafter liquidation(DVXRP+DVaxlUSDC)+∑i(LTVi×CVi)= -\text{HF}_{\text{after liquidation}}(DV_{XRP} + DV_{axlUSDC}) + \sum\limits_{i}{(LTV_i \times CV_i)}=−HFafter liquidation​(DVXRP​+DVaxlUSDC​)+i∑​(LTVi​×CVi​)
  ⟹  (RVaxlUSDC)((LTVXRP)(1+LFXRP))−HFafter liquidation)\implies (RV_{axlUSDC})((LTV_{XRP})(1 + LF_{XRP})) - \text{HF}_{\text{after liquidation}})⟹(RVaxlUSDC​)((LTVXRP​)(1+LFXRP​))−HFafter liquidation​)
=−HFafter liquidation(∑iDVi)+∑i(LTVi×CVi)= -\text{HF}_{\text{after liquidation}}(\sum\limits_{i}{DV_i}) + \sum\limits_{i}{(LTV_i \times CV_i)}=−HFafter liquidation​(i∑​DVi​)+i∑​(LTVi​×CVi​)
  ⟹  RVaxlUSDC=−HFafter liquidation(∑iDVi)+∑i(LTVi×CVi)((LTVXRP)(1+LFXRP))−HFafter liquidation\implies RV_{axlUSDC} = \frac{-\text{HF}_{\text{after liquidation}}(\sum\limits_{i}{DV_i}) + \sum\limits_{i}{(LTV_i \times CV_i)}}{((LTV_{XRP})(1 + LF_{XRP})) - \text{HF}_{\text{after liquidation}}}⟹RVaxlUSDC​=((LTVXRP​)(1+LFXRP​))−HFafter liquidation​−HFafter liquidation​(i∑​DVi​)+i∑​(LTVi​×CVi​)​

Now that we have the equation ready, substitute the variables. We know that:

HFafter liquidation≤1\text{HF}_{\text{after liquidation}} \le 1HFafter liquidation​≤1

so let's substitute:

HFafter liquidation=1\text{HF}_{\text{after liquidation}} = 1HFafter liquidation​=1

in this equation below:

RVaxlUSDC=−(1)(5+0.1)+(0.8×5.4+0.85×0.1)((0.8)(1+0.06))−1RV_{axlUSDC} = \frac{-(1)(5 + 0.1) + (0.8 \times 5.4 + 0.85 \times 0.1)}{((0.8)(1 + 0.06)) - 1}RVaxlUSDC​=((0.8)(1+0.06))−1−(1)(5+0.1)+(0.8×5.4+0.85×0.1)​

We can run this Python script to confirm the result:

RV_axlUSDC_NUMERATOR = (-1 * (0.1 + 5) + (0.8 * 5.4 + 0.85 * 0.1))
RV_axlUSDC_DENOMINATOR = ((0.8) * (1 + 0.06) - 1)
RV_axlUSDC = RV_axlUSDC_NUMERATOR / RV_axlUSDC_DENOMINATOR

print(RV_axlUSDC_NUMERATOR)
print(RV_axlUSDC_DENOMINATOR)
print(RV_axlUSDC)

HF_CHECK_NUMERATOR = 0.8 * (5.4 - RV_axlUSDC * (1 + 0.06)) + 0.85 * 0.1
HF_CHECK_DENOMINATOR = 5.1 - RV_axlUSDC
HF = HF_CHECK_NUMERATOR/HF_CHECK_DENOMINATOR

print(HF_CHECK_NUMERATOR)
print(HF_CHECK_DENOMINATOR)
print(HF)

The console will print:

-0.6949999999999994 # RV_axlUSDC_NUMERATOR
-0.1519999999999999 # RV_axlUSDC_DENOMINATOR
4.57236842105263 # RV_axlUSDC
0.5276315789473698 # HF_CHECK_NUMERATOR
0.5276315789473696 # HF_CHECK_DENOMINATOR
1.0000000000000004 # HF

Disregarding the floating point number errors, we can confirm that we deduced the correct RVaxlUSDCRV_{axlUSDC}RVaxlUSDC​.

We can now generalize the equation further, from:

RVaxlUSDC=−HFafter liquidation(∑iDVi)+∑i(LTVi×CVi)((LTVXRP)(1+LFXRP))−HFafter liquidationRV_{axlUSDC} = \frac{-\text{HF}_{\text{after liquidation}}(\sum\limits_{i}{DV_i}) + \sum\limits_{i}{(LTV_i \times CV_i)}}{((LTV_{XRP})(1 + LF_{XRP})) - \text{HF}_{\text{after liquidation}}}RVaxlUSDC​=((LTVXRP​)(1+LFXRP​))−HFafter liquidation​−HFafter liquidation​(i∑​DVi​)+i∑​(LTVi​×CVi​)​

to:

RVrepaid asset=−HFafter liquidation(∑iDVi)+∑i(LTVi×CVi)(LTVliquidated asset)(1+LF_liquidated asset)−HFafter liquidationRV_{\text{repaid asset}} = \frac{-\text{HF}_{\text{after liquidation}}(\sum\limits_{i}{DV_i}) + \sum\limits_{i}{(LTV_i \times CV_i)}}{(LTV_{\text{liquidated asset}})(1 + LF\_{\text{liquidated asset}}) - \text{HF}_{\text{after liquidation}}}RVrepaid asset​=(LTVliquidated asset​)(1+LF_liquidated asset)−HFafter liquidation​−HFafter liquidation​(i∑​DVi​)+i∑​(LTVi​×CVi​)​

However, in some cases where more than two assets are borrowed or deposited as collaterals, RVrepaid assetRV_{\text{repaid asset}}RVrepaid asset​ can exceed DVrepaid assetDV_{\text{repaid asset}}DVrepaid asset​ or CVliquidated assetCV_{\text{liquidated asset}}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\text{Final Repaid Amount}_{\text{repaid asset}}Final Repaid Amountrepaid asset​ needs to be reduced down to min(RVrepaid asset,min(DVrepaid asset,CVliquidated asset1+LFliquidated asset))min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}}))min(RVrepaid asset​,min(DVrepaid asset​,1+LFliquidated asset​CVliquidated asset​​)).

Below, we review all of the different possibilities for liquidation. We use axlUSDC=repaid asset\text{axlUSDC} = \text{repaid asset}axlUSDC=repaid asset, and XRP=liquidated asset\text{XRP} = \text{liquidated asset}XRP=liquidated asset.

  1. HF≥1\text{HF} \ge 1HF≥1

Parameter
XRP
axlUSDC

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.8×5.4+0.85×0.10.1≥1\text{HF} = \frac{0.8 \times 5.4 + 0.85 \times 0.1}{0.1} \ge 1HF=0.10.8×5.4+0.85×0.1​≥1
  1. HF≤1\text{HF} \le 1HF≤1 and RVrepaid asset=min(RVrepaid asset,min(DVrepaid asset,CVliquidated asset1+LFliquidated asset))RV_{\text{repaid asset}} = min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}}))RVrepaid asset​=min(RVrepaid asset​,min(DVrepaid asset​,1+LFliquidated asset​CVliquidated asset​​))

Parameter
XRP
axlUSDC

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.8×5.4+0.85×0.10.1+5=4.4055.1≤1\text{HF} = \frac{0.8 \times 5.4 + 0.85 \times 0.1}{0.1 + 5} = \frac{4.405}{5.1} \le 1HF=0.1+50.8×5.4+0.85×0.1​=5.14.405​≤1

and RVrepaid asset=min(RVrepaid asset,min(DVrepaid asset,CVliquidated asset1+LFliquidated asset)RV_{\text{repaid asset}} = min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}})RVrepaid asset​=min(RVrepaid asset​,min(DVrepaid asset​,1+LFliquidated asset​CVliquidated asset​​):

RVrepaid asset=−HFafter liquidation(∑iDVi)+∑i(LTVi×CVi)((LTVliquidated asset)(1+LFliquidated asset))−HFafter liquidationRV_{\text{repaid asset}} = \frac{-\text{HF}_{\text{after liquidation}}(\sum\limits_{i}{DV_i}) + \sum\limits_{i}{(LTV_i \times CV_i)}}{((LTV_{\text{liquidated asset}})(1 + LF_{\text{liquidated asset}})) - \text{HF}_{\text{after liquidation}}}RVrepaid asset​=((LTVliquidated asset​)(1+LFliquidated asset​))−HFafter liquidation​−HFafter liquidation​(i∑​DVi​)+i∑​(LTVi​×CVi​)​
  ⟹  RVaxlUSDC=−(1)(5+0.1)+(0.8×5.4+0.85×0.1)((0.8)(1+0.06))−1\implies RV_{\text{axlUSDC}} = \frac{-(1)(5 + 0.1) + (0.8 \times 5.4 + 0.85 \times 0.1)}{((0.8)(1 + 0.06)) - 1}⟹RVaxlUSDC​=((0.8)(1+0.06))−1−(1)(5+0.1)+(0.8×5.4+0.85×0.1)​
  ⟹  RVaxlUSDC=4.57236842105263...\implies RV_{\text{axlUSDC}} = 4.57236842105263...⟹RVaxlUSDC​=4.57236842105263...
  1. HF≤1\text{HF} \le 1HF≤1 and Final Repaid Amountrepaid asset=CVliquidated asset1+LFliquidated asset=min(RVrepaid asset,min(DVrepaid asset,CVliquidated asset1+LFliquidated asset)\text{Final Repaid Amount}_{\text{repaid asset}} = \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}} = min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}})Final Repaid Amountrepaid asset​=1+LFliquidated asset​CVliquidated asset​​=min(RVrepaid asset​,min(DVrepaid asset​,1+LFliquidated asset​CVliquidated asset​​)

Put simply, this is when the amount of collateral to be liquidated isn't enough to bring HF back to 1, because the user has multiple collaterals.

Parameter
XRP
axlUSDC

LTV ratio

80%

85%

Deposited amount in USD

3 USD

2.5 USD

Borrowed amount in USD

0.1 USD

5 USD

Liquidation bonus

6%

7%

Calculate HF first:

HF=0.8×3+0.85×2.50.1+5=4.5255.1≤1\text{HF} = \frac{0.8 \times 3 + 0.85 \times 2.5}{0.1 + 5} = \frac{4.525}{5.1} \le 1HF=0.1+50.8×3+0.85×2.5​=5.14.525​≤1
RVaxlUSDC=−(1)(5+0.1)+(0.8×3+0.85×2.5)((0.8)(1+0.06))−1=3.7828947368421026...RV_{\text{axlUSDC}} = \frac{-(1)(5 + 0.1) + (0.8 \times 3 + 0.85 \times 2.5)}{((0.8)(1 + 0.06)) - 1} = 3.7828947368421026...RVaxlUSDC​=((0.8)(1+0.06))−1−(1)(5+0.1)+(0.8×3+0.85×2.5)​=3.7828947368421026...
3.7828947368421026...≥CVXRP∵CVXRP=33.7828947368421026... \ge CV_{XRP} \because CV_{XRP} = 33.7828947368421026...≥CVXRP​∵CVXRP​=3
3.7828947368421026...≤DVaxlUSDC∵DVaxlUSDC=53.7828947368421026... \le DV_{axlUSDC} \because DV_{axlUSDC} = 53.7828947368421026...≤DVaxlUSDC​∵DVaxlUSDC​=5
  ⟹  Final Repaid AmountaxlUSDC=CVXRP1+LFXRP=min(RVrepaid asset,min(DVrepaid asset,CVXRP1+LFXRP)\implies \text{Final Repaid Amount}_{axlUSDC} = \frac{CV_{\text{XRP}}}{1 + LF_{\text{XRP}}} = min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{XRP}}}{1 + LF_{\text{XRP}}})⟹Final Repaid AmountaxlUSDC​=1+LFXRP​CVXRP​​=min(RVrepaid asset​,min(DVrepaid asset​,1+LFXRP​CVXRP​​)

Therefore, we can only repay 31+LFXRP=31.06=2.830188679....\frac{3}{1 + LF_{\text{XRP}}} = \frac{3}{1.06} = 2.830188679....1+LFXRP​3​=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 axlUSDC collateral. But liquidation should still run regardless.

Here's HFafter liquidation\text{HF}_{\text{after liquidation}}HFafter liquidation​:

HFafter liquidation=LTVXRP×(CVXRP−(Final Repaid AmountaxlUSDC)(1+LFXRP))+LTVaxlUSDC×CVaxlUSDCDVXRP+DVaxlUSDC−Final Repaid AmountaxlUSDC\text{HF}_{\text{after liquidation}} = \frac{LTV_{XRP} \times (CV_{XRP} - (\text{Final Repaid Amount}_{axlUSDC})(1 + LF_{\text{XRP}})) + LTV_{axlUSDC} \times CV_{axlUSDC}}{DV_{XRP} + DV_{axlUSDC} - \text{Final Repaid Amount}_{axlUSDC}}HFafter liquidation​=DVXRP​+DVaxlUSDC​−Final Repaid AmountaxlUSDC​LTVXRP​×(CVXRP​−(Final Repaid AmountaxlUSDC​)(1+LFXRP​))+LTVaxlUSDC​×CVaxlUSDC​​
=0+LTVaxlUSDC×CVaxlUSDCDVXRP+DVaxlUSDC−Final Repaid AmountaxlUSDC= \frac{0 + LTV_{axlUSDC} \times CV_{axlUSDC}}{DV_{XRP} + DV_{axlUSDC} - \text{Final Repaid Amount}_{axlUSDC}}=DVXRP​+DVaxlUSDC​−Final Repaid AmountaxlUSDC​0+LTVaxlUSDC​×CVaxlUSDC​​
=0+2.5×0.855.1−2.5=2.1252.6=0.81730769....= \frac{0 + 2.5 \times 0.85}{5.1 - 2.5} = \frac{2.125}{2.6} = 0.81730769....=5.1−2.50+2.5×0.85​=2.62.125​=0.81730769....

Notice that we will need to liquidate the other collateral to fully recover the health factor back to 1.

  1. DVrepaid asset=min(RVrepaid asset,min(DVrepaid asset,CVliquidated asset1+LFliquidated asset)DV_{\text{repaid asset}} = min(RV_{\text{repaid asset}}, min(DV_{\text{repaid asset}}, \frac{CV_{\text{liquidated asset}}}{1 + LF_{\text{liquidated asset}}})DVrepaid asset​=min(RVrepaid asset​,min(DVrepaid asset​,1+LFliquidated asset​CVliquidated asset​​)

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.

Parameter
XRP
axlUSDC

LTV ratio

80%

85%

Deposited amount in USD

5.4 USD

0.1 USD

Borrowed amount in USD

2.5 USD

2.6 USD

Liquidation bonus

6%

7%

Again, we are repaying axlUSDC and liquidating XRP:

RVaxlUSDC=−(1)(2.5+2.6)+(0.8×5.4+0.85×0.1)((0.8)(1+0.06))−1RV_{\text{axlUSDC}} = \frac{-(1)(2.5 + 2.6) + (0.8 \times 5.4 + 0.85 \times 0.1)}{((0.8)(1 + 0.06)) - 1}RVaxlUSDC​=((0.8)(1+0.06))−1−(1)(2.5+2.6)+(0.8×5.4+0.85×0.1)​
=4.57236842105263...= 4.57236842105263...=4.57236842105263...

This means we want to liquidate 4.57236842105263 USD equivalent of axlUSDC, but we cannot because the user only has 2.6 USD worth of axlUSDC in debt, thus:

Final repaid amountaxlUSDC=min(4.57236842105263,min(2.6,5.41.06))\text{Final repaid amount}_{axlUSDC} = min(4.57236842105263, min(2.6, \frac{5.4}{1.06}))Final repaid amountaxlUSDC​=min(4.57236842105263,min(2.6,1.065.4​))
=2.6= 2.6=2.6

This won't recover HF back to 1. It will require another liquidation to be run to repay axlUSDC and liquidate XRP.

collateralization ratio