Aave.

帖子

分享您的知识。

Aaveator.
Feb 17, 2023
专家问答

Is it possible to store interest-bearing tokens at the same address for different users within Aave?

Hey, can you help with a small question: Is it possible to store interest-bearing tokens at the same address for different users with the ability to calculate how much money each of them has?

Example: User 1 supplied 100 USDT year ago and User 2 supplied 10 USDT month ago. All aTokens I store at the same address. In total - supplied 110 USDT and I have, for example, 118.56 aUSDT.

Can I calculate how many aTokens each of them has from this total amount? I would be grateful for any advice!

  • Aave Protocol
  • aTokens
0
1
分享
评论
.

答案

1
Aaveator.
Feb 17 2023, 12:12

I think you could use the liquidityIndex at the time of supply for each time you supplied.

When you supply an asset your

scaledATokenBalance = amountSupplied / liquidityIndex

(at the time of supply). When you check the current balance of an aToken it is

scaledATokenBalance * liquidityIndex(current
0
评论
.

你知道答案吗?

请登录并分享。

我们使用 cookie 确保您在我们的网站上获得最佳体验。
更多信息