I'm new to this so i apologise in advance for my lack of technical knowledge.
What I'm trying to is distribute an investment among people ( a closed group) using tokens, allowing people to buy and sell their stake as they choose.
so basically i want to create a coin with a fixed amount distributed amongst all users. The price of the coin is calculated by putting total coins equal to the portfolio growth €G in real time. When someone wants to invest say €K they buy €K worth of coins. The amount €K would then be added to the €G and the coin value would increase proportionally.
My questions: Would it be possible to have an algorithm that would redistribute all coins proportionally among every coin holder so that they have less coins but their total value remains the same. I know this can be done mathematically quite easily but is their a way to redistribute coins on Ethereum in such a way?
for example
10,000 C coins distributed G is worth €1,000 so each coin is worth C = 1,000/10,000 = €0.1 Person 1 and 2 have 5,000 C worth €500 each
Person 3 wants to buy 100 worth of coins. G is now worth €1,100 C = 1,100/10,000 = €0.11 Coins are redistributed in following manner 1 and 2 have (500/1,100)*10,000 = 4,545.45 C each 3 has (100/1,100)*10,000 = 909.09 C
The reason I want to keep a limited amount of tokens rather than distribute more is that the value of the coin will be pegged to the growth of the groups' investment and so the increase in coin value will be a direct indicator of the portfolio growth.
If anyone could just tell me whether this is possible or not before I invest too much time on it id appreciate it. And again, sorry for the lack of technical know-how !
Thanks !