MLDZMNsolcex1 copy
    Updated 2023-07-18
    -- forked from solcex1 @ https://flipsidecrypto.xyz/edit/queries/278ac264-cd1b-45ed-94a2-3a60feb2a2f8

    with tb1 as(SELECT
    *
    from solana.core.dim_labels
    where label_type='cex'
    )

    select
    date_trunc('hour',BLOCK_TIMESTAMP) as hour,
    'From network to CEXs' as paths,
    count(distinct tx_id) as no_transfer,
    count(distinct tx_from) as no_sender,
    sum(AMOUNT) as total_volume,
    avg(AMOUNT) as avg_volume
    from solana.core.fact_transfers
    where tx_to in (select ADDRESS from tb1)
    and tx_from not in (select ADDRESS from tb1)
    and mint = 'NeonTjSjsuo3rexg9o6vHuMXw62f9V7zvmu8M8Zut44'
    group by 1

    union ALL

    select
    date_trunc('hour',BLOCK_TIMESTAMP) as hour,
    'From CEXs to network' as paths,
    count(distinct tx_id) as no_transfer,
    count(distinct tx_to) as no_sender,
    sum(AMOUNT) as total_volume,
    avg(AMOUNT) as avg_volume
    from solana.core.fact_transfers
    where tx_from in (select ADDRESS from tb1)
    and tx_to not in (select ADDRESS from tb1)
    and mint = 'NeonTjSjsuo3rexg9o6vHuMXw62f9V7zvmu8M8Zut44'
    group by 1

    Run a query to Download Data