NavidCopy of Copy of Copy of Untitled Query
Updated 2022-11-13Copy Reference Fork
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 pool_actions as (
SELECT
case
when action ilike '%deposit%' then 'Deposit'
when action ilike '%withdraw%' then 'Withdraw'
end as action_type,
*
from
solana.core.fact_stake_pool_actions
where
succeeded
), daily_pool_actions as (
select
action_type,
date_trunc('day', block_timestamp) as day,
-- count(distinct tx_id) as transactions_count,
-- count(distinct stake_pool_name) as pools_count,
sum(ifnull(amount, 0)/1e9) as volume
from
pool_actions
group BY
action_type, day
), daily_flow as (
select
day,
volume
from
daily_pool_actions
where
action_type='Deposit'
union all
select
day,
volume*-1
from
daily_pool_actions
Run a query to Download Data