Afonso_DiazNet staked
Updated 2024-09-17
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
›
⌄
with
main as (
select
tx_hash,
block_timestamp,
amount,
iff(from_address = '0x0000000000000000000000000000000000000000', 'Mint', 'Redeem') as event_type,
origin_from_address as user
from
avalanche.core.ez_token_transfers
where
contract_address = '0x698c34bad17193af7e1b4eb07d1309ff6c5e715e'
and '0x0000000000000000000000000000000000000000' in (from_address, to_address)
and origin_to_address is not null
)
select * from (
select
date_trunc('{{ period }}', block_timestamp) as date,
sum(iff(event_type = 'Mint', 1, -1) * amount) as net_volume,
sum(net_volume) over (order by date) as cumulative_net_volume
from
main
group by 1
)
where
date between '{{ start_date }}' and '{{ end_date }}'
order by date
QueryRunArchived: QueryRun has been archived