SELECT
-- date_trunc('week', block_timestamp) as week,
count(DISTINCT tx_hash) as events,
count(DISTINCT PAYER) as users,
sum(AMOUNT_PAID * price) as volume
FROM ethereum.maker.ez_repayments
LEFT outer JOIN ethereum.core.fact_hourly_token_prices
ON hour = date_trunc('day', block_timestamp)
AND ethereum.maker.ez_repayments.symbol = ethereum.core.fact_hourly_token_prices.symbol
WHERE block_timestamp > '2021-01-01'
--GROUP BY 1