MLDZMNdx11
Updated 2022-09-16
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
›
⌄
with tb1 as (select
CONCAT(c.ADDRESS_NAME,' / ',b.ADDRESS_NAME) as asset_pairs,
count(tx_id) as swaps,
count(distinct swapper) as swappers
--sum(swaps) over (partition by SWAP_PROGRAM order by day) as cum_swaps
from solana.core.fact_swaps s join solana.core.dim_labels b on s.SWAP_TO_MINT=b.ADDRESS
join solana.core.dim_labels c on s.SWAP_FROM_MINT=c.ADDRESS
where SUCCEEDED='TRUE'
and BLOCK_TIMESTAMP>= '2022-05-01'
and c.ADDRESS_NAME!=b.ADDRESS_NAME
group by 1
order by 2 desc limit 10)
select
BLOCK_TIMESTAMP::date as day,
CONCAT(c.ADDRESS_NAME,' / ',b.ADDRESS_NAME) as asset_pairs,
count(tx_id) as swaps,
count(distinct swapper) as swappers,
sum(swaps) over (partition by asset_pairs order by day) as cum_swaps
from solana.core.fact_swaps s join solana.core.dim_labels b on s.SWAP_TO_MINT=b.ADDRESS
join solana.core.dim_labels c on s.SWAP_FROM_MINT=c.ADDRESS
where SUCCEEDED='TRUE'
and BLOCK_TIMESTAMP>= '2022-05-01'
and asset_pairs in (select asset_pairs from tb1)
group by 1,2
order by 1
Run a query to Download Data