with all_txns as (
SELECT
block_timestamp,
tx_hash
FROM polygon.core.ez_decoded_event_logs
WHERE contract_name ilike '%Azuro%'
AND block_timestamp::date >= '2023-01-01'
)
SELECT
count(DISTINCT a.tx_hash) as n_bets,
count(DISTINCT decoded_log:bettor) as n_bettor,
sum(decoded_log:amount/1e6) as volume
FROM polygon.core.ez_decoded_event_logs a
JOIN all_txns b ON a.tx_hash = b.tx_hash
WHERE event_name = 'NewBet'
AND a.block_timestamp::date >= '2023-01-01'