```\n//borrowPart and collateralPartInAsset should already be scaled due to the exchange rate computation\nuint256 liquidationStartsAt =\n    (collateralPartInAsset * _liquidationCollateralizationRate) / (10 ** ratesPrecision);///80% collateral value in asset in default\n\nif (borrowPart < liquidationStartsAt) return 0;\n\n//compute numerator\nuint256 numerator = borrowPart - liquidationStartsAt;\n//compute denominator\nuint256 diff =\n    (collateralizationRate * ((10 ** ratesPrecision) + _liquidationMultiplier)) / (10 ** ratesPrecision);\nint256 denominator = (int256(10 ** ratesPrecision) - int256(diff)) * int256(1e13);\n\n//compute closing factor\nint256 x = (int256(numerator) * int256(1e18)) / denominator;\n```\n