rain_syndicaEthereum 2022 Tokens First Week USD Volume
    Updated 2023-05-22
    WITH all_launched_tokens AS (
    SELECT
    token_out AS token,
    block_timestamp,
    tx_hash
    FROM ethereum.core.ez_dex_swaps
    WHERE block_timestamp >= '2022-01-01'
    AND block_timestamp <= '2022-12-31'
    QUALIFY first_value(tx_hash) over (partition by token_out order by block_timestamp) = tx_hash
    ),

    launched_tokens AS (
    SELECT a.token, b.label, b.address_name
    FROM all_launched_tokens a LEFT JOIN ethereum.core.dim_labels b
    ON a.token = b.address
    WHERE
    block_timestamp >= '2022-01-01'
    AND block_timestamp <= ' 2022-12-31'
    ),

    from_swaps AS (
    SELECT
    a.block_timestamp,
    amount_in,
    token_in,
    token_out,
    amount_out,
    amount_in_usd,
    amount_out_usd,
    amount_in * b.price AS swap_from_usd,
    amount_out * c.price AS swap_to_usd,
    a.tx_hash
    FROM ethereum.core.ez_dex_swaps a
    LEFT JOIN all_launched_tokens d
    ON a.token_in = d.token
    LEFT JOIN ethereum.core.fact_hourly_token_prices b
    Run a query to Download Data