Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update ajna contracts to rc10 / rc9.5 #529

Merged
merged 7 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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