Skip to content

Commit

Permalink
correct totalUSDborrowed calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
kree-dotcom committed Dec 12, 2022
1 parent 4fc80e6 commit 3d77c9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/Vault_Synths.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ contract Vault_Synths is Vault_Base_ERC20 {

//make sure the total isoUSD borrowed doesn't exceed the opening borrow margin ratio
uint256 colInUSD = priceCollateralToUSD(currencyKey, _colAmount + collateralPosted[_collateralAddress][msg.sender]);
uint256 totalUSDborrowed = _USDborrowed + (isoUSDLoaned[_collateralAddress][msg.sender] * virtualPrice)/LOAN_SCALE;
uint256 totalUSDborrowed = _USDborrowed + (isoUSDLoanAndInterest[_collateralAddress][msg.sender] * virtualPrice)/LOAN_SCALE;
require(totalUSDborrowed >= ONE_HUNDRED_DOLLARS, "Loan Requested too small");
uint256 borrowMargin = (totalUSDborrowed * minOpeningMargin) / LOAN_SCALE;
require(colInUSD >= borrowMargin, "Minimum margin not met!");
Expand Down

0 comments on commit 3d77c9f

Please sign in to comment.