Moe0avavaav
Updated 2023-01-26Copy 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
›
⌄
--0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e
(select
'SWAP' as action,
date_trunc({{scale}},block_timestamp) as date,
count (distinct tx_hash) as txns,
sum(txns)over( order by date rows between unbounded preceding and current row ) as cumulative_txns,
count (distinct origin_from_address) as wallets,
sum(wallets)over( order by date rows between unbounded preceding and current row ) as cumulative_wallets,
sum (event_inputs:value/1e6) as value,
sum(value)over( order by date rows between unbounded preceding and current row ) as cumulative_value,
avg (event_inputs:value/1e6) as avg_value,
median (event_inputs:value/1e6) as median_value,
max (event_inputs:value/1e6) as max_value,
txns / wallets as txn_per_wallet,
value / wallets as value_per_wallet
from avalanche.core.fact_event_logs
where contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
and event_inputs:value/1e6 < 1e9
and tx_hash in (select tx_hash from avalanche.core.fact_event_logs
where event_name ilike 'Swap'
)
and block_timestamp >= '2022-07-01'
and tx_status = 'SUCCESS'
group by date)
union all
(select
'TRANSFER' as action,
date_trunc({{scale}},block_timestamp) as date,
count (distinct tx_hash) as txns,
Run a query to Download Data