# dNY

Members

2

0

1. ## Distribution coefficient

Thanks lot for these answers, guys! I completely got your solution @Sensei but I'm going to with @Ghideon's. It's an app in Solidity what I'm building so it makes more sense from a gas-saving perspective, but you introduced me to a concept that I've heard before but never really got into it until now.
2. ## Distribution coefficient

Hey guys, I'm building a financial app and I need some help with making a "distribution coefficient/index" (best math name I could give it). The idea behind it is: - There's a total balance. Let's call it "X". - There are users with different shares at stake on "X": A, B, C and D (users). - Each user has a % allocation depending on how much they have at stake on "X". Let's say: - A --> 10 units --> 10% - B --> 20 units --> 20% - C --> 30 units --> 30% - D --> 40 units --> 40% X = 100 ---> 100% I need a coefficient (let's call it "Y") capable of determining the new allocation % of each user once any of them has added more units to "X", and the formula to calculate this coefficient. It would be something like: oldUnits + newUnits - A --> 30 (10 + 20) --> Y --> 25% - B --> 20 --> Y --> 16.66% - C --> 30 --> Y --> 25% - D --> 40 --> Y --> 33.33% The limitations/constraints/requirements are: - The only parameter that I (my app) can freely modify is "Y". - The users are in charge of modifying their own stake of "units". - The % allocation is the result of the interaction of "units" with "Y" and it must return 100% when adding up the % allocation of all users. I don't have any high-level math background (mine it's business), so go easy on me please. Thanks a lot again for your help! Cheers.
×