Bài viết
Chia sẻ kiến thức của bạn.
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
Câu trả lời
1I 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
Bạn có biết câu trả lời không?
Hãy đăng nhập và chia sẻ nó.
Aave is a decentralized non-custodial liquidity protocol where users can participate as depositors or borrowers.
Kiếm phần của bạn từ 1000 Sui
Tích lũy điểm danh tiếng và nhận phần thưởng khi giúp cộng đồng Sui phát triển.
- 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