-
Notifications
You must be signed in to change notification settings - Fork 10
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
Update poolInfoUtils.borrowerInfo to return thresholdPrice #1017
Conversation
* charge fee on all deposit * unit tests compile * test harness updates * working on ERC20PoolQuoteTokenTest * removed deposit fee cap * more work on ERC20PoolQuoteTokenTest * do not charge deposit fee if moving liquidity to higher price
* this underflows instead of giving expected revert * move isCollateralized check after updating borrower collateral * remove local calculation of encumbered collateral * trying to properly fix testBorrowRepayPrecision * resolve rounding issue in fuzz test * testCollateralization improvements * updated unit tests for new _collateralization implementation * more collateralization tests * Add 1.04 factor in borrower collateralization * Update nptp ratio to '1 + sqrt(r)/2' * Remove Settle debt with pool reserves * Remove 0.995 factor from claimable reserves calculation * Update bond factor calculation to minimum 0.005 * added testcase where debt exceeds deposit * updated test so debt exceeds deposit * allow up to half of current orig fee to be used to settle bad debt * updated testTakeAndSettle * more test fixes * Enabled settling with all reserves if Deposits.treeSum==0 or 72 hrs pass * cleanup * Half orig fee res | Matt example (#966) * added Matts test as proof that attack no longer works on his branch * Revert "Remove multicall from position manager (#948)" (#961) This reverts commit f540c8a. * added test testSpendOrigFeePushBadDebtToBorrowers test * cleaned up testStealReservesWithMarginm to match minted balances * responded to Matts comments --------- Co-authored-by: Ian Harvey <iharvey@comcast.net> Co-authored-by: Mike Hathaway <mahathaway93@gmail.com> * Revert "Remove Settle debt with pool reserves" This reverts commit 290d6cf. * Update half origination fees reserves settlement time to 144 hours from kickTime * Fix alignment and extra spaces * Fix some unit tests * PR feedback * Update encumberance and collateralization method in poolInfoUtils * Fix some unit tests --------- Co-authored-by: Ed Noepel <ed@noepel.net> Co-authored-by: Ian Harvey <iharvey@comcast.net> Co-authored-by: mwc <matt@ajna.finance> Co-authored-by: Ian Harvey <ith.harvey@gmail.com> Co-authored-by: Mike Hathaway <mahathaway93@gmail.com>
…and ERC20PoolLiquidationsLenderKickAuctionTest
* fix most position manager tests * fix additional pm tests * fix rewards requiredCollateralRewards setup * fix ClaimRewards tests * update additional rewards manager tests * fix additional tests * more test fixes * commit wip bankruptcy tests * fixed testMoveLiquidityToOverwriteBankruptBucket * fix additional tests * fix testMoveLiquidityWithDebtInPool * fix remaining rewards manager tests --------- Co-authored-by: Mike <mikehathaway@makerdao.com> Co-authored-by: mwc <matt@ajna.finance>
* Add 1.04 factor in HTP calculations * Add COLLATERALIZATION_FACTOR constant in PoolHelpers * Add collateralization factor in dwatp * Fix poolPricesInfo * Update ERC20PoolBorrowFuzzyTest * Fix some unit tests * Fix some unit tests * Fix some unit tests * Update ERC20PoolTransferLPs * fix most rewards manager tests * update remaining rewards manager tests * update ERC721SubsetPoolBorrowTest and commit wip changes to testMergeOrRemoveERC721Collateral * updated testSettlePartialDebtSubsetPool (#988) * updated testSettlePartialDebtSubsetPool * re-added teardown --------- Co-authored-by: Ian Harvey <iharvey@comcast.net> * fix ERC721PoolCollateral tests * fix borrowRepayDebtFuzzy and additional PM tests * cleaned up testBorrowAndRepayWith4DecimalQuote --------- Co-authored-by: Mike <mikehathaway@makerdao.com> Co-authored-by: Ian Harvey <ith.harvey@gmail.com> Co-authored-by: Ian Harvey <iharvey@comcast.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment inline.
3d9fca3
to
de76f06
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, Added a comment
src/PoolInfoUtils.sol
Outdated
* @return debt_ Current debt owed by borrower (`WAD`). | ||
* @return collateral_ Pledged collateral, including encumbered (`WAD`). | ||
* @return t0Np_ `Neutral price` (`WAD`). | ||
* @return thresholdPrice_ Borrower's `Threshold Price` in t0 terms (`WAD`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I think
thresholdPrice_
is not int0
terms. - Nit: Natspec spacing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed -> 685f2e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok
Description
update poolInfoUtils.borrowerInfo interface
Intended for consumption by Subgraph.
Purpose
Impact
Tasks