Suppose I have a pool that contains some coin say ETH. Imagine there are 100 users that benefit from this pool and I want to keep track of how much ETH in that pool is allocated to each user. When new rewards are sent to that pool (via a transaction) I want the allocation for each user to be updated.
Now when this transaction happens, to update allocations, I could keep track of the allocation of each user (via some mapping) and simply loop through all users and update the new allocation. This would be very gas inefficiant
I am looking for some suggestions that would make this work Thank you!!