Query editor
select sum(volume_usd) as volume, count(distinct tx_hash) as tx_cnt, count(distinct tx_from) as user_cntfrom zeroex.api_fillswhere affiliate_address= 0xe5b89fa771049df021dcf3817bfc756bb2f85f96and case when '{{date}}' = 'today' then (block_date >= now() - interval '{{days}}' day)else block_date >= cast('{{date}}' as date) endand case when '{{date}}' = 'today' then (block_date <= now() )else block_date <= cast('{{date}}' as date) + interval '{{days}}' day end-- and block_date > cast('{{begin_date}' as TIMESTAMP)-- and block_date < cast('{{end_date}' as TIMESTAMP)