hessTotal Number of users and transactions Chain to CEX
    Updated 2022-10-19
    with cex_address as (select address , project_name, blockchain
    from flipside_prod_db.crosschain.address_labels
    where label_type = 'cex' and label_subtype = 'hot_wallet'
    and blockchain in ( 'optimism' , 'polygon' , 'arbitrum' )
    )
    ,
    optimism as ( select date(block_timestamp) as date, from_address as address, tx_hash
    from optimism.core.fact_token_transfers
    where to_address in (select address from cex_address)
    and block_timestamp::date >= '2022-01-01')
    ,
    arbitrum as ( select date(block_timestamp) as date, from_address as address, tx_hash
    from arbitrum.core.fact_token_transfers
    where to_address in (select address from cex_address)
    and block_timestamp::date >= '2022-01-01')
    ,
    polygon as ( select date(block_timestamp) as date, from_address as address, tx_hash
    from polygon.core.fact_token_transfers
    where to_address in (select address from cex_address)
    and block_timestamp::date >= '2022-01-01')

    select 'Polygon' as chain, count(DISTINCT(address)) as total_user, count(DISTINCT(tx_hash)) as total_user_tx
    from polygon
    group by 1
    UNION
    select 'Arbitrum' as chain, count(DISTINCT(address)) as total_user, count(DISTINCT(tx_hash)) as total_user_tx
    from arbitrum
    group by 1
    UNION
    select 'Optimism' as chain, count(DISTINCT(address)) as total_user, count(DISTINCT(tx_hash)) as total_user_tx
    from optimism
    group by 1

    Run a query to Download Data