Aave.

Bài viết

Chia sẻ kiến thức của bạn.

Aaveator.
Jan 29, 2023
Hỏi đáp Chuyên Gia

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
0
1
Chia sẻ
Bình luận
.

Câu trả lời

1
Aaveator.
Feb 2 2023, 16:30

The 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.

0
Bình luận
.

Bạn có biết câu trả lời không?

Hãy đăng nhập và chia sẻ nó.

Chúng tôi sử dụng cookie để đảm bảo bạn có trải nghiệm tốt nhất trên trang web của chúng tôi.
Thêm thông tin