SalehSolana Protocol Feature-pools weekly
Updated 2022-07-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
›
⌄
with lst_top_pools as (
select top 10
SWAP_FROM_MINT || '=>' || SWAP_TO_MINT as pool_address
,(select min( LABEL) from solana.core.dim_labels where ADDRESS=SWAP_FROM_MINT) ||'=>'
||(select min( LABEL) from solana.core.dim_labels where ADDRESS=SWAP_TO_MINT) as pool_name
,count(tx_id) as tx_count
,count(DISTINCT swapper) as wallets
from solana.core.fact_swaps
where block_timestamp::date>='2022-01-01'
and SWAP_PROGRAM='raydium v4'
and SUCCEEDED=true
group by 1,2
order by tx_count DESC
)
select
date_trunc(week,block_timestamp)::date as weekly
,(select min( LABEL) from solana.core.dim_labels where ADDRESS=SWAP_FROM_MINT) ||'=>'
||(select min( LABEL) from solana.core.dim_labels where ADDRESS=SWAP_TO_MINT) as pool_name
,count(tx_id) as tx_count
,count(DISTINCT swapper) as wallets
,sum(SWAP_FROM_AMOUNT) as from_amount
,sum(SWAP_TO_AMOUNT) as to_amount
,sum(tx_count) over (partition by pool_name order by weekly) as growth_tx
,sum(wallets) over (partition by pool_name order by weekly) as growth_wallets
from solana.core.fact_swaps
where block_timestamp::date>='2022-01-01'
and SWAP_PROGRAM='raydium v4'
and SUCCEEDED=true
and SWAP_FROM_MINT || '=>' || SWAP_TO_MINT in (select pool_address from lst_top_pools )
group by 1,2
order by 1
Run a query to Download Data