bachisolmad4
    Updated 2022-11-14
    select
    date(block_timestamp) as day,
    stake_pool_name as pool_name,
    case when action like '%deposit%' then 'Inflow'
    when action like '%withdraw%' then 'Outflow'
    else null
    end as flow_type,
    round(sum(amount/1e9),2) as total_volume,
    round(avg(amount/1e9),2) as avg_volume
    from solana.core.fact_stake_pool_actions
    where succeeded = 'TRUE'
    and block_timestamp >= dateadd('week', -1, getdate())
    and flow_type is not null
    and amount > 0
    group by day, pool_name, flow_type
    order by day desc


    Run a query to Download Data