Moepepe 4 -
    Updated 2024-03-07
    with prices as (select
    HOUR::date date,
    avg(PRICE) as price
    from
    ethereum.price.ez_hourly_token_prices
    where
    token_address ilike '0x6982508145454Ce325dDbE47a25d4ec3d2311933'
    and date >= current_date - 30
    group by
    1)
    ,
    main_table as (
    select
    * , price*amount as usd_amt
    from
    ethereum.core.ez_token_transfers , prices
    where
    block_timestamp::date = date
    and
    CONTRACT_ADDRESS ilike '0x6982508145454Ce325dDbE47a25d4ec3d2311933'

    and not to_address = '0x0000000000000000000000000000000000000000'
    and not from_address = '0x0000000000000000000000000000000000000000'



    )

    ,

    base as (
    select

    count (distinct tx_hash) as txs,
    count (distinct ORIGIN_FROM_ADDRESS) as senders,
    count (distinct ORIGIN_to_ADDRESS) as RECEIVERs,
    QueryRunArchived: QueryRun has been archived