Post
Share your knowledge.
What is the easiest way to get the amount of interest accrued and gained on an account?
Hey! What is the easiest way to get the amount of interest accrued and gained on an account?
I'm trying to do it through the graph currently, but it seems like its much harder in V2 than in V1, where there was a field for this exact value.
Now I have no idea how I would go about calculating it at all
It feels like this is something that should be pretty straightforward? Any help would be appreciated
- Aave Protocol
- Borrow rate
Answers
1The easiest method in Aave v2 is to query the supplied amounts from the subgraph: https://github.com/aave/protocol-subgraphs#transaction-history and compare with the current balances: https://github.com/aave/aave-utilities#formatUserSummary
When amount will be the supplied amount from the subgraph and reserve.underlyingBalance
will the current balance from the formatter library
More info.
Do you know the answer?
Please log in and share it.
Aave is a decentralized non-custodial liquidity protocol where users can participate as depositors or borrowers.
- Error "No matching key" when trying to unstake USDC on BNB chain32
- How to tell the code to, rather than "deposit 1 eth worth of WBTC" deposit "500$ worth of WBTC"?22
- How to interpret configuration field in a response from the getReserveData view function in Aave v2?21
- Getting a return value of '25 - INVALID BURN AMOUNT'21
- Is there any way to stake in the security module on Görli?23