davidwallUntitled Query
    Updated 2023-01-14
    --credit : https://app.flipsidecrypto.com/velocity/queries/217a6a24-640d-4910-a9a1-a3aa79c524ab
    with cextable as (
    select distinct address from crosschain.core.address_labels
    where label_type = 'cex' and blockchain in ('ethereum','avalanche','arbitrum','binance smart chain','bsc','optimism','polygon')

    union ALL

    select distinct address from ethereum.core.dim_labels
    where label_type = 'cex'

    union all

    select distinct address from arbitrum.core.dim_labels
    where label_type = 'cex'

    union ALL

    select distinct address from avalanche.core.dim_labels
    where label_type = 'cex'
    union ALL
    select distinct address from bsc.core.dim_labels
    where label_type = 'cex'
    union ALL
    select distinct address from optimism.core.dim_labels
    where label_type = 'cex'

    union ALL
    select distinct address from polygon.core.dim_labels
    where label_type = 'cex'),

    maintable as (
    Run a query to Download Data