-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: add supply and borrower count to core pool #120
Conversation
150108b
to
7ab894b
Compare
0dae85e
to
8435df8
Compare
'MINT', | ||
'REDEEM', | ||
'BORROW', | ||
'REPAY', | ||
'SEIZE', | ||
'LIQUIDATE', | ||
'TRANSFER', | ||
'ENTER_MARKET', | ||
'EXIT_MARKET', |
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.
From the outside it looks the same as before, just that it's not using the constants declared above
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.
yeah this because of an assembly script error. I can investigate further
if (event.params.accountBorrows == event.params.borrowAmount) { | ||
// if both the accountBorrows and the borrowAmount are the same, it means the account is a new borrower | ||
market.borrowerCount = market.borrowerCount.plus(oneBigInt); | ||
market.borrowerCountAdjusted = market.borrowerCountAdjusted.plus(oneBigInt); |
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.
Question: does it make sense to apply the same dust rule here if you borrow a real small amount? Although I do see the difference between borrowing and liquidating
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 is an interesting question. It is unlikely that a user will borrow such a small amount but if they did I think it should count as a borrow because it was an action taken by a user.
In this case we are trying to differentiate between actually live positions and positions that were closed by liquidators but remained open because of dust
8435df8
to
b19bcf2
Compare
Adds supply and borrower count to core subgraph
A borrowerCountAdjusted value is added that removes accounts that were liquidated with only dust left