Borrowing Logics
Here the logics used in Borrowing contract and BorrowLib are explained.
USDa to mint
function _transferToken(
address _borrower,
uint256 amount,
uint128 _ethPrice,
uint256 optionFees
)Param Name
Param Type
Description
uint256 tokensToLend = BorrowLib.tokensToLend(amount, _ethPrice, LTV);
bool minted = usda.mint(_borrower, (tokensToLend - optionFees));function tokensToLend(
uint256 depositedAmont,
uint128 ethPrice,
uint8 LTV
) public pure returns(uint256){
uint256 tokens = (depositedAmont * ethPrice * LTV) / (USDA_PRECISION * RATIO_PRECISION);
return tokens;
}ABOND to mint
Param Name
Type
Description
Normalized amount calculation
ABOND USDa Pool Calculation
Withdraw ETH calculation
Cumulative rate calculation
Param Name
Type
Description
Calculation of ratio of CDS Pool value to ETH vault value
Param Name
Type
Description
Downside Calculation
Options fees per second Calculation
Last updated