hbd19947. Daily Inflow or Outflow
Updated 2022-11-14
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
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