Skip to content

Commit

Permalink
Merge pull request #529 from OasisDEX/kk/sc-13156/sc-adjust-tests-and…
Browse files Browse the repository at this point in the history
…-proxy-actions-to-rc10

chore: update ajna contracts to `rc10` / `rc9.5`
  • Loading branch information
halaprix authored Dec 4, 2023
2 parents 5ac6d46 + 8276645 commit f5ef781
Show file tree
Hide file tree
Showing 18 changed files with 953 additions and 811 deletions.
7 changes: 4 additions & 3 deletions packages/ajna-contracts/contracts/ajna/PoolInfoUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import {
_priceAt,
_reserveAuctionPrice,
MAX_FENWICK_INDEX,
MIN_PRICE
MIN_PRICE,
COLLATERALIZATION_FACTOR
} from "./libraries/helpers/PoolHelper.sol";

import { Buckets } from "./libraries/internal/Buckets.sol";
Expand Down Expand Up @@ -441,7 +442,7 @@ contract PoolInfoUtils {
* @return encumberance_ Encumberance value.
*/
function _encumberance(uint256 debt_, uint256 price_) pure returns (uint256 encumberance_) {
return price_ != 0 ? Maths.wdiv(Maths.wmul(1.04 * 1e18, debt_), price_) : 0;
return price_ != 0 ? Maths.wdiv(Maths.wmul(COLLATERALIZATION_FACTOR, debt_), price_) : 0;
}

/**
Expand All @@ -457,7 +458,7 @@ function _collateralization(uint256 debt_, uint256 collateral_, uint256 price_)

// borrower is undercollateralized when lup at MIN_PRICE
if (price_ == MIN_PRICE) return 0;
return Maths.wdiv(Maths.wmul(collateral_, price_), Maths.wmul(1.04 * 1e18, debt_));
return Maths.wdiv(Maths.wmul(collateral_, price_), Maths.wmul(COLLATERALIZATION_FACTOR, debt_));
}

/**
Expand Down
Loading

0 comments on commit f5ef781

Please sign in to comment.