CryptoIcicleUntitled Query
    Updated 2021-09-11
    -- 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