MLDZMNtfc8
Updated 2023-01-21
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
›
⌄
with tb1 as (select
BLOCK_TIMESTAMP,
from_address,tx_hash,
ROW_NUMBER() OVER (partition by from_address order by BLOCK_TIMESTAMP) as t_n
from optimism.core.fact_transactions
where STATUS='SUCCESS' and block_timestamp >= '2022-01-01'
),
tb2 as (select
BLOCK_TIMESTAMP as first_transaction,
from_address
from tb1
where t_n=1),
tb3 as (select
BLOCK_TIMESTAMP as second_transaction,
from_address
from tb1
where from_address in (select from_address from tb2)
and t_n=2)
,
tb4 as (select
tb2.from_address,
avg(timediff('day',first_transaction, second_transaction )) as time_between
from tb2
join tb3 on tb2.from_address=tb3.from_address
group by 1)
select
avg(time_between) as average_time
from tb4
Run a query to Download Data