rezarwzStake chart based on volume and number of transactions
    Updated 2023-09-15
    with base as (
    SELECT
    fa.tx_id,
    date_trunc('month', fa.block_timestamp) as month,
    CASE
    when tx_to = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6' then 'Stake'
    when TX_FROM = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6' then 'UnStake'
    END as action,
    case
    when tx_to = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6' then TX_FROM
    when TX_FROM = 'BEYJqFx5G6whGmpJ4Ar9yyKfnDVBTcGWDSnJPPmsPWh6' then tx_to
    end as user_address,
    CASE
    when fa.mint = 'HxhWkVpk5NS4Ltg5nij2G671CKXFRKPK8vy271Ub4uEK' Then 'HXRO'
    when fa.mint = 'CPwspzHc4bKtBQGNRhpRG9v3qRiPLWP28GrfZepwmBSz' Then 'esHXRO'
    when fa.mint = '36VFoo1rQ7a1w45jBwHmr2sodnUUhRtL7K6fsx2tuMwb' Then 'L-HXRO'
    end as token_name,
    amount
    FROM
    solana.core.fact_transfers fa
    inner join solana.core.fact_events ev on ev.tx_id = fa.tx_id
    and ev.block_timestamp = fa.block_timestamp
    and ev.block_id = fa.block_id
    and ev.index = round(fa.index)
    WHERE
    fa.MINT in(
    'CPwspzHc4bKtBQGNRhpRG9v3qRiPLWP28GrfZepwmBSz',
    '36VFoo1rQ7a1w45jBwHmr2sodnUUhRtL7K6fsx2tuMwb',
    'HxhWkVpk5NS4Ltg5nij2G671CKXFRKPK8vy271Ub4uEK'
    )
    and ev.PROGRAM_ID = '2jmux3fWV5zHirkEZCoSMEgTgdYZqkE9Qx2oQnxoHRgA'
    and amount!=0)
    SELECT
    month,
    action,
    token_name,
    Run a query to Download Data