UserReserve currentATokenBalance/currentXXDebt don't count interest
Describe the bug currentATokenBalance, currentStableDebt, currentVariableDebt and currentTotalDebt return values without counting interest in.
To Reproduce For example, one user borrowed 1,000 USDC and his debt increased to 1,005 later, the currentTotalDebt will return 1,000,000,000 instead of 1,005,000,000.
Current balances will only update for a specific user on the subgraph when that user performs an action. To compute the current aToken balance you multiply the users scaledATokenBalance by reserve.liquidityIndex. liquidityIndex is a continuously increasing variable which tracks accrued interest for all suppliers, and is updated whenever any user interacts with the reserve
Much appreciated. Is there any way to calculate the current stable debt balance?
Yes, this explains the variables used in this calculation