jackguyBridger Destinations 4
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
›
⌄
with tab1 as (
select
from_address,
min(date_trunc('week', block_timestamp)) as min_week
FROM ethereum.transactions
WHERE to_label = 'polygon'
AND to_label_subtype = 'bridge'
GROUP BY 1
), tab2 as (
SELECT
ORIGIN_FROM_ADDRESS,
min(block_timestamp) as mbt
FROM polygon.core.fact_event_logs
WHERE ORIGIN_FROM_ADDRESS in (SELECT from_address from tab1)
GROUP BY 1
)
SELECT
project_name,
count(*)
FROM polygon.core.fact_event_logs
LEFT outer JOIN tab2
ON tab2.ORIGIN_FROM_ADDRESS = polygon.core.fact_event_logs.ORIGIN_FROM_ADDRESS
AND tab2.mbt = block_timestamp
LEFT outer JOIN polygon.core.dim_labels
on contract_address = address
WHERE mbt is not NULL
AND not contract_address is NULL
and not project_name is NULL
GROUP BY 1
ORDER by 2 DESC
LIMIT 10
Run a query to Download Data