jackguysushi_l2_2 copy copy copy
    Updated 2023-03-10
    -- forked from 63410b29-3e4b-458f-8431-5930ec3f98de

    -- forked from 3e538a2a-0e1f-4a25-9242-d256f9727575

    -- forked from e491f158-d479-41ac-9d02-b33aedbec8ef

    SELECT
    avg(transaction),
    avg(active_users),
    avg(swap_volume_USD)


    from (
    SELECT
    date_trunc('day', block_timestamp) as day,
    count(DISTINCT tx_hash) as transaction,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as active_users,
    sum(CASE when not amount_in_usd is NULL then AMOUNT_IN_USD
    when not amount_out_usd is NULL then AMOUNT_OUT_USD
    else 0 end) as swap_volume_USD

    FROM gnosis.sushi.ez_swaps
    GROUP BY 1
    HAVING day > '2022-01-01'
    --LIMIT 500
    )




    Run a query to Download Data