Find the debt allowed by the target
Let adjusted collateral be collateral value × liquidation threshold. Debt at the target equals adjusted collateral ÷ target health factor. Required repayment is max(0, current debt − debt at target). A positive target is essential because the formula divides by it. When the existing position already meets or exceeds the target, the calculator returns zero required repayment instead of suggesting that debt must be added.
Walk through the debt reduction
Imagine $12,000 of collateral with an 80% threshold and $8,000 of debt. Adjusted collateral is $9,600 and the starting health factor is 1.20. To target 1.60, remaining debt must equal $9,600 ÷ 1.60, or $6,000. The modeled repayment is therefore $2,000. A target of 2.00 would leave $4,800 of debt and require a $3,200 repayment, assuming every other input stays unchanged.
Separate repayment value from token quantity
The result is a repayment value in the currency used for debt and collateral. Converting it to debt-token units requires that token's price and may introduce spread or fees. Selling collateral to fund repayment changes the numerator, so this fixed-collateral calculation no longer applies unchanged. Zero debt needs no repayment. With zero adjusted collateral, clearing all debt removes borrowing, but it does not create a finite positive health factor from this ratio.