MoDeFinear users
    Updated 2024-03-24
    with users_txs as (
    select BLOCK_TIMESTAMP, TX_SIGNER as user
    from near.core.fact_transactions
    where TX_STATUS='Success'
    union
    select BLOCK_TIMESTAMP, TX_RECEIVER
    from near.core.fact_transactions
    where TX_STATUS='Success'
    union
    select distinct a.BLOCK_TIMESTAMP, RECEIVER_ID as user
    from near.core.fact_receipts a
    join near.core.fact_transactions b
    on a.tx_hash=b.tx_hash
    where TX_STATUS='Success'
    ),

    users as (
    select user, min(BLOCK_TIMESTAMP) as min_date
    from users_txs
    group by 1)

    select date_trunc(day, min_date) as "Date", count(distinct user) as "Wallets",
    sum("Wallets") over (order by "Date") as "Total Wallets"
    from users
    where "Date" is not null
    group by 1



    QueryRunArchived: QueryRun has been archived