RayyykAvalanche Swaps vs Transfers 4
Updated 2022-12-08Copy 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
›
⌄
with table_1 as (select date_trunc('hour', block_timestamp) as day,
'Mint' as action,
sum(event_inputs:value/1e6) as usdc_volume,
sum(usdc_volume) over (partition by action order by day) as cumu_usdc_volume,
count(distinct(origin_from_address)) as buyer_count
from avalanche.core.fact_event_logs
where contract_address = lower('0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E')
and event_inputs:value/1e6 < 999999999
and block_timestamp >= '2022-07-01'
and tx_status = 'SUCCESS'
and event_name = 'Mint'
group by 1
union
select date_trunc('hour', block_timestamp) as day,
'Burn' as action,
sum(event_inputs:value/1e6) as usdc_volume,
sum(usdc_volume) over (partition by action order by day) as cumu_usdc_volume,
count(distinct(origin_from_address)) as buyer_count
from avalanche.core.fact_event_logs
where contract_address = lower('0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E')
and event_inputs:value/1e6 < 999999999
and block_timestamp >= '2022-07-01'
and tx_status = 'SUCCESS'
and event_name = 'Burn'
group by 1)
select *
from table_1
order by 1 desc
Run a query to Download Data