diff --git a/contracts/Vault_Lyra.sol b/contracts/Vault_Lyra.sol index 68462b4..0e88484 100644 --- a/contracts/Vault_Lyra.sol +++ b/contracts/Vault_Lyra.sol @@ -176,13 +176,6 @@ contract Vault_Lyra is Vault_Base_ERC20{ ) = _getCollateral(_collateralAddress); //check for frozen or paused collateral _checkIfCollateralIsActive(currencyKey); - //debatable check begins here - uint256 totalCollat = collateralPosted[_collateralAddress][msg.sender] + _colAmount; - uint256 colInUSD = priceCollateralToUSD(currencyKey, totalCollat); - uint256 USDborrowed = (isoUSDLoanAndInterest[_collateralAddress][msg.sender] * virtualPrice) / LOAN_SCALE; - uint256 borrowMargin = (USDborrowed * liquidatableMargin) / LOAN_SCALE; - require(colInUSD >= borrowMargin, "Liquidation margin not met!"); - //debatable check ends here //update mapping with new collateral amount collateralPosted[_collateralAddress][msg.sender] = collateralPosted[_collateralAddress][msg.sender] + _colAmount; emit IncreaseCollateral(msg.sender, currencyKey, _colAmount); diff --git a/contracts/Vault_Synths.sol b/contracts/Vault_Synths.sol index 308b115..19fb2c0 100644 --- a/contracts/Vault_Synths.sol +++ b/contracts/Vault_Synths.sol @@ -166,13 +166,6 @@ contract Vault_Synths is Vault_Base_ERC20 { ) = _getCollateral(_collateralAddress); //check for frozen or paused collateral _checkIfCollateralIsActive(currencyKey); - //debatable check begins here - uint256 totalCollat = collateralPosted[_collateralAddress][msg.sender] + _colAmount; - uint256 colInUSD = priceCollateralToUSD(currencyKey, totalCollat); - uint256 USDborrowed = (isoUSDLoanAndInterest[_collateralAddress][msg.sender] * virtualPrice) / LOAN_SCALE; - uint256 borrowMargin = (USDborrowed * liquidatableMargin) / LOAN_SCALE; - require(colInUSD >= borrowMargin, "Liquidation margin not met!"); - //debatable check ends here //update mapping with new collateral amount collateralPosted[_collateralAddress][msg.sender] = collateralPosted[_collateralAddress][msg.sender] + _colAmount; emit IncreaseCollateral(msg.sender, currencyKey, _colAmount); diff --git a/contracts/Vault_Velo.sol b/contracts/Vault_Velo.sol index f163b22..cc2d8e0 100644 --- a/contracts/Vault_Velo.sol +++ b/contracts/Vault_Velo.sol @@ -483,11 +483,6 @@ contract Vault_Velo is RoleControl(VAULT_VELO_TIME_DELAY), Pausable { , uint256 virtualPrice ) = _getCollateral(_collateralAddress); - //We check adding the collateral brings the user above the liquidation point to avoid instantly being liquidated, poor UX - uint256 USDborrowed = (isoUSDLoanAndInterest[_collateralAddress][msg.sender] * virtualPrice) / LOAN_SCALE; - uint256 borrowMargin = (USDborrowed * liquidatableMargin) / LOAN_SCALE; - require(existingCollateral + addedValue >= borrowMargin, "Liquidation margin not met!"); - //update mapping with new collateral amount emit IncreaseCollateralNFT(msg.sender, currencyKey, addedValue); NFTids storage userNFTs = loanNFTids[_collateralAddress][msg.sender];