misaghlbAcross Protocol Airdrop
    Updated 2022-12-05
    with swap_data as (
    select 'Buy' as type,
    block_timestamp,
    TX_HASH,
    ORIGIN_FROM_ADDRESS as trader,
    AMOUNT_IN as vol,
    AMOUNT_IN_USD as usd_vol
    from ethereum.core.ez_dex_swaps
    where TOKEN_OUT = '0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f'

    UNION ALL

    select 'Sell' as type,
    block_timestamp,
    TX_HASH,
    ORIGIN_FROM_ADDRESS as trader,
    AMOUNT_OUT as vol,
    AMOUNT_OUT_USD as usd_vol
    from ethereum.core.ez_dex_swaps
    where TOKEN_IN = '0x44108f0223a3c3028f5fe7aec7f9bb2e66bef82f'
    )

    select
    date_trunc('hour', block_timestamp) as date,
    type,
    count(distinct TX_HASH) as swaps,
    count(distinct trader) as wallets,
    sum(vol) as total_vol,
    avg(vol) as avg_vol,
    sum(total_vol) over (partition by type order by date) as cumu_usd_vol,
    sum(swaps) over (partition by type order by date) as cumu_swaps
    from swap_data
    group by date, type
    Run a query to Download Data