Hessishfdn_stark - dau -ekubo tot
    Updated 2024-09-17
    -- forked from fdn_stark - dau - sith tot @ https://flipsidecrypto.xyz/edit/queries/36b1289d-ac57-42d8-b30d-e1d67c8b8f1a


    with tenk_all as (sELECT DISTINCT tx_hash as hash0
    from external.tokenflow_starknet.decoded_traces
    where
    caller in ('0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b') and
    FUNCTION = '__default__'
    and chain_id= 'mainnet'
    ),


    sith_all as
    (SELECT timestamp::date as date, contract as user
    from external.tokenflow_starknet.decoded_transactions join tenk_all on tx_hash =hash0
    and chain_id = 'mainnet')


    SELECT count(DISTINCT user) as "toal users",
    count(DISTINCT user)/count(DISTINCT date_trunc('day',date)) as "avg daily users",
    count(DISTINCT user)/count(DISTINCT date_trunc('week',date)) as "avg weekly users",
    count(DISTINCT user)/count(DISTINCT date_trunc('month',date)) as "avg monhtly users"
    from sith_all



    Auto-refreshes every 24 hours
    QueryRunArchived: QueryRun has been archived