Abolfazl_771025The number of steaks and Un-stakes in the last 6 months
    Updated 2022-07-19
    WITH deligate as (
    SELECT
    date_trunc('day',BLOCK_TIMESTAMP) as "date1",
    COUNT(distinct delegator_address) AS "DELIGATOR COUNT"
    FROM osmosis.core.fact_staking
    WHERE ACTION = 'delegate'
    AND tx_status = 'SUCCEEDED'
    AND "date1" BETWEEN '2022-01-18' AND '2022-07-18'
    group by 1
    order by 1
    ), undeligate as (
    SELECT
    date_trunc('day',BLOCK_TIMESTAMP) as "date2",
    COUNT(distinct delegator_address) AS "UNDELIGATOR COUNT"
    FROM osmosis.core.fact_staking
    WHERE ACTION = 'undelegate'
    AND tx_status = 'SUCCEEDED'
    AND "date2" BETWEEN '2022-01-18' AND '2022-07-18'
    group by 1
    order by 1
    )
    SELECT
    "date1",
    "DELIGATOR COUNT",
    "UNDELIGATOR COUNT"
    FROM deligate FULL JOIN undeligate on "date1"="date2"
    GROUP by 1,2,3
    ORDER by 1
    Run a query to Download Data