Ali3NDaily Ethereum Uniswaps Stats During FTX Collapse by FTX Outflowers
    Updated 2022-12-01
    with cextable as (
    select *
    from ethereum.core.dim_labels
    where label_type ilike 'cex'),
    Outflowt as (
    select block_timestamp,
    to_address as receiver
    from ethereum.core.ez_token_transfers
    where from_address in (select distinct address from cextable)
    and to_address not in (select distinct address from cextable)
    and block_timestamp >= '2022-10-25'
    union ALL
    select block_timestamp,
    eth_to_address as receiver
    from ethereum.core.ez_eth_transfers
    where eth_from_address in (select distinct address from cextable)
    and Eth_to_address not in (select distinct address from cextable)
    and block_timestamp >= '2022-10-25')

    select t1.block_timestamp::date as date,
    case when date < '2022-11-08' then 'Before Collapse'
    when date >= '2022-11-08' and date <= '2022-11-10' then 'Main Collapse Days'
    when date > '2022-11-10' then 'After Collapse' end as timespan,
    count (distinct tx_hash) as Swaps_Count,
    count (distinct recipient) as Swappers_Count,
    abs (sum (amount0_usd)) as Total_Volume
    from ethereum.uniswapv3.ez_swaps t1 join Outflowt t2 on t1.recipient = t2.receiver and t1.block_timestamp > t2.block_timestamp
    where t1.block_timestamp >= '2022-10-25' and t1.block_timestamp::date != CURRENT_DATE
    group by 1,2
    order by 1
    Run a query to Download Data