bachiOsmo holders1
    Updated 2022-07-13
    with stakers as (
    SELECT
    DISTINCT DELEGATOR_ADDRESS
    from
    osmosis.core.fact_staking
    where
    TX_STATUS = 'SUCCEEDED'
    ),
    LPers as (
    SELECT
    DISTINCT LIQUIDITY_PROVIDER_ADDRESS
    from
    osmosis.core.fact_liquidity_provider_actions
    where
    TX_STATUS = 'SUCCEEDED'
    and CURRENCY = 'uosmo'
    )
    SELECT
    date(BLOCK_TIMESTAMP) as day,
    count(DISTINCT tx_id) as no_of_txns,
    sum(no_of_txns) over (
    order by
    day
    ) as cumulative_txns,
    count(DISTINCT Receiver) as no_of_users,
    sum(no_of_users) over (
    order by
    day
    ) as cumulative_wallets,
    case when Receiver in (
    SELECT
    DELEGATOR_ADDRESS
    from
    stakers
    ) THEN 'Stakers' when Receiver in (
    SELECT
    Run a query to Download Data