Abolfazl_771025Behavior of unstaker after three month
    Updated 2022-07-19
    WITH delegate as (
    SELECT
    max(BLOCK_TIMESTAMP) as "date1",
    delegator_address as "wallet",
    SUM(amount / pow(10,6)) AS "DELIGATOR VOLUME"
    FROM osmosis.core.fact_staking
    WHERE ACTION = 'delegate'
    AND tx_status = 'SUCCEEDED'
    AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
    group by 2
    order by 1
    ), undelegate as (
    SELECT
    max(BLOCK_TIMESTAMP) as "date2",
    delegator_address as "wallet",
    'All_unstakers' as type,
    SUM(amount / pow(10,6)) AS "UNDELIGATOR VOLUME"
    FROM osmosis.core.fact_staking
    WHERE ACTION = 'undelegate'
    AND tx_status = 'SUCCEEDED'
    AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
    group by 2
    order by 1
    ), swap as (
    SELECT
    max(BLOCK_TIMESTAMP) as "date3",
    trader as "wallet",
    SUM(from_amount / pow(10,6)) AS "SWAP VOLUME"
    FROM osmosis.core.fact_swaps
    WHERE from_currency = 'uosmo'
    AND tx_status = 'SUCCEEDED'
    AND BLOCK_TIMESTAMP BETWEEN '2022-04-18' AND '2022-07-18'
    group by 2
    order by 1
    ), pool as (
    SELECT
    Run a query to Download Data