Technical question #2
Unanswered
salvettileonardo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all, I'm doing quantitative research on RMM's lending data for a fund exploring a potential investment vehicle around tokenized real estate credit, and I've run into a question about the Repay event data.
When I sum Borrow amounts minus Repay amounts per user from the subgraph, the cumulative total goes slightly negative for a large share of users the moment they fully close out a position — typically by 3-7% of their peak debt. My working assumption is that the "amount" field on Repay includes accrued variable interest and isn't scaled back to pure principal via the variableBorrowIndex, so a full repayment naturally looks larger than the sum of the original borrows.
Could someone confirm: (1) does the Repay event's amount include accrued interest, or is it principal only, and (2) if it includes interest, is there a recommended way to recover the pure principal repaid (e.g. dividing by variableBorrowIndex at that block, or a specific field/entity in the subgraph that already separates the two)? Any pointers to docs or a specific person who'd know would be great. Thanks!
All reactions