select
date_trunc(day,BLOCK_TIMESTAMP) as days,
action,
count(distinct TX_ID) as tx_count,
sum(amount/pow(10,18)) as amount
from
osmosis.core.fact_liquidity_provider_actions
where POOL_ID = 704 and TX_STATUS = 'SUCCEEDED'
and action in ('pool_joined' , 'pool_exited')
and currency != 'uosmo'
group by 1,2