permaryDEX SWAPS
    Updated 2024-09-24
    with uniswap AS
    (
    SELECT
    origin_from_address,
    tx_hash,
    FROM ethereum.defi.ez_dex_swaps
    WHERE block_timestamp :: date >= current_date - 31
    AND
    platform IN ('uniswap-v2','uniswap-v3')
    )

    SELECT uniswap.origin_from_address AS user,
    count (DISTINCT uniswap.tx_hash) AS n_swaps,
    count (DISTINCT nft.tx_hash) AS n_nft_purchases
    FROM uniswap
    JOIN ethereum.nft.ez_nft_sales AS nft
    ON uniswap.origin_from_address = nft.buyer_address
    WHERE nft.block_timestamp:: date >= current_date - 31
    GROUP BY user
    ORDER BY n_nft_purchases DESC
    LIMIT 100;











    --(
    --SELECT
    --platform,
    --count(DISTINCT tx_hash) AS n_swaps
    QueryRunArchived: QueryRun has been archived