with
data as (
select
block_timestamp,
tx_hash,
origin_from_address,
action,
symbol,
amount
from ethereum.sushi.ez_borrowing
where symbol in ('USDC','USDT','DAI','UST','FEI','FRAX','BUSD','TUSD','sUSD')
and action = 'Borrow' -- Repay
)
select
date(block_timestamp) as date,
symbol,
count(tx_hash) as txs,
count(distinct origin_from_address) as users,
sum(amount) as vol
from data
where block_timestamp >= '2022-06-06'
group by 1,2
-- limit 100