SleepyTop 20 users by Outflow Volume USD
    Updated 2023-04-19
    with cex_address as
    (
    select address, project_name from avalanche.core.dim_labels
    where label_type='cex'
    and label_subtype = 'deposit_wallet'
    )


    --outflow
    select
    from_address user,
    project_name CEX,
    count(distinct tx_hash) total_tx,
    sum(amount_usd) total_outflow_volume_usd,
    avg(amount_usd) avg_outflow_volume_usd
    from avalanche.core.ez_token_transfers transfers
    join cex_address
    on transfers.from_address = cex_address.address
    where block_timestamp::date >= current_date - 365 and amount_usd > 0
    group by from_address, project_name
    order by total_outflow_volume_usd desc
    limit 20





    Run a query to Download Data