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

Readable order of operations #917

Merged
merged 2 commits into from
Jun 30, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/libraries/external/PoolCommons.sol
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ library PoolCommons {
if (poolState_.debt != 0) {
// calculate meaningful actual utilization for interest rate update
mau = int256(_utilization(debtEma_, depositEma_));
mau102 = mau * PERCENT_102 / 1e18;
mau102 = (mau * PERCENT_102) / 1e18;
}

// calculate target utilization
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/helpers/PoolHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ import { Maths } from '../internal/Maths.sol';
uint256 collateral_,
uint256 momp_
) pure returns (uint256 bondFactor_, uint256 bondSize_) {
uint256 thresholdPrice = borrowerDebt_ * Maths.WAD / collateral_;
uint256 thresholdPrice = (borrowerDebt_ * Maths.WAD) / collateral_;

// bondFactor = min(30%, max(1%, (MOMP - thresholdPrice) / MOMP))
if (thresholdPrice >= momp_) {
Expand Down