I'm trying to do math to determine rewards for people staking their tokens in a cryptocurrency farming contract. The explorer for the contract has a button that exports a .csv file. Each line of the file is either a user staking (moving tokens from their wallet address to the contract address) or un-staking (moving tokens from the contract address to their wallet address). We need a file that can import the data from the .csv file and then determine who is still staking in the contract, how much they are staking, and what percentage of the total pool that represents.
The important fields in the csv file are From, To, DateTime, and Quantity
When the user's wallet address is in the "from" field and the contract address is in the "to" field that is them staking to the contract.
When the contract address is in the "from" field and their wallet address is in the "to" field that is them un-staking.
DateTime and Quantity tell us how many tokens were moved in or out of the contract and when they were moved.
We need to get a list of wallet addresses that still have tokens staked in the contract, and how many they have remaining, and what percentage of the total pool each wallet holds.
There would only be one field which requires a manual user input, and that would be the address of the contract, since we have multiple contracts that we may be calculating from.
I guess I have two problems 1) the best way to either pull the data into a sheet from the external csv file, or to paste formulae into the csv file? and 2) converting the unsorted from and to transactions into a total for each wallet.
Bookmarks