kimmayyer-5963bridg3
Updated 2022-08-01
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 users_eth as (
select
origin_from_address,
tx_hash,
block_timestamp
from ethereum.core.fact_event_logs
WHERE origin_to_address = '0xa0c68c638235ee32657e8f720a23cec1bfc77c77'--polygon bridge
),
first_tx as (
SELECT
origin_from_address,
origin_to_address,
tx_hash,
block_timestamp,
event_name,
contract_name
FROM polygon.core.fact_event_logs
),
combine as (
SELECT
a.origin_from_address,
b.tx_hash,
b.event_name,
b.contract_name,
b.origin_to_address,
b.block_timestamp
FROM users_eth a INNER JOIN first_tx b ON a.origin_from_address = b.origin_from_address
WHERE b.block_timestamp > a.block_timestamp
),
ranks as (
SELECT
date_trunc('day', block_timestamp) as day,
COUNT(DISTINCT tx_hash) as txn,
project_name,
RANK() OVER (PARTITION BY day ORDER BY txn DESC) as rank
FROM combine a INNER JOIN polygon.core.dim_labels b on a.origin_to_address = b.address
Run a query to Download Data