redirectStream to multiple addresses

It would be interesting to be able to give a mapping of addresses to a function working like the “redirectStream” function:

function redirectMultipleStreams( mapping(address -> int) redirectedAddresses ) {
uint memory totalPercentage;
for address in redirectedAddresses {
totalPercentage += redirectedAddresses[address]
}
requiere(totalPercentage == 100, "total percentage isn’t equal to 100);
Save the addresses linked to the percentages

It would redirect the profits to multiple addresses with a chosen percentage for each one.

It would allow people to pool their tokens to be able to borrow more or to avoid liquidation while still getting their profits.

Tell me if it’s clear enough

4 Likes

Interesting topic. I’m not sure how large the mapping can grow and how it would be managed, I think @Emilio and @eboado might have a better technical view on this.

That’s a great idea and something that would make redirecting interest much more useful! You could limit the mapping to a reasonable number of receiving addresses.

2 Likes