adriaparcerisasOsmosis Daily Active User 4
    Updated 2022-10-19
    WITH
    daus as (
    SELECT
    distinct tx_from as users,
    trunc(block_timestamp,'week') as weeks,
    count(distinct trunc(block_timestamp,'day')) as active_days
    from osmosis.core.fact_transactions
    group by 1,2
    having active_days>=4
    ),
    daus_2 as (
    select distinct users from daus
    ),
    /*prices as (
    select trunc(recorded_at,'week') as weeks,
    symbol,
    avg(price) as price
    from osmosis.core.dim_prices
    group by 1,2
    ),*/
    lps as (
    SELECT
    trunc(block_timestamp,'week') as weeks,
    case when tx_caller_address in (select * from daus_2) then 'DAU' else 'Non DAU' end as type,
    action,
    -- currency,
    count(distinct tx_id) as lp_actions,
    count(distinct tx_caller_address) as lp_providers
    -- sum(amount/pow(10,decimal)) as volume
    from osmosis.core.fact_staking
    group by 1,2,3
    ), /*
    lps_2 as (
    SELECT
    lps.weeks,type,action,sum(lp_actions) as lp_actions,
    sum(volume*price) as volume,avg(volume*price) as avg_volume
    Run a query to Download Data