cybergenlab[CEX Overview] Inflow & Outflows
    Updated 2024-11-16

    with deposits as (
    select
    date_trunc('day', eth.block_timestamp) as date,
    dl.label,
    eth.to_address as CEX_address,
    sum(eth.amount_usd) as usd_amount
    from ethereum.core.ez_native_transfers eth
    join ethereum.core.dim_labels dl
    on eth.to_address=dl.address
    where dl.label_type='cex'
    and dl.label_subtype='hot_wallet'
    and eth.amount_usd > 1
    and block_timestamp >= dateadd(month, -3, date_trunc('day',current_date()))
    and block_timestamp < date_trunc('day', current_date())
    group by 1,2,3
    union all
    select
    date_trunc('day', erc.block_timestamp) as date,
    dl.label,
    erc.to_address as CEX_address,
    sum(erc.amount_usd) as usd_amount
    from ethereum.core.ez_token_transfers erc
    join ethereum.core.dim_labels dl
    on erc.to_address=dl.address
    where dl.label_type='cex'
    and dl.label_subtype='hot_wallet'
    and erc.amount_usd > 1
    and block_timestamp >= dateadd(month, -3, date_trunc('day',current_date()))
    and block_timestamp < date_trunc('day', current_date())
    group by 1,2,3
    order by 1 desc
    )

    QueryRunArchived: QueryRun has been archived