JonasoPangolin (1)
Updated 2024-10-30
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
A as(
select date_trunc('month',block_timestamp) as time,
'Pangolin' as dex, platform,
-- case when platform like '%v1%' then 'v1' else 'v2' end as version,
sum(case when amount_out_usd is not null then amount_out_usd else amount_in_usd end) as volume,
count(distinct origin_from_address) as active_trader
from avalanche.defi.ez_dex_swaps
where year(block_timestamp) = '2024'
and platform like '%pangolin%'
group by 1,2,3 ),
B as(
select count(distinct origin_from_address) as trader
from avalanche.defi.ez_dex_swaps
where year(block_timestamp) = '2024'
and platform like '%pangolin%' )
select *, sum(volume) over(order by time) as total, (select trader from B) as trader
from A
order by time desc
QueryRunArchived: QueryRun has been archived