saeedmznHXRO staking
    Updated 2023-09-15
    with stake_transactions as ( select
    'stake' type ,
    block_timestamp,
    amount ,
    tx_from wallet,
    tx_id
    from solana.core.fact_transfers
    where mint = 'HxhWkVpk5NS4Ltg5nij2G671CKXFRKPK8vy271Ub4uEK' -- HXRO token
    and tx_to = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6'
    ),
    unstake_transactions as (
    select 'unstake' type ,
    block_timestamp,
    amount ,
    tx_to wallet ,
    tx_id
    from solana.core.fact_transfers
    where mint = 'HxhWkVpk5NS4Ltg5nij2G671CKXFRKPK8vy271Ub4uEK' -- HXRO token
    and tx_from = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6'
    )
    select (sum(s.amount) - sum(u.amount)) currenly_staked_amount ,
    count (DISTINCT s.wallet) num_stakers ,
    count (DISTINCT u.wallet) num_unstakers ,
    count (DISTINCT s.tx_id) num_stake_transactions ,
    count (DISTINCT u.tx_id ) num_unstake_transactions
    from stake_transactions s , unstake_transactions u

    Run a query to Download Data