MadiStake & unstake count
    Updated 2023-04-13
    (SELECT
    -- date_trunc ('week',block_timestamp) as date,
    case when action = 'Delegate' then 'Stake' end as action,
    count (distinct TX_ID) as TX_Count,
    sum (amount) as Volume
    -- case when action = 'Delegate' then 'Stake' end as action
    FROM terra.core.ez_staking
    WHERE action = 'Delegate' and block_timestamp >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
    group by 1
    order by 2
    )

    UNION ALL

    (SELECT
    -- date_trunc ('week',block_timestamp) as date,
    case when action = 'Undelegate' then 'Unstake' end as action,
    count (distinct TX_ID) as TX_Count,
    sum (amount) as Volume
    FROM terra.core.ez_staking
    WHERE action = 'Undelegate' and block_timestamp >= CURRENT_DATE - 180 and TX_SUCCEEDED = 'TRUE'
    group by 1
    order by 2
    )
    Run a query to Download Data