Abolfazl_771025Volume of Stake and Un-stake at last 6 month
    Updated 2022-07-19
    WITH deligate as (
    SELECT
    date_trunc('day',BLOCK_TIMESTAMP) as "date1",
    SUM(amount / pow(10,6)) AS "DELIGATOR VOLUME"
    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",
    SUM(amount / pow(10,6)) AS "UNDELIGATOR VOLUME"
    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 VOLUME",
    "UNDELIGATOR VOLUME"
    FROM deligate FULL JOIN undeligate on "date1"="date2"
    GROUP by 1,2,3
    ORDER by 1
    Run a query to Download Data