kidaUniswap 1M Bucket (ARB)
    Updated 2024-07-31
    -- forked from Uniswap 1M Bucket @ https://flipsidecrypto.xyz/studio/queries/d9877aba-d729-4615-a19d-5b693349d470

    with prices as (
    select
    trunc(hour, 'hour') as hour,
    avg(price) as price
    from
    ethereum.price.ez_prices_hourly
    where symbol = 'ETH'
    group by 1
    ),

    transactions as (
    select
    trunc(d.block_timestamp, 'hour') as hour,
    d.tx_hash,
    d.amount_in_usd,
    d.amount_out_usd,
    coalesce(d.amount_in_usd, d.amount_out_usd) as tx_vol,
    t.gas_used,
    t.gas_limit,
    t.tx_fee
    -- t.tx_fee_precise
    from arbitrum.defi.ez_dex_swaps d
    join arbitrum.core.fact_transactions t
    on t.tx_hash = d.tx_hash
    where platform like 'uniswap%'
    and tx_vol is not null
    ),

    detailed_txs as (
    select
    t.hour,
    t.tx_hash,
    t.gas_used,
    t.gas_limit,
    QueryRunArchived: QueryRun has been archived