prateemType of transaction
    Updated 2024-03-14
    with ETH_price as (
    select
    HOUR::date as date,
    avg(price) as Price
    from ethereum.price.ez_hourly_token_prices
    where symbol = 'WETH'
    and HOUR between '2023-10-01 00:00:00.000' and '2023-12-31 23:59:59.000'
    group by 1
    ),
    address as (
    select
    distinct USER_ADDRESS,
    BALANCE/pow(10,18) * price as USD_Bal
    from ethereum.core.fact_eth_balances a join ETH_price b on a.BLOCK_TIMESTAMP::date = b.date
    where USD_Bal >= 1e7
    )
    select
    BLOCK_TIMESTAMP::date as date,
    label_type,
    label,
    count(distinct tx_hash) as "Outflow # TXs"
    from ethereum.core.ez_token_transfers join ethereum.core.dim_labels on to_address = address
    where BLOCK_TIMESTAMP between '2023-10-01 00:00:00.000' and '2023-12-31 23:59:59.000'
    and FROM_ADDRESS in (select USER_ADDRESS from address)
    and to_address not in (select USER_ADDRESS from address)
    and symbol not in ('SAITAMA' , 'UCoin' , 'SMOL', 'AGF', 'AsunaInu', 'CNDL', 'CGT')
    and DECIMALS != 0
    and AMOUNT_USD >= 1e7
    group by 1,2,3

    QueryRunArchived: QueryRun has been archived