aba1. test
Updated 2022-12-07Copy 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
›
⌄
⌄
⌄
select date_trunc(hour,block_timestamp) date, 'transfer' event_type, sum(event_inputs:value/power(10,6)) as total_volume,
avg(event_inputs:value/power(10,6)) as average_volume,
count(distinct tx_hash) as number_of_transactions,
count (distinct origin_from_address) as number_of_unique_users
from avalanche.core.fact_event_logs
where event_name = 'Transfer' and contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
and date(block_timestamp) >= '2022-07-01'
and tx_status = 'SUCCESS'
and tx_hash in (select distinct tx_hash
from avalanche.core.fact_event_logs
where event_name = 'Swap' and date(block_timestamp) >= '2022-07-01')
group by 1,2
order by 3 desc
/*with swaps_transactions as (
select * --, max(event_index) index
from avalanche.core.fact_event_logs
where event_name = 'Mint' and contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' --and tx_hash = '0x240f321909704160754811536c56d3c1089b4ead0291999cf41ebd643e1ec95e'
)
select *
from avalanche.core.fact_event_logs
where event_name = 'Transfer' and contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
and block_timestamp >= '2022-07-01' and tx_status = 'SUCCESS'
and tx_hash in (select tx_hash from swaps_transactions)
*/
/*select distinct tx_hash
from avalanche.core.fact_event_logs
where event_name = 'Transfer'
and contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
and tx_hash in (select tx_hash from swaps_transactions)
limit 100
/*
select top 100 *
from avalanche.core.fact_event_logs
where event_name = 'Swap'
and contract_address = '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e'
Run a query to Download Data