superflyUntitled Query
Updated 2022-07-31
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
›
⌄
---I have combined the table data with the polygon
WITH minor as (select origin_from_address,tx_hash,block_timestamp
from ethereum.core.fact_event_logs---I used the data in the tables--eth
WHERE origin_to_address = '0xa0c68c638235ee32657e8f720a23cec1bfc77c77'),
first_tx as (SELECT origin_from_address,origin_to_address,tx_hash,block_timestamp,event_name,contract_name
FROM polygon.core.fact_event_logs),---I used the data in the tables---polygon
MISH as(SELECT M.origin_from_address,W.tx_hash,W.event_name,W.contract_name,W.origin_to_address,W.block_timestamp
FROM minor M INNER JOIN first_tx W ON M.origin_from_address = W.origin_from_address
WHERE W.block_timestamp > M.block_timestamp),
rimd as (SELECT date_trunc('DAY', block_timestamp) as DAY,
COUNT(DISTINCT tx_hash) as Number_tx,project_name,
rank() OVER (PARTITION BY day ORDER BY Number_tx DESC) as rank
FROM MISH M INNER JOIN polygon.core.dim_labels W on M.origin_to_address = W.address
GROUP BY 1,3 ORDER BY Number_tx DESC)
SELECT DAY, Number_tx, project_name FROM rimd
WHERE rank <= 10---Top 10 most popular first destinations for Polygon addresses after bridge from ETH.
Run a query to Download Data