Eman-Raz71-4 Transfers to/from CEXs: Blast
    Updated 2025-03-22
    with squid_users as (select distinct data:call:transaction:from as user
    from axelar.axelscan.fact_gmp
    where data:approved:returnValues:contractAddress in
    ('0xce16F69375520ab01377ce7B88f5BA8C48F8D666',
    '0x492751eC3c57141deb205eC2da8bFcb410738630',
    '0xDC3D8e1Abe590BCa428a8a2FC4CfDbD1AcF57Bd9')
    and status = 'executed'
    and event = 'ContractCallWithToken'
    and simplified_status = 'received'
    and IS_CALL_FROM_RELAYER = 'false'
    and IS_INVALID_CALL = 'false'
    and IS_TWO_WAY = 'false'
    and gas_status = 'gas_paid_enough_gas'
    and (created_at::date >= '{{Start_Date}}' and created_at::date <= '{{End_Date}}')
    and data:value is not null),

    ---------------------------------------
    ---------------------------------------
    ---------------------------------------

    cex_interaction as (
    with withdraw as (

    with transfer_data as (
    select block_timestamp, tx_hash, amount, amount_usd, from_address, to_address as user
    from blast.core.ez_token_transfers),

    label_data as (select address, project_name
    from blast.core.dim_labels
    where label_type='cex')

    select user, project_name as cex, count(distinct tx_hash) as number_of_txns,
    sum(amount_usd) as volume_usd, 'Withdraw from CEXs' as "Action"
    from transfer_data left join label_data on transfer_data.from_address=label_data.address
    where project_name is not null
    group by 1,2),
    Auto-refreshes every 24 hours
    QueryRunArchived: QueryRun has been archived