adriaparcerisasCEL swap volume over the past 90 days
    Updated 2022-07-29
    -- What are the top addresses swapping and transferring CEL?
    -- How have the CEL swap volumes changed over the past 90 days?
    -- How are Celsius wallets interacting with the CEL token?

    WITH
    swaps_in as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(amount_in) as tokens_acquired
    from ethereum.core.ez_dex_swaps where token_in='0xaaaebe6fe48e54f431b0c390cfaf0b017d09d42d'
    group by 1
    ),
    swaps_out as (
    SELECT
    trunc(block_timestamp,'day') as date,
    sum(amount_out) as tokens_sold
    from ethereum.core.ez_dex_swaps where token_out='0xaaaebe6fe48e54f431b0c390cfaf0b017d09d42d'
    group by 1
    )
    SELECT
    x.date,
    tokens_acquired,
    tokens_sold*(-1) as tokens_solds,
    tokens_acquired-tokens_sold as net_volume
    from swaps_in x, swaps_out y where x.date=y.date and x.date >CURRENT_DATE-90
    order by 1 asc

    Run a query to Download Data