-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add PoolInfoUtilsMulticall support in updatePool #77
Conversation
…ve kickMomp and kickerAward
* add poolBalanceDetails to updatePool * update tests for usage of poolBalanceDetails * fix remaining tests --------- Co-authored-by: Mike <mikehathaway@makerdao.com>
…into info-multicall-v2
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.
Some comments inline.
I thought we were calling calculateLendRate
from places other than updatePool
, so was surprised to see no impact from other methods. I can test deployment on ushas
when time permits.
src/utils/constants.ts
Outdated
@@ -34,6 +34,9 @@ poolInfoUtilsAddressTable.set('matic', Address.fromString('0xA9Ada58DD3c820b30D3 | |||
poolInfoUtilsAddressTable.set('goerli', Address.fromString('0x08F304cBeA7FAF48C93C27ae1305E220913a571d')) | |||
poolInfoUtilsAddressTable.set('mumbai', Address.fromString('0x39250241CC84Dadb1cDFE3A1a717631e2aA603eB')) | |||
poolInfoUtilsAddressTable.set('ganache', Address.fromString('0xab56A77bDFe82b36875e92CE717fE533C1709A9D')) | |||
export const poolInfoUtilsMulticallAddressTable = new TypedMap<string, Address>() | |||
poolInfoUtilsMulticallAddressTable.set('goerli', Address.fromString('0x12874db433dBF1D0f3c73B39F96B009093A56E0E')) |
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.
That's the address for the old contract, before your most recent changes to the PR. The new one is at 0x49B8AAd62e1BBBA1A69CA8B3E24383F29828F718
.
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.
Updated to most recent deployment address
tests/utils/mock-contract-calls.ts
Outdated
mockGetPoolPricesInfo(pool, expectedPoolPricesInfo) | ||
|
||
const expectedRatesAndFeesInfo = new RatesAndFees( | ||
// FIXME: set correct lim value here |
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.
Does this FIXME need to be addressed?
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.
Removed, we're already checking values are being set and this would be a duplicate and more brittle mirror of the contract unit tests
src/utils/pool/pool.ts
Outdated
pool.quoteTokenBalance = wadToDecimal(poolBalanceDetails.quoteTokenBalance) | ||
// FIXME: If isNFT then don't convert wadToDecimal? | ||
pool.collateralBalance = wadToDecimal(poolBalanceDetails.collateralTokenBalance) | ||
// FIXME: update t0debt -> need to take into account pending debt? |
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.
No, t0debt
, by design, omits pending debt, which updates every block. To get pool debt, caller must query pending inflator directly from contract, and multiply by this t0debt
.
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.
Removed dead comments
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.
Would like to test this on ushas
.
* wip rc9 updates * update abis * update borrowerInfo interface; update comments and tests * fix test issues * add latest rc9 updates; fix tests --------- Co-authored-by: Mike <mikehathaway@makerdao.com>
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.
Updated addresses and ABIs. Was able to deploy to dev server pointing at today's Goerli deployment and query an empty pool.
updatePool
with 2.