kiacryptoPercentage of miners transfer into each CEX
    Updated 2022-09-30
    with miners as (
    select miner
    from ethereum.core.fact_blocks
    ),
    users_transfer as (
    select
    label,
    sum(amount) as user_volume
    from ethereum.core.ez_eth_transfers join ethereum.core.dim_labels on origin_to_address = address
    where block_timestamp::date >= '2022-08-01' and block_timestamp::date < current_date and label_type = 'cex'
    group by 1
    ),
    miners_transfer as (
    select
    label,
    sum(amount) as miner_volume
    from ethereum.core.ez_eth_transfers join ethereum.core.dim_labels on origin_to_address = address
    where block_timestamp::date >= '2022-08-01' and block_timestamp::date < current_date and label_type = 'cex' and origin_from_address in (select miner from miners)
    group by 1
    )

    select u.label, (iff(miner_volume is null, 0, miner_volume) / user_volume) * 100 as miner_transfer_percentage
    from users_transfer u left join miners_transfer m on u.label = m.label


    Run a query to Download Data