In Ethereum some ERC20 tokens use a calculation to compute the balance, is not just a value stored in a map.
Take for example AAVE. When you deposit 100 USDT in AAVE, you get 100 aUSDT, this aUSDT is an AToken that represents your share in the pool and is 1:1 convertible back to USDT. Initially your balance is 100, but (simplifying a lot) if interest rate is 5%, and you ask aUSDT.balanceOf(me) after a year, you get 105.
Just for reference, this is the AAVE's AToken code: https://github.com/aave/protocol-v2/blob/master/contracts/protocol/tokenization/AToken.sol#L208
This would be possible with native tokens in Cardano? My understanding is no custom code is executed to get the balance (custom code is run in any other operation besides mint/burn?).
If not possible, what will be the best way to model something like this in Cardano.