adriaparcerisasavalanche euro platforms 1.5
Updated 2024-05-08
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
t1 as (
select trunc(block_timestamp,'week') as date,
platform,
count(distinct tx_hash) as txs,
sum(txs) over (partition by platform order by date) as cum_txs,
count(distinct origin_from_address) as users,
sum(case when token_in = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD') then amount_in else amount_out end) as volume,
avg(case when token_in = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD') then amount_in else amount_out end) as avg_volume,
avg(avg_volume) over (partition by platform order by date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW ) as avg_volume_ma_7hour,
sum(volume) over (partition by platform order by date) as cum_volume
from avalanche.defi.ez_dex_swaps
where (token_in = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD')
or token_out = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD'))
and block_timestamp >= '2023-05-25'
group by 1,2
),
t2_in as (
select trunc(block_timestamp,'week') as date,
project_name as platform,
count(distinct tx_hash) as txs,
sum(txs) over (partition by platform order by date) as cum_txs,
count(distinct origin_from_address) as users,
sum(amount) as volume,
avg(amount) as avg_volume,
avg(avg_volume) over (partition by platform order by date ROWS BETWEEN 6 PRECEDING AND CURRENT ROW ) as avg_volume_ma_7hour,
sum (volume) over (partition by platform order by date) as cum_volume
from avalanche.core.ez_token_transfers x
join avalanche.core.dim_labels y on x.origin_to_address=y.address
where contract_address = lower('0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD')
and block_timestamp >= '2023-05-25'
group by 1,2
),
t2_out as (
select trunc(block_timestamp,'week') as date,
QueryRunArchived: QueryRun has been archived