Alexaytop 10 first destination daily last month
Updated 2022-08-01Copy 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
›
⌄
with eth_txn as ( SELECT block_timestamp, from_address,
RANK() OVER(PARTITION BY from_address ORDER BY block_timestamp) as rank
FROM ethereum.core.fact_transactions
WHERE (to_address = '0xa0c68c638235ee32657e8f720a23cec1bfc77c77' --PoS Bridge
OR to_address = '0x401F6c983eA34274ec46f84D70b31C151321188b') -- Plasma Bridge
AND block_timestamp >= CURRENT_DATE -30),
eth_table as ( select *
from eth_txn
where rank =1),
combined_table as (
select pol.from_address as wallet,
pol.tx_hash,
pol.to_address,
pol.block_timestamp as pol_time,
eth.block_timestamp as eth_time
from polygon.core.fact_transactions pol
inner join eth_table eth
on eth.from_address = pol.from_address AND
pol.block_timestamp > eth.block_timestamp),
first_tx as (
select t.*, RANK() OVER(PARTITION BY t.wallet ORDER BY t.pol_time) as rank
from combined_table t),
first_txn as ( select *
from first_tx
where rank=1),
daily_users as ( select date_trunc('day', t.pol_time) as day,
count(t.wallet) as n_users,
t.to_address as address
from first_txn t
group by day, address
order by day desc),
Run a query to Download Data