Miscalculate liquidation by using getIsolatedCollateralValue without call accrue beforehand
Summary
function getIsolatedCollateralValue using to computes the total USD value of the isolated collateral for a given position., and we should call accrue for corresponding isolated underlying collateral token of the position need to calculate. However, function isLiquidatable and _validateMaxLTV using getIsolatedCollateralValue not follow this rule.
Vulnerability Detail
function isLiquidatable determines if a given position can be liquidated based on its risk ratio. It already calculate the interest accrue of debt token in liquidate but not isolated underlying collateral token. It calls getPositionRisk to calculate the risk ratio of a specified position. However, getPositionRisk call getIsolatedCollateralValue without calling accrue before hand, leading to miscalculate risk ratio.
Impact
Interest accrual plays a crucial role in determining the liquidation threshold for a borrower's position. By missing the interest accrual, the outstanding debt and interest owed by the borrower may be underestimated. As a result, the liquidation threshold may not accurately reflect the borrower's actual risk exposure, potentially leading to a delayed or inaccurate liquidation process. Furthermore, if the interest accrual is not factored into the risk ratio calculation, lenders may not be compensated for the additional interest they are entitled to. This can lead to financial losses for lenders
RadCet
high
Miscalculate liquidation by using
getIsolatedCollateralValue
without callaccrue
beforehandSummary
function
getIsolatedCollateralValue
using to computes the total USD value of the isolated collateral for a given position., and we should callaccrue
for corresponding isolated underlying collateral token of the position need to calculate. However, functionisLiquidatable
and_validateMaxLTV
usinggetIsolatedCollateralValue
not follow this rule.Vulnerability Detail
function isLiquidatable determines if a given position can be liquidated based on its risk ratio. It already calculate the interest accrue of debt token in liquidate but not isolated underlying collateral token. It calls
getPositionRisk
to calculate the risk ratio of a specified position. However,getPositionRisk
callgetIsolatedCollateralValue
without callingaccrue
before hand, leading to miscalculate risk ratio.Impact
Interest accrual plays a crucial role in determining the liquidation threshold for a borrower's position. By missing the interest accrual, the outstanding debt and interest owed by the borrower may be underestimated. As a result, the liquidation threshold may not accurately reflect the borrower's actual risk exposure, potentially leading to a delayed or inaccurate liquidation process. Furthermore, if the interest accrual is not factored into the risk ratio calculation, lenders may not be compensated for the additional interest they are entitled to. This can lead to financial losses for lenders
Code Snippet
isLiquidatable
getPositionRisk
_validateMaxLTV
Tool used
Manual Review
Recommendation
Need to call
accrue
before calculate isolated collateral for a given position valueDuplicate of #16