-- forked from e3daa87f-0859-46cb-af79-0532fcf6677e
SELECT
date_trunc('day',block_timestamp) as date,
ACTION,
count(DISTINCT tx_id) as total_transactions,
count(DISTINCT sender) as users,
sum(amount/pow(10,6)) as daily_volume,
avg(amount/pow(10,6)) as daily_avg_volume
FROM osmosis.mars.ez_redbank_actions
where tx_succeeded='TRUE'
AND date > CURRENT_DATE-30
GROUP BY 1,2