jackguy2023-07-10 12:31 PM
    Updated 2023-10-16
    SELECT
    platform,
    count(DISTINCT ORIGIN_FROM_ADDRESS) as users,
    sum(
    CASE when amount_in_usd is not NULL then amount_in_usd
    when amount_out_usd is not NULL then amount_out_usd
    else amount_out * price end
    ) as volume_usd
    -- count(DISTINCT pool_name) as pools,
    -- sum()
    FROM optimism.core.ez_dex_swaps
    LEFT outer JOIN ethereum.core.fact_hourly_token_prices
    ON symbol = symbol_out
    and hour = date_trunc('hour', block_timestamp)
    WHERE block_timestamp > '2023-01-01'
    GROUP BY 1
    --LIMIT 100
    Run a query to Download Data