Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding data collection to thegraph #263

Open
Shloyem opened this issue Jun 16, 2022 · 2 comments
Open

Adding data collection to thegraph #263

Shloyem opened this issue Jun 16, 2022 · 2 comments
Assignees

Comments

@Shloyem
Copy link
Contributor

Shloyem commented Jun 16, 2022

Think and plan about adding data collection to thegraph for: GoodStaking, DistributionHelper, GoodDollarMintBurnWrapper, invite contracts

  1. What are the entities we are going to collect data for
  2. What global statistics/per address aggregated data we want to collect
@Shloyem Shloyem self-assigned this Jun 16, 2022
@Shloyem
Copy link
Contributor Author

Shloyem commented Jun 22, 2022

GoodDollarMintBurnWrapper

Maybe need more data that will be time dependent

MinterObj

  • address
  • totalMintCap
  • PerTxCap
  • bps
  • isRewardsRole
  • totalMinted
  • totalBurned
  • Maybe totalRewards (sent + minted)

Removed writing single actions

globalStats

  • totalMintCap
  • totalMinted
  • totalMintDebt
  • totalRewards
  • totalBurned

#### MintAction
- day
- MinterObj - increase obj totalMinted, maybe total sent
- StakerObj - increase obj outstandingDebt, maybe create a rewardsReceived (sent+minted)
- amount
- minted,
- sent

GoodDollarStaking

ContractStakeHistory(key: contract_daytime) (aggregation per day)

totalTokenStaked = contractStats.totalTokenStaked
totalUSDStaked = contractStats.totalUSDStaked
contract
day
supporters.push(supporter.id)
opValues.push(tokenValue)
goodEarned = contractStats.goodEarned
gdEarned = contractStats.gdEarned

avgDonationRatio = contractStats.avgDonationRatio
transferred (add event) = contractStats.transferred?

stakeStats (global statistics)

totalTokenStaked += tokenValue
totalUSDStaked += usdValue
totalGoodEarned += goodEarned
totalGdEarned += gdEarned

avgDonationRatio (calculate)
transferred (add event)?

contractStats (key: contract)

totalTokenStaked += tokenValue
totalUSDStaked += usdValue
totalGoodEarned += goodEarned
totalGdEarned += gdEarned

avgDonationRatio (query contract)
apy or gdInterestRatePerBlock?
monthlyGood or goodRewardPerBlock
transferred (add event)? += transffered
goodTotalRewardsPerShare
gdTotalRewardsPerShare

gdRewardsDebt(global pending rewards)
goodTotalPendingRewards - can be calculated by totalRewardsPerShare * total shares
gdTotalRewardsPaid
gdTotalRewardsDonated
check if there's goodTotalRewardsPaid
I dont think that principle?

stakingHistory (key: daytime) day statistics of the global

stakingContracts.push(contractHistory.id)
totalUSDStaked = stakeStats.totalUSDStaked
totalTokenStaked = stakeStats.totalTokenStaked
avgDonationRatio = stakeStats.avgDonationRatio
transferred (add event)? = stakeStats.transferred

supporter (key: stakerAddress)

totalUSDStaked += usdValue
totalGoodEarned += goodEarned
totalGdEarned += gdEarned

avgDonationRatio (query contract)
pendingGoodRewards
pendingGDRewards
gdRewardsPaid
gdRewardsDonated
check if there's goodRewardsPaid

Not adding transferred from or to.
No using Good staker info: UserInfo: amount, rewardDebt, rewardEarn, rewardMinted

About undoReward - we should add an event for it

@Shloyem
Copy link
Contributor Author

Shloyem commented Jun 22, 2022

DistributionHelper.sol

DistributionHelper

  • address
  • totalDistributed += distributedAmount
  • DistributionActions.push(DistributionAction.id)
  • Recipients (ever)

DistributionAction

  • id
  • DistributionHelperObj
  • distributedAmount
  • Recipients (that moment) - Printing a dynamic list has risk of becoming too big - gas too low, so we can do it under some size assumption

Recipient

  • address
  • bps
  • chainId
  • totalReceived
    - transferType

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant