Skip to content

Commit

Permalink
Fix collateral to pledge in erc20 invariants
Browse files Browse the repository at this point in the history
  • Loading branch information
prateek105 committed Jan 8, 2024
1 parent 1c1fd2a commit 085b8ac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ abstract contract UnboundedBasicERC20PoolHandler is UnboundedBasicPoolHandler, B

uint256 bucket = depositIndex - 1;
uint256 price = _poolInfo.indexToPrice(bucket);
uint256 collateralToPledge = ((COLLATERALIZATION_FACTOR * amount_ + price / 2) / price) * 101 / 100 + 1;
uint256 collateralToPledge = ((COLLATERALIZATION_FACTOR * amount_ + price / 2) / price) * 110 / 100 + _erc20Pool.collateralScale();

// ensure actor always has amount of collateral to pledge
_ensureCollateralAmount(_actor, collateralToPledge);
Expand Down

0 comments on commit 085b8ac

Please sign in to comment.