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

    UNION ALL

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

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