kidaAcross Volume By Category
    Updated 2023-01-03
    with
    weth_prices as (
    select
    date(hour) as date,
    decimals,
    symbol,
    token_address,
    avg(price) as price
    from ethereum.core.fact_hourly_token_prices
    where symbol = 'WETH'
    group by date, decimals, symbol, token_address
    ),
    eth_prices as (
    select
    date(hour) as date,
    decimals,
    symbol,
    token_address,
    avg(price) as price
    from ethereum.core.fact_hourly_token_prices
    group by date, decimals, symbol, token_address
    ),

    eth_token_volume as (
    select
    block_timestamp::date as date,
    tx_hash,
    '0x' || substr(topics[2], 1 + 2 + 24, 40) as token_address,
    '0x' || substr(topics[3], 1 + 2 + 24, 40) as user_address,
    tokenflow_eth.hextoint(substr(data, 1 + 2 + 64 * 0, 64)) as amount
    from ethereum.core.fact_event_logs
    where topics[0] = '0x4a4fc49abd237bfd7f4ac82d6c7a284c69daaea5154430cff04ad7482c6c4254' -- FundsDeposited
    and tx_status = 'SUCCESS'
    ),

    Run a query to Download Data