0xaimanGENE stake size
    Updated 2022-05-28

    select stake_size, count(user_addr) as n_address
    from (
    select user_addr,
    sum(gene_staked) as t_gene_staked,
    case when t_GENE_STAKED>=0 and t_gene_staked<100 then 'Small Fish staker'
    when t_GENE_STAKED>=100 and t_gene_staked<1000 then 'Shark staker'
    when t_gene_staked>=1000 then 'Whale staker'
    --else null
    end as stake_size
    from (select block_timestamp as t,
    instructions[0]:accounts[0] as user_addr,
    PRE_TOKEN_BALANCES,
    PRE_TOKEN_BALANCES[0]:uiTokenAmount:uiAmountString as gene_staked
    from solana.fact_transactions

    where --tx_id='5pviDajMbZYBoDfopXKwyd5cJGwJV3SCwXd288BC8xE8REVG8NHmWWPmnazJxumt1QK9xYMWZuBVMuSxnHuR9ecZ' AND
    instructions[0]:programId='StaKe9nb7aUjXpjpZ45o6uJBsZxj2BWCDBtjk8LCg2v')

    group by 1 order by 1
    )
    where t_gene_staked is not null

    group by 1 order by 1

    --where tx_id='65mbYpb65p7aFePkbsJQxCNKt4XNE6jny4dAYjKHzApmzAFEA9EqXo2uxVXJVimkVdakkTU3bzJJ1TJBmmih6tqJ'
    Run a query to Download Data