davidwallUntitled Query
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
›
⌄
--credit : https://app.flipsidecrypto.com/velocity/queries/aaa6df8f-1d66-416d-abdb-c61d13a5dabb
with receivetable as (
select block_timestamp as receive_date,
to_address as receiver1,
contract_address as token1
from optimism.core.fact_token_transfers
where block_timestamp::date >= '2022-12-17' and block_timestamp <= '2023-01-01'
union ALL
select block_timestamp as receive_date,
eth_to_address as receiver1,
'0x4200000000000000000000000000000000000006' as token1
from optimism.core.ez_eth_transfers
where block_timestamp::date >= '2022-12-17' and block_timestamp <= '2023-01-01')
select 'Optimism' as chain,
case when block_timestamp::Date >= '2022-12-24' and block_timestamp::Date < '2023-01-04' then 'Holidays'
else 'Other Days' end as timespan,
project_name,
count (distinct tx_hash) as TX_Count,
count (distinct origin_from_address) as Users_Count
from Optimism.core.fact_event_logs t1 join Optimism.core.dim_labels t2 on t1.origin_to_address = t2.address
join receivetable t3 on t1.origin_from_address = t3.receiver1 and t1.contract_address = t3.token1 and t1.block_timestamp > t3.receive_date
where block_timestamp::Date >= '2022-12-17'
and tx_status = 'SUCCESS'
group by 1,2,3
order by users_count DESC
limit 10
Run a query to Download Data