CryptoIcicleUntitled Query
Updated 2021-09-11
999
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
›
⌄
-- What are the top 10 addresses on Polygon in terms of daily volume for MATIC, USDC, USDT, WETH, WBTC?
-- Analyze where these addresses are sending and receiving their funds to and from,
-- is there overlap in who the top 10 addresses interact with or are they fairly distinct?
-- Bonus: Use a network graph
WITH
TOP_10_COMBINED AS (
SELECT
DISTINCT(ORIGIN_ADDRESS) AS "ADDRESS",
COUNT(DISTINCT(TX_ID)) AS "VOLUME"
FROM polygon.udm_events
WHERE UPPER(SYMBOL) LIKE ('%MATIC%')
OR UPPER(SYMBOL) LIKE ('%USDC%')
OR UPPER(SYMBOL) LIKE ('%USDT%')
OR UPPER(SYMBOL) LIKE ('%WETH%')
OR UPPER(SYMBOL) LIKE ('%WBTC%')
GROUP BY 1
ORDER BY 2 DESC
LIMIT 10
)
,ADDR_1 AS (
SELECT
DISTINCT(ORIGIN_ADDRESS) AS "ADDRESS",
TO_ADDRESS,
COUNT(TO_ADDRESS)
FROM polygon.udm_events
WHERE ORIGIN_ADDRESS = (SELECT "ADDRESS" FROM TOP_10_COMBINED LIMIT 1 OFFSET 0)
AND (
UPPER(SYMBOL) LIKE ('%MATIC%')
OR UPPER(SYMBOL) LIKE ('%USDC%')
OR UPPER(SYMBOL) LIKE ('%USDT%')
OR UPPER(SYMBOL) LIKE ('%WETH%')
OR UPPER(SYMBOL) LIKE ('%WBTC%')
Run a query to Download Data