Sbhn_NPShare of DEXs
    Updated 2022-09-29
    --credit : 0xHaM☰d
    with miner as (
    select
    DISTINCT miner
    from ethereum.core.fact_blocks
    where NETWORK='mainnet'
    )
    -- , swap as (
    SELECT
    'Selling ETH' as act,
    count(DISTINCT tx_hash) as swap_tx_cnt,
    count(DISTINCT SENDER) as uniq_swapper,
    sum(amount_in) as swap_eth_amt
    FROM ethereum.core.ez_dex_swaps
    WHERE SYMBOL_IN = 'WETH'
    AND BLOCK_NUMBER >= 15537351 -- 15,537,351 The merg block number

    UNION ALL
    SELECT
    'Buying ETH' as act,
    count(DISTINCT tx_hash) as swap_tx_cnt,
    count(DISTINCT SENDER) as uniq_swapper,
    sum(amount_out) as swap_eth_amt
    FROM ethereum.core.ez_dex_swaps
    WHERE SYMBOL_OUT = 'WETH'
    AND BLOCK_NUMBER >= 15537351 -- 15,537,351 The merg block number

    UNION ALL
    SELECT
    'Miner Selling ETH' as act,
    count(DISTINCT tx_hash) as swap_tx_cnt,
    count(DISTINCT SENDER) uniq_swapper,
    sum(amount_in) as swap_eth_amt
    FROM ethereum.core.ez_dex_swaps
    Run a query to Download Data