AToken uses a unit increase model, meaning a holder’s balance of aTokens will increment up as the asset pool grows from interest payments made by borrowers. For example, if you deposit 1 ETH in the Aave ETH pool you’ll be minted 1 aETH token. As the pool accumulates interest your aETH token balance will increment up so that your aETH token balance is greater than 1, reflecting your claim on a growing pool of assets. When an aETH token holder goes to redeem the underlying ETH their aETH will be redeemed 1:1 with the underlying ETH.
Suppose the above holder has held their aETH token for a year and they are looking to redeem their aETH balance for the underlying ETH. They notice that their aETH balance is now 1.05. This balance entitles them to 1.05 ETH of the existing ETH pool. If the aETH holder does redeem their aETH they will have earned .05 ETH in interest over that year, or 5% APY.
Multiply it by a factor(index) for each transfer so that it is equal to add more token for holders
aTokens
scaledBalanceOf()