hessTotal Activities
    Updated 2023-10-13
    with program as ( select date(block_timestamp) as date, program_id, signers[0] as user, tx_id
    from solana.core.fact_events
    where program_id in ('STkwf3sbMapjy7KV3hgrJtcVvY4SvRxWQ8pj4Enw1i5','StaKe9nb7aUjXpjpZ45o6uJBsZxj2BWCDBtjk8LCg2v',
    'ATLocKpzDbTokxgvnLew3d7drZkEzLzDpzwgrgWKDbmc')
    and date >= CURRENT_DATE - 120)
    ,
    users as ( select DISTINCT user, program_id,case when program_id like 'STkw%' then 'Aurory'
    when program_id like 'ATLocK%' then 'Star Atlas' else 'Genopets' end as type
    from program
    where date <= CURRENT_DATE - 1)
    ,
    transfer as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_transfers a join users b on a.tx_from = b.user
    where date >= CURRENT_DATE - 120)
    ,
    swap as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_swaps a join users b on a.SWAPPER = b.user
    where date >= CURRENT_DATE - 120)
    ,
    staking as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_staking_lp_actions a join users b on a.SIGNERS[0] = b.user
    where date >= CURRENT_DATE - 120
    and EVENT_TYPE = 'delegate')
    ,
    voting as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_proposal_votes a join users b on a.VOTER = b.user
    where date >= CURRENT_DATE - 120)
    ,
    mint as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_nft_mints a join users b on a.PURCHASER = b.user
    where date >= CURRENT_DATE - 120)
    ,
    nft_sales as ( select date(block_timestamp) as date, type, user , tx_id
    from solana.core.fact_nft_sales a join users b on a.PURCHASER = b.user
    where date >= CURRENT_DATE - 120)
    ,
    Run a query to Download Data