Afonso_DiazOvertime
Updated 2024-02-16
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 t as (
select
tx_hash,
block_timestamp,
nvl(a.decoded_log:from, a.decoded_log:sender) as user,
b.decoded_log:value/1e18 as amount_usd,
a.contract_name as symbol_in,
b.contract_name as symbol_out
from ethereum.core.ez_decoded_event_logs a
join ethereum.core.ez_decoded_event_logs b
using(tx_hash, block_timestamp)
where a.origin_function_signature = '0x3df02124'
and a.event_name = 'Transfer'
and nvl(a.decoded_log:to, a.decoded_log:receiver) = origin_to_address
and nvl(a.decoded_log:to, a.decoded_log:receiver) = nvl(b.decoded_log:from, b.decoded_log:sender)
and user = nvl(b.decoded_log:to, b.decoded_log:receiver)
and b.event_name = a.event_name
and b.contract_address = '0x4c9edd5852cd905f086c759e8383e09bff1e68b3'
and a.contract_address != b.contract_address
and a.tx_status = 'SUCCESS'
and block_timestamp::date = '2024-02-15'
),
t2 as (
select
date_trunc('hour', min_date) as date,
count(distinct user) as new_user
from (
select
user,
min(block_timestamp) as min_date
from t
group by 1
)
group by 1
),
QueryRunArchived: QueryRun has been archived