kasadeghUntitled Query
    Updated 2022-10-16
    with sol_cex_tx_stats as (
    select block_timestamp::date as day,
    count(distinct tx_id) as cex_tx_count ,
    count(distinct tx_from) as cex_users,
    avg(amount) as cex_avg_amount,
    sum(amount) as cex_total_amount
    from solana.core.fact_transfers inner join solana.core.dim_labels
    on tx_to = address
    where mint = 'So11111111111111111111111111111111111111112' and
    label_type in ( 'cex') and
    day >='2022-10-1'
    group by 1
    order by 1
    )
    select day,
    case
    when day = '2022-10-11' then 'The hack'
    when day < '2022-10-11' then 'Before the hack'
    when day > '2022-10-11' then 'After the hack'
    end period,
    cex_tx_count,
    avg(cex_tx_count) over (order by day ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) as "3Day_MA_cex_tx_count",
    cex_users,
    avg(cex_users) over (order by day ROWS BETWEEN 3 PRECEDING AND CURRENT ROW) as "3Day_MA_cex_users_count",
    cex_total_amount,
    cex_avg_amount
    from sol_cex_tx_stats

    Run a query to Download Data