alirsuser06-02
    Updated 2023-01-04
    with First_Act as (
    SELECT
    min(BLOCK_TIMESTAMP) as first_date
    ,tx_from
    FROM osmosis.core.fact_transactions
    GROUP by 2
    )
    SELECT
    date_trunc('week', first_date ) as date,
    action_name,
    count(*)
    FROM (
    SELECT
    first_date,
    'Swap' as action_name
    FROM osmosis.core.fact_swaps
    JOIN First_Act
    ON trader = tx_from
    AND first_date = BLOCK_TIMESTAMP
    UNION
    SELECT
    first_date,
    'staking' as action_name
    FROM osmosis.core.fact_staking
    JOIN First_Act
    ON TX_CALLER_ADDRESS = tx_from
    AND first_date = BLOCK_TIMESTAMP
    UNION
    select 'Governance Vote' as Action_name,
    block_timestamp,
    t1.tx_id,
    voter as osmouser
    from osmosis.core.fact_governance_votes t1 join Finaltable t2 on t1.voter = t2.OSMO_User and t1.block_timestamp > t2.entry_date
    where tx_status = 'SUCCEEDED'),
    union
    Run a query to Download Data