hbd19947. Daily Inflow or Outflow
    Updated 2022-11-14
    with outflow as (select
    date(block_timestamp) as "Date",
    STAKE_POOL_NAME as "Staking Pool",
    case
    when action ilike '%deposit%' then 'Deposit'
    when action ilike '%withdraw%' then 'Withdraw'
    when action ilike '%order%' then 'Withdraw'
    else 'Claim' end as "Action Type",
    count (distinct tx_id) as "Number of Transactions",
    count (distinct address) as "Number of Users",
    sum (amount/1e9) as "Total Volume (SOL)",
    avg (amount/1e9) as "Average Volume (SOL)",
    max (amount/1e9) as "Maximum Volume (SOL)",
    min (amount/1e9) as "Minimum Volume (SOL)"
    from solana.core.fact_stake_pool_actions
    where succeeded = 'TRUE'
    and block_timestamp < CURRENT_DATE
    and block_timestamp >= CURRENT_DATE - 7
    and "Action Type" is not null
    and "Action Type" = 'Withdraw'
    group by 1 , 2 , 3
    order by 1),
    inflow as (select
    date(block_timestamp) as "Date",
    STAKE_POOL_NAME as "Staking Pool",
    case
    when action ilike '%deposit%' then 'Deposit'
    when action ilike '%withdraw%' then 'Withdraw'
    when action ilike '%order%' then 'Withdraw'
    else 'Claim' end as "Action Type",
    count (distinct tx_id) as "Number of Transactions",
    count (distinct address) as "Number of Users",
    sum (amount/1e9) as "Total Volume (SOL)",
    avg (amount/1e9) as "Average Volume (SOL)",
    max (amount/1e9) as "Maximum Volume (SOL)",
    min (amount/1e9) as "Minimum Volume (SOL)"
    Run a query to Download Data