adriaparcerisasWhat's Going On With Gnosis? 3
    Updated 2022-10-16
    WITH
    labels as (
    SELECT
    address,
    address_name,
    project_name
    from gnosis.core.dim_labels
    ),
    transfers as (
    SELECT
    trunc(block_timestamp,'hour') as date,
    case when eth_from_address=lower('0x37eFe9B31830653039edC3b212a6e1B882CD46b4') then 'Out'
    else 'In' end as actions,
    count(distinct tx_hash) as txs,
    sum(amount_usd) as volume,
    avg(amount_usd) as avg_volume
    from gnosis.core.ez_xdai_transfers
    where date >= '2022-09-01' and (eth_from_address=lower('0x37eFe9B31830653039edC3b212a6e1B882CD46b4')
    or eth_to_address=lower('0x37eFe9B31830653039edC3b212a6e1B882CD46b4'))
    group by 1,2
    ),
    new_users as (
    SELECT
    distinct from_address,
    min(block_timestamp) as debut
    from gnosis.core.fact_transactions
    group by 1
    ),
    new_users_2 as (
    SELECT
    trunc(debut,'day') as date,
    count(distinct from_address) as new_users
    from new_users where date >='2022-09-01'
    group by 1
    )
    SELECT
    Run a query to Download Data