BorrowLiquidation Logics
Here the logics used in Borrow Liquidation contract and BorrowLib are explained.
ETH price ratio
uint128 ratio = BorrowLib.calculateEthPriceRatio(
depositDetail.ethPriceAtDeposit,
_currentEthPrice
);function calculateEthPriceRatio(
uint128 depositEthPrice,
uint128 currentEthPrice
) public pure returns(uint128){
return (currentEthPrice * 10000)/depositEthPrice;
}Borrower Debt
uint256 borrowerDebt = (
(depositDetail.normalizedAmount * _lastCumulativeRate)/BorrowLib.RATE_PRECISION
);Return to ABOND
Liquidation Amount to get from other chain
CDS profits for Destination Chain
Param Name
Type
Description
Last updated