misaghlbETH Down Bad - transfer
    Updated 2022-11-23
    with miner_wallets as (
    select DISTINCT miner from ethereum.core.fact_blocks where network='mainnet'
    ),
    cexs as (
    SELECT address FROM ethereum.core.dim_labels WHERE LABEL_TYPE = 'cex'
    )
    SELECT
    date(block_timestamp) as date,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as senders,
    sum(amount) as vol,
    'Non-Miner to Cex' as type
    FROM ethereum.core.ez_eth_transfers
    WHERE block_timestamp >= '2022-11-01'
    AND ORIGIN_TO_ADDRESS in (SELECT address from cexs)
    AND ORIGIN_FROM_ADDRESS not in (SELECT address from cexs)
    GROUP by date
    UNION ALL
    SELECT
    date(block_timestamp) as date,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as senders,
    sum(amount) as vol,
    'Miners to Cex' as type
    FROM ethereum.core.ez_eth_transfers
    WHERE block_timestamp >= '2022-11-01'
    AND ORIGIN_FROM_ADDRESS in (SELECT miner from miner_wallets)
    AND ORIGIN_TO_ADDRESS in (SELECT address from cexs)
    AND ORIGIN_FROM_ADDRESS not in (SELECT address from cexs)
    GROUP by date

    UNION ALL

    SELECT
    date(block_timestamp) as date,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as senders,
    Run a query to Download Data