ramishoowUntitled Query
    Updated 2023-01-05
    (SELECT date_trunc ('week',block_timestamp) as time, action, count (distinct TX_ID) as TX_Count, sum (amount) as Volume
    FROM terra.core.ez_staking WHERE action = 'Delegate' and time >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE' group by 1,2
    order by 1) UNION ALL (SELECT date_trunc ('week',block_timestamp) as time, action, count (distinct TX_ID)*(-1) as TX_Count,
    sum (amount)*(-1) as Volume FROM terra.core.ez_staking WHERE action = 'Undelegate' and time >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
    -- sum (amount)*(-1) as Volume FROM terra.core.ez_staking WHERE action = 'Undelegate' and date >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
    group by 1,2 order by 1)
    Run a query to Download Data