Manage Wallets And Earnings
Last updated
Was this helpful?
Last updated
Was this helpful?
The revenue distribution is by default defined by two variables in the smart contract:
Takes 1% of data union revenue, governed by the Data Union DAO, earnings get allocated to the protocolBeneficiary address.
Admin fee ():
Takes x% of data union revenue, can be changed at any time by the admin (previous earnings are not affected when changed), earnings get allocated to the admin/owner address
Individual member earnings:
Is calculated as follows:
totalMemberEarnings
= revenue - (revenue * (adminFee + protocolFee))
individualMemberEarnings =
totalMemberEarnings
/ allActiveMembers
You need to manually refresh the revenue if you don't use the Streamr Marketplace as your revenue source or you don't use a ERC677 token .
Whenever your data union contract receives token aka revenue you need to refresh it after the transaction before users can withdraw or see their earnings.
The revenue then gets refreshed after every withdraw call.
Members can check their earnings (minus earlier withdrawals) like this:
You can individually assign weights to members if you don't want them to get rewarded equally.
Don't change the weights too often as this will result in defeating the purpose of saving transactions/transaction fees. Try to minimize changing the weight factor as good as you can.
Example:
0x1234
1
2000
0x4321
1
2000
0xabcd
0.5
1000
Calculation:
totalWeight
= 2.5
receivedRevenue
= 5000 token
baseEarnings
= receivedRevenue
/ totalWeight
= 5000 / 2.5 = 2000
Earnings for each member:
addr1 = weight * baseEarnings
= 1 * 2000 = 2000
addr2 = weight * baseEarnings
= 1 * 2000 = 2000
addr3 = weight * baseEarnings
= 0.5 * 2000 = 1000
Members are identified by an Ethereum address. The address is used to authenticate the member by signing requests with their associated private key.
If your users don't have crypto wallets you can generate a wallet address yourself and store it securely on a server:
The data-producing application can generate the keys when it is launched for the first time, and store the information locally or the user may connect their existing wallet. The private key should always stay on the device and it should never be sent over the internet.
Storing the private key in encrypted form is recommended. One way to approach this is to encrypt it using a user-defined password. If the key is stored encrypted, the key needs to be decrypted when the application starts. The decrypted version should be kept in memory, as it is continuously needed for signing data.
Learn more about adding members
Enable your users to connect their own wallet and join via a